static void Main() { Application.AddMessageFilter(new MouseWheelMessageFilter()); try { SemanticTypeSystem = new STS(); Skin = new Membrane(SemanticTypeSystem); Skin.Name = "Skin"; // Receptors = new ReceptorsContainer(); // Receptors.SemanticTypeSystem = SemanticTypeSystem; DropReceptor = new DropReceptor(Skin.ReceptorSystem); // Program.Skin.RegisterReceptor("DropReceptor", dr); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppState = new StatePersistence(); AppState.ReadState("appState.xml"); // Load the last application state. MainForm = MycroParser.InstantiateFromFile <Form>("mainform.xml", null); Application.Run(MainForm); AppState.WriteState("appState.xml"); // Save the application state. } catch (Exception ex) { System.Diagnostics.Debugger.Break(); } }
/// <summary> /// Default ctor /// </summary> internal AppState(IStateUserInterface ui, MainForm mainForm) { Application.ThreadException += (s, x) => OnErrorPowerDown(x.Exception); Application.Idle += (s, x) => OnApplicationIdle(); this.ui = ui; this.mainForm = mainForm; var persistence = new StatePersistence(); statePersistence = persistence; server = new Core.Server.Impl.Server(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Cef.Initialize(); try { AppState = new StatePersistence(); AppState.ReadState("appState.xml"); // Load the last application state. MainForm = MycroParser.InstantiateFromFile <Form>("mainform.xml", null); Application.Run(MainForm); AppState.WriteState("appState.xml"); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace, "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public StatePersistenceAttribute(StatePersistence statePersistence) { StatePersistence = statePersistence; }