Пример #1
0
 private static void RestoreVisibility(PaletteSetBase paletteSet, Document doc)
 {
     if (paletteSet.HasVisibleState())
     {
         paletteSet.Show(doc);
     }
 }
Пример #2
0
        /// <summary>
        /// Show the palette by palette type and document.
        /// </summary>
        /// <param name="paletteSetType"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public static PaletteSetBase DisplayPaletteSet(PaletteSetType paletteSetType, Document document)
        {
            PaletteSetBase paletteSet = null;

            if (_allPaletteSets == null)
            {
                var paletteSetTypes = Enum.GetValues(typeof(PaletteSetType));
                _allPaletteSets = new PaletteSetBase[paletteSetTypes.Length];
            }
            else
            {
                paletteSet = _allPaletteSets[(int)paletteSetType];
            }

            if (paletteSet == null)
            {
                switch (paletteSetType)
                {
                case PaletteSetType.MapClean:
                    paletteSet = new MapCleanPaletteSet();
                    break;

                case PaletteSetType.ActionSequence:
                    paletteSet = new ActionSequencePaletteSet();
                    break;

                default:
                    return(null);
                }

                _allPaletteSets[(int)paletteSetType] = paletteSet;
            }

            paletteSet.Show(document);
            return(paletteSet);
        }