本文整理汇总了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);
}
}
示例2: Main
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
FrmMain = new MainForm();
Application.Run(FrmMain);
FrmMain.Dispose();
FrmMain = null;
GC.Collect();
}
示例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);
}
}
示例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 ();
}
示例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 ();
}
示例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();
}