/** ========================================
         *  EditorIniオブジェクト作成
         *  ======================================== */

        public static EditorIniData GenerateData0()
        {
            return(new EditorIniData
            {
                StartFlag = 0,
                LastLoadFile = "MapData/Map000.mps",
                MainWindowPosition = (0, 0),
                MainWindowSize = (651, 322),
                MapChipWindowPosition = (0, 0),
                MapEventWindowPosition = (273, 230),
                MapEventWindowSize = (840, 410),
                MapEventInputWindowPosition = (0, 0),
                CommonEventWindowPosition = (0, 0),
                CommonEventWindowSize = (800, 640),
                CommonEventInputWindowPosition = (0, 0),
                UserDbWindowPosition = (27, 54),
                ChangeableDbWindowPosition = (27, 54),
                SystemDbWindowPosition = (27, 54),
                DatabaseValueNumberDrawType = DatabaseValueNumberDrawType.FromCode("0"),
                EditTimeDrawType = EditTimeDrawType.On,
                EditTime = 14,
                NotEditTime = 0,
                IsShowDebugWindow = true,
                LayerTransparent = LaterTransparentType.FromCode("2"),
                EventLayerOpacity = EventLayerOpacityType.FromCode("1"),
                CommandColorType = CommandColorType.FromCode("0"),
                IsDrawBackgroundImage = true,
                NotCopyExtList = new ExtensionList(new Extension[]
                {
                    ".psd", ".sai", ".svg", ".xls", ".db", ".tmp",
                    ".bak", ".db", "dummy_file"
                }),
                CommandViewType = 0,
                BackupType = ProjectBackupType.FromCode("3"),
                ShortCutKeyList = new EventCommandShortCutKeyList(new[]
                {
                    EventCommandShortCutKey.One, EventCommandShortCutKey.Two, EventCommandShortCutKey.Three,
                    EventCommandShortCutKey.Four, EventCommandShortCutKey.Five, EventCommandShortCutKey.Six,
                    EventCommandShortCutKey.Seven, EventCommandShortCutKey.Eight, EventCommandShortCutKey.Nine,
                    EventCommandShortCutKey.A, EventCommandShortCutKey.B, EventCommandShortCutKey.C,
                    EventCommandShortCutKey.D, EventCommandShortCutKey.E, EventCommandShortCutKey.F,
                    EventCommandShortCutKey.G, EventCommandShortCutKey.H, EventCommandShortCutKey.I,
                    EventCommandShortCutKey.J, EventCommandShortCutKey.One, EventCommandShortCutKey.One,
                    EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One,
                    EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One,
                    EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One,
                }),
                CommandPositionList = new ShortCutPositionList(new ShortCutPosition[]
                {
                    1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1,
                    17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
                }),
                IsUseExpertCommand = false,
            });
Esempio n. 2
0
        public static void CommandColorTypeTest(CommandColorType type, bool isError)
        {
            var instance            = new EditorIniData();
            var changedPropertyList = new List <string>();

            instance.PropertyChanged += (sender, args) => { changedPropertyList.Add(args.PropertyName); };

            var errorOccured = false;

            try
            {
                instance.CommandColorType = type;
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                errorOccured = true;
            }

            // エラーフラグが一致すること
            Assert.AreEqual(errorOccured, isError);

            if (!errorOccured)
            {
                var setValue = instance.CommandColorType;

                // セットした値と取得した値が一致すること
                Assert.IsTrue(setValue.Equals(type));
            }

            // 意図したとおりプロパティ変更通知が発火していること
            if (errorOccured)
            {
                Assert.AreEqual(changedPropertyList.Count, 0);
            }
            else
            {
                Assert.AreEqual(changedPropertyList.Count, 1);
                Assert.IsTrue(changedPropertyList[0].Equals(nameof(EditorIniData.CommandColorType)));
            }
        }
        /// <summary>
        /// コマンドカラー種別からコマンドカラーを取得する。
        /// </summary>
        /// <param name="type">[NotNull] コマンドカラー種別</param>
        /// <returns>コマンドカラー</returns>
        /// <exception cref="ArgumentNullException">type が null の場合</exception>
        public Color GetCommandColor(CommandColorType type)
        {
            if (type is null)
            {
                throw new ArgumentNullException(
                          ErrorMessage.NotNull(nameof(type)));
            }

            if (type == CommandColorType.Old)
            {
                return(OldColor.Color);
            }
            if (type == CommandColorType.Type0)
            {
                return(Type1Color.Color);
            }
            if (type == CommandColorType.Type1)
            {
                return(Type2Color.Color);
            }

            // 通常ここへは来ない
            throw new InvalidOperationException();
        }
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
        //     Public Method
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

        /// <summary>
        /// コマンドカラー種別からコマンドカラーを取得する。
        /// </summary>
        /// <param name="type">[NotNull] コマンドカラー種別</param>
        /// <returns>コマンドカラー</returns>
        /// <exception cref="ArgumentNullException">type が null の場合</exception>
        public Color GetCommandColor(CommandColorType type)
        => ColorSet.GetCommandColor(type);