当前位置: 首页>>代码示例>>C#>>正文


C# MainForm.Dispose方法代码示例

本文整理汇总了C#中MainForm.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# MainForm.Dispose方法的具体用法?C# MainForm.Dispose怎么用?C# MainForm.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainForm的用法示例。


在下文中一共展示了MainForm.Dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        public static void Main()
        {
            try
            {
                Settings.Configurate();

                //database = new Database();
                felhasználó = null;
                database = new Database();

                LoginForm loginform = new LoginForm();
                Application.Run(loginform);
                database = new Database();
                if (loginform.felhasználó != null)
                {
                    felhasználó = loginform.felhasználó;
                    loginform.Dispose();

                    refresher = new Timer();
                    refresher.Interval = Settings.ui_refresh * 1000;
                    refresher.Tick += Refresher_Elapsed;
                    refresher.Start();

                    MainForm mainform = new MainForm();
                    Application.Run(mainform);

                    refresher.Dispose();
                    mainform.Dispose();
                }
            }
            catch (Exception _e)
            {
                MessageBox.Show("Kezeletlen globális hiba a program futása során!\nKérem jelezze a hibát a rendszergazdának!\nHiba adatai:\n" + _e.Message, "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);

                string file_name = string.Format("crash-{0:yyyy-MM-dd_hh-mm-ss}.data", DateTime.Now);

                try
                {
                    StreamWriter file = new StreamWriter(file_name);
                    file.WriteLine("Message:\t" + _e.Message);
                    file.WriteLine("Source:\t" + _e.Source);
                    file.WriteLine("Data:\t" + _e.Data);
                    file.WriteLine("Stack:\t" + _e.StackTrace);
                    file.Close();
                }
                catch (Exception _ex)
                {
                    MessageBox.Show("További hiba a kivétel mentésekor!\n" + _ex.Message, "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Environment.Exit(1);
                }

                MessageBox.Show("A hiba adatait a " + file_name + " nevű file tartalmazza!", "Hiba adatainak elérése", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Environment.Exit(0);
            }
        }
开发者ID:laszlo-dobcsanyi,项目名称:Labor,代码行数:55,代码来源:Program.cs

示例2: Main

    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        FrmMain = new MainForm();

        Application.Run(FrmMain);

        FrmMain.Dispose();
        FrmMain = null;
        GC.Collect();
    }
开发者ID:dpradov,项目名称:object-binding-source,代码行数:12,代码来源:Program.cs

示例3: m_cmd_dang_nhap_Click

 void m_cmd_dang_nhap_Click(object sender, EventArgs e)
 {
     try
     {
         Hide();
         MainForm main_form = new MainForm();
         main_form.ShowDialog();
         main_form.Dispose();
     }
     catch(Exception v_e)
     {
         ExceptionHandle.Show(v_e);
     }
 }
开发者ID:bkiprojects,项目名称:quydx_qlkho,代码行数:14,代码来源:f000_dang_nhap.cs

示例4: TestNestedControls2

		[Test] // bug 81695
		public void TestNestedControls2 ()
		{
			MainForm f = new MainForm ();
			f.ShowInTaskbar = false;

			f.Show ();
			
			Size s = f.Size;
			f.Size = new Size (10, 10);
			f.Size = s;
			
			Assert.AreEqual (new Rectangle (210, 212, 75, 23), f._userControl._button2.Bounds, "K1");

			f.Dispose ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:16,代码来源:DefaultLayoutTest.cs

示例5: Bug347669

		[Test]  // Should not throw AOORE
		public void Bug347669 ()
		{
			Form main = new MainForm ();
			main.Show ();
			Form frm = new Childform ();
			frm.MdiParent = main;
			frm.Show ();
			main.Dispose ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:10,代码来源:ToolStripManagerTest.cs

示例6: Main


//.........这里部分代码省略.........
                typeof(PropertyEditor),                 // property grid for editing selected objects
                typeof(GridPropertyEditor),             // grid control for editing selected objects
                typeof(PropertyEditingCommands),        // commands for PropertyEditor and GridPropertyEditor, like Reset,
                                                        // Reset All, Copy Value, Paste Value, Copy All, Paste All

                typeof(HistoryLister),                  // visual list of undo/redo stack
                typeof(PrototypeLister),                // editable palette of instantiable item groups
                typeof(LayerLister),                    // editable tree view of layers

                typeof(Outputs),                        // passes messages to all log writers
                // typeof(ErrorDialogService),             // displays errors to the user in a message box
                typeof(OutputService),                  // rich text box for displaying error and warning messages. Implements IOutputWriter.
                typeof(DomRecorder),                    // records and displays changes to the DOM for diagnostic purposes

                typeof(Editor),                         // editor which manages circuit documents and controls
                // typeof(SchemaLoader),                   // loads circuit schema and extends types
                // typeof(GroupingCommands),               // circuit group/ungroup commands
                typeof(DiagramControlRegistry),         // circuit controls management
                // typeof(LayeringCommands),               // "Add Layer" command
                // typeof(GraphViewCommands),              // zooming with presets
                typeof(PerformanceMonitor),             // displays the frame rate and memory usage
                typeof(DefaultTabCommands),             // provides the default commands related to document tab Controls
                // typeof(ModulePlugin),                   // component that defines circuit module types
                // typeof(TemplateLister),                 // template library for subgraph referencing or instancing 
                // typeof(TemplatingCommands),             // commands for promoting/demoting graph elements to/from template library 
                //typeof(TemplatingSupervisor),         // templated instances copy-on-edit support(optionally)

                typeof(AnnotatingCommands),             // annotating commands
                // typeof(CircuitTestCommands),            // circuit tester commands

                typeof(PythonService),                  // scripting service for automated tests
                typeof(ScriptConsole),                  // provides a dockable command console for entering Python commands
                typeof(AtfScriptVariables),             // exposes common ATF services as script variables
                typeof(AutomationService),              // provides facilities to run an automated script using the .NET remoting service

                typeof(SkinService),

                typeof(ShaderPatcherLayer.Manager),
                typeof(ShaderFragmentArchive.Archive),
               
                typeof(Controls.DiagramControl),
                typeof(Controls.ShaderFragmentArchiveControl),
                typeof(Controls.DiagramLister),

                typeof(NodeEditorCore.ShaderFragmentArchiveModel),
                typeof(NodeEditorCore.ModelConversion),
                typeof(NodeEditorCore.ShaderFragmentNodeCreator),
                typeof(NodeEditorCore.DiagramDocument),

                typeof(ControlsLibraryExt.Commands.CommonCommands),
                typeof(ControlsLibraryExt.Material.MaterialInspector),
                typeof(ControlsLibraryExt.Material.MaterialSchemaLoader),
                typeof(ControlsLibraryExt.ModelView.ActiveModelView),

                typeof(ActiveMaterialContext),
                typeof(DiagramCommands)
            );

            // enable use of the system clipboard
            StandardEditCommands.UseSystemClipboard = true;

            // Set up the MEF container with these components
            var container = new CompositionContainer(catalog);

            // This is bit wierd, but we're going to add the container to itself.
            // This will create a tight circular dependency, of course
            // It's also not ideal by the core DI pattern. 
            // But it's useful for us, because we want to use the same container to construct
            // objects (and also to retrieve global instances).
            container.ComposeExportedValue<ExportProvider>(container);
            container.ComposeExportedValue<CompositionContainer>(container);

            // Configure the main Form
            var batch = new CompositionBatch();
            var mainForm = new MainForm(new ToolStripContainer())
                {
                    Text = Application.ProductName //,
                    // Icon = GdiUtil.CreateIcon(ResourceUtil.GetImage(Sce.Atf.Resources.AtfIconImage))
                };
            // Sce.Atf.Direct2D.D2dFactory.EnableResourceSharing(mainForm.Handle);

            // Add the main Form instance, etc., to the container
            batch.AddPart(mainForm);
            // batch.AddPart(new WebHelpCommands("https://github.com/SonyWWS/ATF/wiki/ATF-Circuit-Editor-Sample".Localize()));
            container.Compose(batch);

            // We need to attach compilers for models, etc
            engineDevice.AttachDefaultCompilers();

            container.InitializeAll();
            Application.Run(mainForm);
            container.Dispose();
            mainForm.Dispose();

            logRedirect.Dispose();
            engineDevice.PrepareForShutdown();
            XLEBridgeUtils.Utils.DetachLibrary();
            attach0.Dispose();
            engineDevice.Dispose();
        }
开发者ID:coreafive,项目名称:XLE,代码行数:101,代码来源:Program.cs


注:本文中的MainForm.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。