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
Example #1
0
        private void customizeCourseAppearanceMenu_Click(object sender, EventArgs e)
        {
            // Initialize the dialog
            CourseAppearanceDialog dialog = new CourseAppearanceDialog();

            // Get the correct default purple color to use.
            float c, m, y, k;
            bool purpleOverprint;
            short ocadId;
            FindPurple.GetPurpleColor(mapDisplay, null, out ocadId, out c, out m, out y, out k, out purpleOverprint);
            dialog.SetDefaultPurple(c, m, y, k);
            dialog.UsesOcadMap = (mapDisplay.MapType == MapType.OCAD);

            // Set the course appearance into the dialog
            dialog.CourseAppearance = controller.GetCourseAppearance();

            // Show the dialog.
            if (dialog.ShowDialog(this) == DialogResult.OK) {
                controller.SetCourseAppearance(dialog.CourseAppearance);
            }

            dialog.Dispose();
        }