コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: AppState.cs プロジェクト: michaeloed/BinkyRailways
        /// <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();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: yamamushi/ceptr
        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);
            }
        }
コード例 #4
0
 public StatePersistenceAttribute(StatePersistence statePersistence)
 {
     StatePersistence = statePersistence;
 }