Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
Результат void
Пример #1
0
        private void StartEditor()
        {
            DefinitionEditor editor = new DefinitionEditor();
            var result = editor.ShowDialog(this);

            editor.Dispose();
            if (result == DialogResult.Abort)
            {
                return;
            }
            if (result == DialogResult.OK)
            {
                LoadFile(m_dbcFile);
            }
            else
            {
                MessageBox.Show("Editor canceled! You can't open that file until you add proper definitions");
            }
        }
Пример #2
0
 private void StartEditor()
 {
     DefinitionEditor editor = new DefinitionEditor();
     var result = editor.ShowDialog(this);
     editor.Dispose();
     if (result == DialogResult.Abort)
         return;
     if (result == DialogResult.OK)
         LoadFile(m_dbcFile);
     else
         MessageBox.Show("Editor canceled! You can't open that file until you add proper definitions");
 }