예제 #1
0
        public void SetPaletteOption(PPConfig.PaletteOptions paletteOption, WithoutHaste.Drawing.Colors.ColorPalette colorPalette = null, string paletteFileName = null)
        {
            if (!OptionsHaveChanged(paletteOption, colorPalette, paletteFileName))
            {
                return;
            }

            Config.PaletteOption = paletteOption;
            switch (Config.PaletteOption)
            {
            case PPConfig.PaletteOptions.SaveNothing:
                Config.PaletteFileName = null;
                ColorPalette           = null;
                break;

            case PPConfig.PaletteOptions.SaveFile:
                Config.PaletteFileName = null;
                ColorPalette           = colorPalette;
                break;

            case PPConfig.PaletteOptions.SaveFileName:
                Config.PaletteFileName = paletteFileName;
                ColorPalette           = null;
                break;
            }
            EditedSinceLastSave = true;
        }
예제 #2
0
        /// <summary>
        /// Returns true when options or values have changed.
        /// </summary>
        private bool OptionsHaveChanged(PPConfig.PaletteOptions paletteOption, WithoutHaste.Drawing.Colors.ColorPalette colorPalette = null, string paletteFileName = null)
        {
            if (Config.PaletteOption == paletteOption)
            {
                switch (Config.PaletteOption)
                {
                case PPConfig.PaletteOptions.SaveNothing:
                    return(false);

                case PPConfig.PaletteOptions.SaveFile:
                    if (ColorPalette == colorPalette)
                    {
                        return(false);
                    }
                    break;

                case PPConfig.PaletteOptions.SaveFileName:
                    if (Config.PaletteFileName == paletteFileName)
                    {
                        return(false);
                    }
                    break;
                }
            }
            return(true);
        }
예제 #3
0
 public ProjectOptionsDialog(PPConfig config)
 {
     paletteOption = config.PaletteOption;
     InitForm();
 }