Example #1
0
 /// <summary>
 /// Create a new AppDomain to host FanHai GUI Framework.
 /// </summary>
 public SolarViewerHost(StartupSettings startup)
 {
     if (startup == null)
     {
         throw new ArgumentNullException("startup");
     }
     this.appDomain = CreateDomain();
     helper         = (CallHelper)appDomain.CreateInstanceAndUnwrap(SmfaAssembly.FullName, typeof(CallHelper).FullName);
     helper.InitMESCore(new CallbackHelper(this), startup);
     initStatus = SMFInitStatus.CoreInitialized;
 }
Example #2
0
 /// <summary>
 /// Unload the FanHai GUI Framework AppDomain. This will force FanHai GUI Framework
 /// to close without saving changed settings.
 /// Call CloseWorkbench before UnloadDomain to prompt the user to save documents and settings.
 /// </summary>
 public void UnloadDomain()
 {
     if (initStatus != SMFInitStatus.AppDomainUnloaded)
     {
         if (initStatus == SMFInitStatus.WorkbenchInitialized)
         {
             helper.KillWorkbench();
         }
         AppDomain.Unload(appDomain);
         initStatus = SMFInitStatus.AppDomainUnloaded;
     }
 }
Example #3
0
 /// <summary>
 /// Initializes the workbench (create the MainForm instance, construct menu from AddInTree etc.)
 /// and runs it using the supplied settings.
 /// This starts a new message loop for the workbench. By default the message loop
 /// is created on a new thread, but you can change the settings so that
 /// it is created on the thread calling RunWorkbench.
 /// In that case, RunWorkbench will block until FanHai GUI Framework is shut down!
 /// </summary>
 public void RunWorkbench(WorkbenchSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     if (initStatus == SMFInitStatus.CoreInitialized)
     {
         initStatus = SMFInitStatus.Busy;
         helper.RunWorkbench(settings);
         if (settings.RunOnNewThread)
         {
             initStatus = SMFInitStatus.WorkbenchInitialized;
         }
     }
     else
     {
         throw new InvalidOperationException();
     }
 }