@@ -94,6 +94,7 @@ public bool RunCommand(Save command)
9494 public bool RunCommand ( SaveAs command )
9595 {
9696 d_LusasData . saveAs ( command . FileName ) ;
97+ m_directory = new FileInfo ( command . FileName ) . Directory . FullName ;
9798
9899 return true ;
99100 }
@@ -106,6 +107,7 @@ public bool RunCommand(Open command)
106107 {
107108 m_LusasApplication . openDatabase ( command . FileName ) ;
108109 d_LusasData = m_LusasApplication . getDatabase ( ) ;
110+ m_directory = command . FileName ;
109111
110112 return true ;
111113 }
@@ -144,6 +146,48 @@ public bool RunCommand(ClearResults command)
144146
145147 /***************************************************/
146148
149+ public bool RunCommand ( Close command )
150+ {
151+ if ( command . SaveBeforeClose )
152+ {
153+ if ( d_LusasData . getDBFilename ( ) == "" )
154+ {
155+ Engine . Reflection . Compute . RecordError ( "The model file does not have a filename, please SaveAs before attempting to Save." ) ;
156+ return false ;
157+ }
158+ else
159+ d_LusasData . save ( ) ;
160+ }
161+
162+ d_LusasData . close ( ) ;
163+
164+ return true ;
165+ }
166+
167+ /***************************************************/
168+
169+ public bool RunCommand ( Exit command )
170+ {
171+ if ( command . SaveBeforeClose )
172+ {
173+ if ( d_LusasData . getDBFilename ( ) == "" )
174+ {
175+ Engine . Reflection . Compute . RecordError ( "The model file does not have a filename, please SaveAs before attempting to Save." ) ;
176+ return false ;
177+ }
178+ else
179+ d_LusasData . save ( ) ;
180+ }
181+
182+ d_LusasData . close ( ) ;
183+ m_LusasApplication . quit ( ) ;
184+ m_LusasApplication = null ;
185+
186+ return true ;
187+ }
188+
189+ /***************************************************/
190+
147191 public bool RunCommand ( IExecuteCommand command )
148192 {
149193 Engine . Reflection . Compute . RecordWarning ( $ "The command { command . GetType ( ) . Name } is not supported by this Adapter.") ;
0 commit comments