Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void
Esempio n. 1
0
        private void createPOTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PoAttributesDialog attributesDialog = new PoAttributesDialog();

            if (attributesDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            PoWriterAttributes attributes = new PoWriterAttributes()
            {
                Name     = attributesDialog.nameTextBox.Text,
                Email    = attributesDialog.emailTextBox.Text,
                Version  = attributesDialog.versionTextBox.Text,
                writePOT = true
            };

            attributesDialog.Dispose();

            SaveFileDialog dialog = new SaveFileDialog();

            dialog.DefaultExt = ".pot";

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                PoWriter potWriter = new PoWriter(dialog.FileName, attributes);
                potWriter.WritePot(resourceDirectory);
            }
        }
Esempio n. 2
0
        private void createPOTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PoAttributesDialog attributesDialog = new PoAttributesDialog();
            if (attributesDialog.ShowDialog(this) != DialogResult.OK)
                return;

            PoWriterAttributes attributes = new PoWriterAttributes() {
                Name = attributesDialog.nameTextBox.Text,
                Email = attributesDialog.emailTextBox.Text,
                Version = attributesDialog.versionTextBox.Text,
                writePOT = true};

            attributesDialog.Dispose();

            SaveFileDialog dialog = new SaveFileDialog();
            dialog.DefaultExt = ".pot";

            if (dialog.ShowDialog(this) == DialogResult.OK) {
                PoWriter potWriter = new PoWriter(dialog.FileName, attributes);
                potWriter.WritePot(resourceDirectory);
            }
        }