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
コード例 #1
0
        private void CustomizeColor(CmykColor color)
        {
            ColorChooserDialog colorChooserDialog = new ColorChooserDialog();

            colorChooserDialog.Color = color;

            if (colorChooserDialog.ShowDialog() == DialogResult.OK)
            {
                Color = new SpecialColor(colorChooserDialog.Color);
            }

            colorChooserDialog.Dispose();
            comboBox.Invalidate();

            SendChangeNotification();
        }
コード例 #2
0
        private void CustomizeColor(CmykColor color)
        {
            ColorChooserDialog colorChooserDialog = new ColorChooserDialog();
            colorChooserDialog.Color = color;

            if (colorChooserDialog.ShowDialog() == DialogResult.OK) {
                Color = new SpecialColor(colorChooserDialog.Color);
            }

            colorChooserDialog.Dispose();
            comboBox.Invalidate();

            SendChangeNotification();
        }