Exemple #1
0
        // TODO if sender is ToolStripComboBox vs ToolStripMenuItem

        private void UpdateColorPalette(object sender, EventArgs e)
        {
            // TODO if sender is ToolStripComboBox vs ToolStripMenuItem
            switch (ColorSettingOptions.SelectedItem)
            {
            case 0:
                MSVData.ColorPalette = ColorPaletteGenerator.GenerateIterationColors();
                break;

            case 1:
                Debug.Print("TODO: " + MethodBase.GetCurrentMethod().ReflectedType.FullName + " ==> " + MethodBase.GetCurrentMethod() + " ==> case 1");
                break;

            case 2:
                Debug.Print("TODO: " + MethodBase.GetCurrentMethod().ReflectedType.FullName + " ==> " + MethodBase.GetCurrentMethod() + " ==> case 2");
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemple #2
0
        /// <summary>
        /// This method will overwrite all saved data and initalize all the values to their
        /// hardcoded defaults
        /// </summary>
        public static void InitDefaultValues()
        {
            // The working area is the desktop area of the display, excluding
            // taskbars, docked windows, and docked tool bars.
            Rectangle ScreenWorkingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;

            // The bounds are for the entire screen (think fullscreen mode)
            // Rectangle ScreenBounds = System.Windows.Forms.Screen.PrimaryScreen.Bounds;

            MSVData.CalculationsEnabled = true;
            MSVData.ColorPalette        = ColorPaletteGenerator.GenerateIterationColors();
            MSVData.DrawSize            = new XY
            {
                X = (Decimal)(ScreenWorkingArea.Width - ScreenWorkingArea.X),
                Y = (Decimal)(ScreenWorkingArea.Height - ScreenWorkingArea.Y)
            };
            MSVData.InputEnabled              = true;
            MSVData.MenuVisible               = true;
            MSVData.MovementDown              = false;
            MSVData.MovementLeft              = false;
            MSVData.MovementRight             = false;
            MSVData.MovementUp                = false;
            MSVData.PanSpeed                  = 0;
            MSVData.RenderEnabled             = true;
            MSVData.SmoothAccelerationEnabled = false;
            MSVData.ZoomSpeed                 = 0;
            MSVData.PictureSize               = new XY {
                Xi = 512, Yi = 512
            };
            MathematicalSets = new Dictionary <string, Type>();
            var items = typeof(MathematicalSet).Assembly.GetTypes().Where(type => type.IsSubclassOf(typeof(MathematicalSet))).ToArray();

            for (int i = 0; i < items.Length; ++i)
            {
                Type            x        = items[i];
                MathematicalSet instance = (MathematicalSet)Activator.CreateInstance(x);
                MathematicalSets.Add(instance.Name, x);
                instance.Destroy();
            }
        }