Dispose() protected méthode

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
Résultat void
Exemple #1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Save();

            OpenDirectory dialog = new OpenDirectory();

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                LoadFiles(dialog.Directory, dialog.Culture);
            }

            dialog.Dispose();
        }
Exemple #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Save();

            OpenDirectory dialog = new OpenDirectory();

            if (dialog.ShowDialog(this) == DialogResult.OK) {
                LoadFiles(dialog.Directory, dialog.Culture);
            }

            dialog.Dispose();
        }