Exemplo n.º 1
0
        /// <summary>
        /// 環境設定をファイルから読み込む
        /// </summary>
        /// <param name="fileName">読み込む環境設定ファイル名</param>
        /// <returns>読み込んだ環境設定情報</returns>
        public static EditorOption LoadFile(string fileName)
        {
            if (File.Exists(fileName) == false)
            {
                //読み込むファイルがないときはとりあえずデフォルトでファイルを作成する
                SaveFile(fileName, new EditorOption());
            }

            ////設定ファイルを読み込み自分自身にコピーする
            //XmlSerializer serializer = new XmlSerializer(typeof(EditorOption));
            //FileStream fs;
            //EditorOption option = null;
            //using (fs = new FileStream(fileName, FileMode.Open))
            //{
            //    option = (EditorOption)serializer.Deserialize(fs);
            //}

            //return option;

            EditorOption option = null;

            try
            {
                option = loadFromXml(fileName);
            }
            catch (Exception err)
            {
                util.Msgbox.Error("エディタ設定ファイル" + Path.GetFileName(fileName) + "の読み込みに失敗しました\n" + err.Message);
                option = new EditorOption();                    //とりあえずデフォルトをセット
            }

            return(option);
        }
Exemplo n.º 2
0
        /// <summary>
        /// ファイルを読み込み画面状態を初期化する
        /// </summary>
        public void loadOption()
        {
            if (m_krkrType == FileType.KrkrType.Kag)
            {
                //カラー設定
                KagColorType          type = new KagColorType();
                IHighlightingStrategy hs   = HighlightingManager.Manager.FindHighlighter("KAG");
                loadBaseTypeColor(type, hs);
                loadKagTypeColor(type, (DefaultHighlightingStrategy)hs);
                colorPropertyGrid.SelectedObject = type;

                //タブ表示切り替え
                optionTabControl.TabPages.Clear();
                optionTabControl.TabPages.Add(colorTabPage);
                optionTabControl.TabPages.Add(fontTabPage);
                optionTabControl.TabPages.Add(showTabPage);
                optionTabControl.TabPages.Add(actionTabPage);
                optionTabControl.TabPages.Add(completeTabPage);
                optionTabControl.TabPages.Add(kag1TabPage);
                optionTabControl.TabPages.Add(kag2TabPage);
                optionTabControl.TabPages.Add(kagex1TabPage);
            }
            else if (m_krkrType == FileType.KrkrType.Tjs)
            {
                TjsColorType          type = new TjsColorType();
                IHighlightingStrategy hs   = HighlightingManager.Manager.FindHighlighter("TJS2");
                loadBaseTypeColor(type, hs);
                loadTjsTypeColor(type, (DefaultHighlightingStrategy)hs);
                colorPropertyGrid.SelectedObject = type;

                //タブ表示切り替え
                optionTabControl.TabPages.Clear();
                optionTabControl.TabPages.Add(colorTabPage);
                optionTabControl.TabPages.Add(fontTabPage);
                optionTabControl.TabPages.Add(showTabPage);
                optionTabControl.TabPages.Add(actionTabPage);
                //optionTabControl.TabPages.Add(completeTabPage);
            }
            else
            {
                BaseColorType         type = new BaseColorType();
                IHighlightingStrategy hs   = HighlightingManager.Manager.FindHighlighter("Default");
                loadBaseTypeColor(type, hs);
                colorPropertyGrid.SelectedObject = type;

                //タブ表示切り替え
                optionTabControl.TabPages.Clear();
                optionTabControl.TabPages.Add(colorTabPage);
                optionTabControl.TabPages.Add(fontTabPage);
                optionTabControl.TabPages.Add(showTabPage);
                optionTabControl.TabPages.Add(actionTabPage);
            }

            //エディタ設定
            EditorOption editorOption = GlobalStatus.EditorManager.GetEditorOption(m_krkrType);

            loadEditorOption(editorOption);
        }
Exemplo n.º 3
0
        /// <summary>
        /// フォント設定を初期化する
        /// </summary>
        private void initFontButton_Click(object sender, EventArgs e)
        {
            //フォント設定はタイプによらず共通
            EditorOption option = EditorOption.GetDefault(FileType.KrkrType.Unknown);

            updateFontPreviewBox(new Font(option.FontName, option.FontSize));
            useAntiAliasedFontCheckBox.Checked      = option.UseAntiAliasedFont;
            encodingNameComboBox.SelectedItem       = option.EncodingName;
            lineTerminatorNameComboBox.SelectedItem = option.LineTerminatorName;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 動作設定を初期化する
        /// </summary>
        private void initActionButton_Click(object sender, EventArgs e)
        {
            EditorOption option = EditorOption.GetDefault(m_krkrType);

            tabIndentUpDown.Value = option.TabIndent;
            convertTabsToSpacesCheckBox.Checked       = option.ConvertTabsToSpaces;
            indentationSizeUpDown.Value               = option.IndentationSize;
            indentStyleComboBox.SelectedItem          = option.IndentStyle;
            allowCaretBeyondEOLCheckBox.Checked       = option.AllowCaretBeyondEOL;
            createBackupCopyCheckBox.Checked          = option.CreateBackupCopy;
            mouseWheelScrollDownCheckBox.Checked      = option.MouseWheelScrollDown;
            mouseWheeltextZoomCheckBox.Checked        = option.MouseWheelTextZoom;
            hideMouseCursorCheckBox.Checked           = option.HideMouseCursor;
            cutCopyWholeLineCheckBox.Checked          = option.CutCopyWholeLine;
            autoInsertCurlyBracketCheckBox.Checked    = option.AutoInsertCurlyBracket;
            useCustomLineCheckBox.Checked             = option.UseCustomLine;
            bracketMatchingStyleComboBox.SelectedItem = option.BracketMatchingStyle;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 表示設定を初期化する
        /// </summary>
        private void initDispButton_Click(object sender, EventArgs e)
        {
            EditorOption option = EditorOption.GetDefault(m_krkrType);

            showSpaceCheckBox.Checked            = option.ShowSpaces;
            showWideSpaceCheckBox.Checked        = option.ShowWideSpaces;
            showTabsCheckBox.Checked             = option.ShowTabs;
            showEOLMarkerCheckBox.Checked        = option.ShowEOLMarker;
            showInvalidLinesCheckBox.Checked     = option.ShowInvalidLines;
            showMatchingBracketCheckBox.Checked  = option.ShowMatchingBracket;
            showLineNumbersCheckBox.Checked      = option.ShowLineNumbers;
            isIconBarVisibleCheckBox.Checked     = option.IsIconBarVisible;
            enableFoldingCheckBox.Checked        = option.EnableFolding;
            showHorizontalRulerCheckBox.Checked  = option.ShowHorizontalRuler;
            showVerticalRulerCheckBox.Checked    = option.ShowVerticalRuler;
            verticalRulerRowUpDown.Value         = option.VerticalRulerRow;
            lineViewerStyleComboBox.SelectedItem = option.LineViewerStyle;
        }
Exemplo n.º 6
0
        /// <summary>
        /// 環境設定をファイルに保存する
        /// </summary>
        /// <param name="fileName">作成する環境設定ファイル名</param>
        /// <param name="option">保存する環境設定</param>
        public static void SaveFile(string fileName, EditorOption option)
        {
            //設定をファイルに保存する
            //XmlSerializer serializer = new XmlSerializer(typeof(EditorOption));
            //FileStream fs;
            //using (fs = new FileStream(fileName, FileMode.Create))
            //{
            //    serializer.Serialize(fs, option);
            //}

            try
            {
                saveToXml(fileName, option);
            }
            catch (Exception err)
            {
                util.Msgbox.Error("エディタ設定ファイルの書き込みに失敗しました\n" + err.Message);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// そのほかのファイルのデフォルトオプションを取得する
        /// </summary>
        /// <returns></returns>
        private static EditorOption getDefaultUnknownFile()
        {
            EditorOption option = new EditorOption();

            option.FontName               = "MS ゴシック";
            option.FontSize               = 10;
            option.EncodingName           = "shift_jis";
            option.TabIndent              = 4;
            option.IndentationSize        = 4;
            option.IndentStyle            = IndentStyle.None;
            option.DocumentSelectionMode  = DocumentSelectionMode.Normal;
            option.BracketMatchingStyle   = BracketMatchingStyle.After;
            option.AllowCaretBeyondEOL    = false;
            option.ShowMatchingBracket    = true;
            option.ShowLineNumbers        = true;
            option.ShowSpaces             = false;
            option.ShowTabs               = false;
            option.ShowEOLMarker          = true;
            option.ShowInvalidLines       = false;
            option.ShowWideSpaces         = false;
            option.IsIconBarVisible       = true;
            option.EnableFolding          = true;
            option.ShowHorizontalRuler    = true;
            option.ShowVerticalRuler      = false;
            option.ConvertTabsToSpaces    = false;
            option.UseAntiAliasedFont     = false;
            option.CreateBackupCopy       = false;
            option.MouseWheelScrollDown   = true;
            option.MouseWheelTextZoom     = false;
            option.HideMouseCursor        = false;
            option.CutCopyWholeLine       = true;
            option.VerticalRulerRow       = 80;
            option.LineViewerStyle        = LineViewerStyle.None;
            option.LineTerminatorName     = "CRLF";
            option.AutoInsertCurlyBracket = true;
            option.UseCustomLine          = false;
            option.UseCodeCompletion      = false;
            option.ParseActionFileSave    = false;

            return(option);
        }
Exemplo n.º 8
0
        /// <summary>
        /// デフォルトのオプションを取得する
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static EditorOption GetDefault(kkde.project.FileType.KrkrType type)
        {
            EditorOption option = null;

            switch (type)
            {
            case kkde.project.FileType.KrkrType.Kag:
                option = getDefaultKagFile();
                break;

            case kkde.project.FileType.KrkrType.Tjs:
                option = getDefaultTjsFile();
                break;

            default:
                option = getDefaultUnknownFile();
                break;
            }

            return(option);
        }
Exemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        private static EditorOption loadFromXml(string filePath)
        {
            EditorOption option = new EditorOption();
            FileStream   fs;

            using (fs = new FileStream(filePath, FileMode.Open))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(fs);

                //ルートノードを読み込む
                XmlNodeList nodeList = doc.GetElementsByTagName("EditorOption");
                if (nodeList == null || nodeList.Count == 0)
                {
                    throw new ApplicationException("環境設定ファイル読み込みエラー\nこのファイルは不正な設定ファイルです");
                }

                //設定値を読み込む
                foreach (XmlElement element in nodeList[0].ChildNodes)
                {
                    switch (element.Name)
                    {
                    //デフォルト共通
                    case "FontName":
                        option.FontName = element.InnerText;
                        break;

                    case "FontSize":
                        option.FontSize = Int32.Parse(element.InnerText);
                        break;

                    case "EncodingName":
                        option.EncodingName = element.InnerText;
                        break;

                    case "AllowCaretBeyondEOL":
                        option.AllowCaretBeyondEOL = Boolean.Parse(element.InnerText);
                        break;

                    case "TabIndent":
                        option.TabIndent = Int32.Parse(element.InnerText);
                        break;

                    case "IndentationSize":
                        option.IndentationSize = Int32.Parse(element.InnerText);
                        break;

                    case "IndentStyle":
                        option.IndentStyle = (IndentStyle)Enum.Parse(typeof(IndentStyle), element.InnerText);
                        break;

                    case "DocumentSelectionMode":
                        option.DocumentSelectionMode = (DocumentSelectionMode)Enum.Parse(typeof(DocumentSelectionMode), element.InnerText);
                        break;

                    case "BracketMatchingStyle":
                        option.BracketMatchingStyle = (BracketMatchingStyle)Enum.Parse(typeof(BracketMatchingStyle), element.InnerText);
                        break;

                    case "ShowMatchingBracket":
                        option.ShowMatchingBracket = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowLineNumbers":
                        option.ShowLineNumbers = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowSpaces":
                        option.ShowSpaces = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowWideSpaces":
                        option.ShowWideSpaces = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowTabs":
                        option.ShowTabs = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowEOLMarker":
                        option.ShowEOLMarker = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowInvalidLines":
                        option.ShowInvalidLines = Boolean.Parse(element.InnerText);
                        break;

                    case "IsIconBarVisible":
                        option.IsIconBarVisible = Boolean.Parse(element.InnerText);
                        break;

                    case "EnableFolding":
                        option.EnableFolding = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowHorizontalRuler":
                        option.ShowHorizontalRuler = Boolean.Parse(element.InnerText);
                        break;

                    case "ShowVerticalRuler":
                        option.ShowVerticalRuler = Boolean.Parse(element.InnerText);
                        break;

                    case "ConvertTabsToSpaces":
                        option.ConvertTabsToSpaces = Boolean.Parse(element.InnerText);
                        break;

                    case "UseAntiAliasedFont":
                        option.UseAntiAliasedFont = Boolean.Parse(element.InnerText);
                        break;

                    case "CreateBackupCopy":
                        option.CreateBackupCopy = Boolean.Parse(element.InnerText);
                        break;

                    case "MouseWheelScrollDown":
                        option.MouseWheelScrollDown = Boolean.Parse(element.InnerText);
                        break;

                    case "MouseWheelTextZoom":
                        option.MouseWheelTextZoom = Boolean.Parse(element.InnerText);
                        break;

                    case "HideMouseCursor":
                        option.HideMouseCursor = Boolean.Parse(element.InnerText);
                        break;

                    case "CutCopyWholeLine":
                        option.CutCopyWholeLine = Boolean.Parse(element.InnerText);
                        break;

                    case "VerticalRulerRow":
                        option.VerticalRulerRow = Int32.Parse(element.InnerText);
                        break;

                    case "LineViewerStyle":
                        option.LineViewerStyle = (LineViewerStyle)Enum.Parse(typeof(LineViewerStyle), element.InnerText);
                        break;

                    case "LineTerminatorName":
                        option.LineTerminatorName = element.InnerText;
                        break;

                    case "AutoInsertCurlyBracket":
                        option.AutoInsertCurlyBracket = Boolean.Parse(element.InnerText);
                        break;

                    case "UseCustomLine":
                        option.UseCustomLine = Boolean.Parse(element.InnerText);
                        break;

                    case "UseCodeCompletion":
                        option.UseCodeCompletion = Boolean.Parse(element.InnerText);
                        break;

                    case "ParseActionFileSave":
                        option.ParseActionFileSave = Boolean.Parse(element.InnerText);
                        break;

                    case "KagCompOption":
                        option.KagCompOption = getKagCompOptionFromXmlElement(element);
                        break;
                    }
                }
            }

            return(option);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 設定ファイルをXMLに保存する
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="option"></param>
        private static void saveToXml(string filePath, EditorOption option)
        {
            using (FileStream fs = new FileStream(filePath, FileMode.Create))
            {
                using (XmlTextWriter xw = new XmlTextWriter(fs, Encoding.UTF8))
                {
                    xw.Formatting = Formatting.Indented;

                    xw.WriteStartDocument();
                    xw.WriteStartElement("EditorOption");

                    writeElement(xw, "FontName", option.FontName);
                    writeElement(xw, "FontSize", option.FontSize);
                    writeElement(xw, "EncodingName", option.EncodingName);
                    writeElement(xw, "AllowCaretBeyondEOL", option.AllowCaretBeyondEOL);
                    writeElement(xw, "TabIndent", option.TabIndent);
                    writeElement(xw, "IndentationSize", option.IndentationSize);
                    writeElement(xw, "IndentStyle", option.IndentStyle);
                    writeElement(xw, "DocumentSelectionMode", option.DocumentSelectionMode);
                    writeElement(xw, "BracketMatchingStyle", option.BracketMatchingStyle);
                    writeElement(xw, "ShowMatchingBracket", option.ShowMatchingBracket);
                    writeElement(xw, "ShowLineNumbers", option.ShowLineNumbers);
                    writeElement(xw, "ShowSpaces", option.ShowSpaces);
                    writeElement(xw, "ShowWideSpaces", option.ShowWideSpaces);
                    writeElement(xw, "ShowTabs", option.ShowTabs);
                    writeElement(xw, "ShowEOLMarker", option.ShowEOLMarker);
                    writeElement(xw, "ShowInvalidLines", option.ShowInvalidLines);
                    writeElement(xw, "IsIconBarVisible", option.IsIconBarVisible);
                    writeElement(xw, "EnableFolding", option.EnableFolding);
                    writeElement(xw, "ShowHorizontalRuler", option.ShowHorizontalRuler);
                    writeElement(xw, "ShowVerticalRuler", option.ShowVerticalRuler);
                    writeElement(xw, "ConvertTabsToSpaces", option.ConvertTabsToSpaces);
                    writeElement(xw, "UseAntiAliasedFont", option.UseAntiAliasedFont);
                    writeElement(xw, "CreateBackupCopy", option.CreateBackupCopy);
                    writeElement(xw, "MouseWheelScrollDown", option.MouseWheelScrollDown);
                    writeElement(xw, "MouseWheelTextZoom", option.MouseWheelTextZoom);
                    writeElement(xw, "HideMouseCursor", option.HideMouseCursor);
                    writeElement(xw, "CutCopyWholeLine", option.CutCopyWholeLine);
                    writeElement(xw, "VerticalRulerRow", option.VerticalRulerRow);
                    writeElement(xw, "LineViewerStyle", option.LineViewerStyle);
                    writeElement(xw, "LineTerminatorName", option.LineTerminatorName);
                    writeElement(xw, "AutoInsertCurlyBracket", option.AutoInsertCurlyBracket);
                    writeElement(xw, "UseCustomLine", option.UseCustomLine);
                    writeElement(xw, "UseCodeCompletion", option.UseCodeCompletion);
                    writeElement(xw, "ParseActionFileSave", option.ParseActionFileSave);

                    xw.WriteStartElement("KagCompOption");
                    writeElement(xw, "UseAttrValueDqRegion", option.KagCompOption.UseAttrValueDqRegion);
                    writeElement(xw, "ScenarioFileExt", option.KagCompOption.ScenarioFileExt);
                    writeElement(xw, "ImageFileExt", option.KagCompOption.ImageFileExt);
                    writeElement(xw, "SeFileExt", option.KagCompOption.SeFileExt);
                    writeElement(xw, "CursorFileExt", option.KagCompOption.CursorFileExt);
                    writeElement(xw, "BgmFileExt", option.KagCompOption.BgmFileExt);
                    writeElement(xw, "ActionFileExt", option.KagCompOption.ActionFileExt);
                    writeElement(xw, "PluginFileExt", option.KagCompOption.PluginFileExt);
                    writeElement(xw, "FontFileExt", option.KagCompOption.FontFileExt);
                    writeElement(xw, "VideoFileExt", option.KagCompOption.VideoFileExt);
                    writeElement(xw, "ZeroOverNumberList", option.KagCompOption.ZeroOverNumberList);
                    writeElement(xw, "OneOverNumberList", option.KagCompOption.OneOverNumberList);
                    writeElement(xw, "PercentNumberList", option.KagCompOption.PercentNumberList);
                    writeElement(xw, "ByteNumberList", option.KagCompOption.ByteNumberList);
                    writeElement(xw, "MsTimeNumberList", option.KagCompOption.MsTimeNumberList);
                    writeElement(xw, "RealNumberList", option.KagCompOption.RealNumberList);
                    writeElement(xw, "PmHundredNumberList", option.KagCompOption.PmHundredNumberList);
                    writeElement(xw, "RgbNumberList", option.KagCompOption.RgbNumberList);
                    writeElement(xw, "OtherStringList", option.KagCompOption.OtherStringList);
                    writeElement(xw, "TjsStringList", option.KagCompOption.TjsStringList);
                    writeElement(xw, "FontStringList", option.KagCompOption.FontStringList);
                    writeElement(xw, "LayerMaxNumber", option.KagCompOption.LayerMaxNumber);
                    writeElement(xw, "MessageLayerMaxNumber", option.KagCompOption.MessageLayerMaxNumber);
                    writeElement(xw, "SeBufferMaxNumber", option.KagCompOption.SeBufferMaxNumber);
                    writeElement(xw, "VideoBufferMaxNumber", option.KagCompOption.VideoBufferMaxNumber);
                    writeElement(xw, "BaseLayerList", option.KagCompOption.BaseLayerList);
                    writeElement(xw, "BoolValueList", option.KagCompOption.BoolValueList);
                    writeElement(xw, "LayerPageList", option.KagCompOption.LayerPageList);
                    writeElement(xw, "LayerPosList", option.KagCompOption.LayerPosList);
                    writeElement(xw, "CursorDefList", option.KagCompOption.CursorDefList);
                    writeElement(xw, "ColorcompModeList", option.KagCompOption.ColorcompModeList);
                    writeElement(xw, "KagexAction", option.KagCompOption.KagexAction);
                    writeElement(xw, "KagexLtbType", option.KagCompOption.KagexLtbType);

                    writeElement(xw, "IsInsertedTagCopyExWorldEx", option.KagCompOption.IsInsertedTagCopyExWorldEx);
                    writeElement(xw, "IsAddedTagSignWorldEx", option.KagCompOption.IsAddedTagSignWorldEx);
                    writeElement(xw, "IsAddedMsgTagWorldEx", option.KagCompOption.IsAddedMsgTagWorldEx);
                    writeElement(xw, "WorldExSearchPathChar", option.KagCompOption.WorldExSearchPathChar);
                    writeElement(xw, "WorldExSearchPathEvent", option.KagCompOption.WorldExSearchPathEvent);
                    writeElement(xw, "WorldExSearchPathStage", option.KagCompOption.WorldExSearchPathStage);
                    writeElement(xw, "WorldExSearchPathBgm", option.KagCompOption.WorldExSearchPathBgm);
                    writeElement(xw, "WorldExSearchPathSe", option.KagCompOption.WorldExSearchPathSe);
                    writeElement(xw, "WorldExCopyTagType", option.KagCompOption.WorldExCopyTagType);
                    writeElement(xw, "WorldExDoubleDef", option.KagCompOption.WorldExDoubleDef);
                    xw.WriteEndElement();

                    xw.WriteEndElement();
                    xw.WriteEndDocument();
                }
            }
        }
Exemplo n.º 11
0
        private void saveEditorOptionFile(FileType.KrkrType m_krkrType)
        {
            EditorOption option = GlobalStatus.EditorManager.GetEditorOption(m_krkrType);

            if (option == null)
            {
                throw new ApplicationException("設定情報の取得に失敗しました");
            }

            //フォント
            option.FontName           = m_editorOptionFont.Name;
            option.FontSize           = (int)Math.Round(m_editorOptionFont.Size);
            option.UseAntiAliasedFont = useAntiAliasedFontCheckBox.Checked;
            option.EncodingName       = (string)encodingNameComboBox.SelectedItem;
            option.LineTerminatorName = (string)lineTerminatorNameComboBox.SelectedItem;

            //表示
            option.ShowSpaces          = showSpaceCheckBox.Checked;
            option.ShowWideSpaces      = showWideSpaceCheckBox.Checked;
            option.ShowTabs            = showTabsCheckBox.Checked;
            option.ShowEOLMarker       = showEOLMarkerCheckBox.Checked;
            option.ShowInvalidLines    = showInvalidLinesCheckBox.Checked;
            option.ShowMatchingBracket = showMatchingBracketCheckBox.Checked;
            option.ShowLineNumbers     = showLineNumbersCheckBox.Checked;
            option.IsIconBarVisible    = isIconBarVisibleCheckBox.Checked;
            option.EnableFolding       = enableFoldingCheckBox.Checked;
            option.ShowHorizontalRuler = showHorizontalRulerCheckBox.Checked;
            option.ShowVerticalRuler   = showVerticalRulerCheckBox.Checked;
            option.VerticalRulerRow    = (int)verticalRulerRowUpDown.Value;
            option.LineViewerStyle     = (LineViewerStyle)lineViewerStyleComboBox.SelectedItem;

            //動作
            option.TabIndent              = (int)tabIndentUpDown.Value;
            option.ConvertTabsToSpaces    = convertTabsToSpacesCheckBox.Checked;
            option.IndentationSize        = (int)indentationSizeUpDown.Value;
            option.IndentStyle            = (IndentStyle)indentStyleComboBox.SelectedItem;
            option.AllowCaretBeyondEOL    = allowCaretBeyondEOLCheckBox.Checked;
            option.CreateBackupCopy       = createBackupCopyCheckBox.Checked;
            option.MouseWheelScrollDown   = mouseWheelScrollDownCheckBox.Checked;
            option.MouseWheelTextZoom     = mouseWheeltextZoomCheckBox.Checked;
            option.HideMouseCursor        = hideMouseCursorCheckBox.Checked;
            option.CutCopyWholeLine       = cutCopyWholeLineCheckBox.Checked;
            option.AutoInsertCurlyBracket = autoInsertCurlyBracketCheckBox.Checked;
            option.UseCustomLine          = useCustomLineCheckBox.Checked;
            option.BracketMatchingStyle   = (BracketMatchingStyle)bracketMatchingStyleComboBox.SelectedItem;

            //入力補完
            option.UseCodeCompletion   = useCodeCompletionCheckbox.Checked;
            option.ParseActionFileSave = parseActionFileSaveCheckBox.Checked;

            //KAG1
            option.KagCompOption.UseAttrValueDqRegion = useAttrValueDqRegionCheckBox.Checked;

            option.KagCompOption.ZeroOverNumberList  = zeroOverNumberListBox.Text;
            option.KagCompOption.OneOverNumberList   = oneOverNumberListBox.Text;
            option.KagCompOption.PercentNumberList   = percentNumberListBox.Text;
            option.KagCompOption.ByteNumberList      = byteNumberListBox.Text;
            option.KagCompOption.MsTimeNumberList    = msTimeNumberListBox.Text;
            option.KagCompOption.RealNumberList      = realNumberListBox.Text;
            option.KagCompOption.PmHundredNumberList = pmHundredNumberListBox.Text;
            option.KagCompOption.RgbNumberList       = rgbNumberListBox.Text;

            option.KagCompOption.OtherStringList = otherStringListBox.Text;
            option.KagCompOption.TjsStringList   = tjsStringListBox.Text;
            option.KagCompOption.FontStringList  = fontStringListBox.Text;

            //KAG2
            option.KagCompOption.ScenarioFileExt = scenarioFileExtBox.Text;
            option.KagCompOption.ImageFileExt    = imageFileExtBox.Text;
            option.KagCompOption.SeFileExt       = seFileExtBox.Text;
            option.KagCompOption.CursorFileExt   = cursorFileExtBox.Text;
            option.KagCompOption.BgmFileExt      = bgmFileExtBox.Text;
            option.KagCompOption.ActionFileExt   = actionFileExtBox.Text;
            option.KagCompOption.PluginFileExt   = pluginFileExtBox.Text;
            option.KagCompOption.FontFileExt     = fontFileExtBox.Text;
            option.KagCompOption.VideoFileExt    = videoFileExtBox.Text;

            option.KagCompOption.LayerMaxNumber        = (int)layerMaxNumberBox.Value;
            option.KagCompOption.MessageLayerMaxNumber = (int)messageLayerMaxNumberBox.Value;
            option.KagCompOption.SeBufferMaxNumber     = (int)seBufferMaxNumberBox.Value;
            option.KagCompOption.VideoBufferMaxNumber  = (int)videoBufferMaxNumberBox.Value;

            //KAGEX
            option.KagCompOption.IsInsertedTagCopyExWorldEx = isInsertedTagCopyExWorldExCheckBox.Checked;
            option.KagCompOption.IsAddedTagSignWorldEx      = isAddedTagSignWorldExCheckBox.Checked;
            option.KagCompOption.IsAddedMsgTagWorldEx       = isAddedMsgTagWorldExCheckBox.Checked;
            option.KagCompOption.WorldExSearchPathChar      = worldExSearchPathCharTextBox.Text;
            option.KagCompOption.WorldExSearchPathEvent     = worldExSearchPathEventTextBox.Text;
            option.KagCompOption.WorldExSearchPathSe        = worldExSearchPathStageTextBox.Text;
            option.KagCompOption.WorldExSearchPathBgm       = worldExSearchPathBgmTextBox.Text;
            option.KagCompOption.WorldExSearchPathSe        = worldExSearchPathSeTextBox.Text;
            option.KagCompOption.WorldExCopyTagType         = (KagCompletionOption.TagType)worldExCopyTagTypeComboBox.SelectedItem;
            if (worldExDCActionPreviewRadioButton.Checked)
            {
                option.KagCompOption.WorldExDoubleDef = KagCompletionOption.WorldExViewDCOption.Preview;
            }
            else if (worldExDCActionPreviewExRadioButton.Checked)
            {
                option.KagCompOption.WorldExDoubleDef = KagCompletionOption.WorldExViewDCOption.PreviewEx;
            }

            //ファイルに保存する
            string fileName = GlobalStatus.EditorManager.GetEditorOptionFilePath(m_krkrType);

            EditorOption.SaveFile(fileName, option);
        }
Exemplo n.º 12
0
        /// <summary>
        /// エディタオプション情報を画面に反映する
        /// </summary>
        /// <param name="editorOption">エディタオプション情報</param>
        private void loadEditorOption(EditorOption option)
        {
            //フォント
            updateFontPreviewBox(option.Font);
            useAntiAliasedFontCheckBox.Checked      = option.UseAntiAliasedFont;
            encodingNameComboBox.SelectedItem       = option.EncodingName;
            lineTerminatorNameComboBox.SelectedItem = option.LineTerminatorName;

            //表示
            showSpaceCheckBox.Checked            = option.ShowSpaces;
            showWideSpaceCheckBox.Checked        = option.ShowWideSpaces;
            showTabsCheckBox.Checked             = option.ShowTabs;
            showEOLMarkerCheckBox.Checked        = option.ShowEOLMarker;
            showInvalidLinesCheckBox.Checked     = option.ShowInvalidLines;
            showMatchingBracketCheckBox.Checked  = option.ShowMatchingBracket;
            showLineNumbersCheckBox.Checked      = option.ShowLineNumbers;
            isIconBarVisibleCheckBox.Checked     = option.IsIconBarVisible;
            enableFoldingCheckBox.Checked        = option.EnableFolding;
            showHorizontalRulerCheckBox.Checked  = option.ShowHorizontalRuler;
            showVerticalRulerCheckBox.Checked    = option.ShowVerticalRuler;
            verticalRulerRowUpDown.Value         = option.VerticalRulerRow;
            lineViewerStyleComboBox.SelectedItem = option.LineViewerStyle;

            //動作
            tabIndentUpDown.Value = option.TabIndent;
            convertTabsToSpacesCheckBox.Checked       = option.ConvertTabsToSpaces;
            indentationSizeUpDown.Value               = option.IndentationSize;
            indentStyleComboBox.SelectedItem          = option.IndentStyle;
            allowCaretBeyondEOLCheckBox.Checked       = option.AllowCaretBeyondEOL;
            createBackupCopyCheckBox.Checked          = option.CreateBackupCopy;
            mouseWheelScrollDownCheckBox.Checked      = option.MouseWheelScrollDown;
            mouseWheeltextZoomCheckBox.Checked        = option.MouseWheelTextZoom;
            hideMouseCursorCheckBox.Checked           = option.HideMouseCursor;
            cutCopyWholeLineCheckBox.Checked          = option.CutCopyWholeLine;
            autoInsertCurlyBracketCheckBox.Checked    = option.AutoInsertCurlyBracket;
            useCustomLineCheckBox.Checked             = option.UseCustomLine;
            bracketMatchingStyleComboBox.SelectedItem = option.BracketMatchingStyle;

            //入力補完
            useCodeCompletionCheckbox.Checked   = option.UseCodeCompletion;
            parseActionFileSaveCheckBox.Checked = option.ParseActionFileSave;

            //KAG1
            useAttrValueDqRegionCheckBox.Checked = option.KagCompOption.UseAttrValueDqRegion;

            zeroOverNumberListBox.Text  = option.KagCompOption.ZeroOverNumberList;
            oneOverNumberListBox.Text   = option.KagCompOption.OneOverNumberList;
            percentNumberListBox.Text   = option.KagCompOption.PercentNumberList;
            byteNumberListBox.Text      = option.KagCompOption.ByteNumberList;
            msTimeNumberListBox.Text    = option.KagCompOption.MsTimeNumberList;
            realNumberListBox.Text      = option.KagCompOption.RealNumberList;
            pmHundredNumberListBox.Text = option.KagCompOption.PmHundredNumberList;
            rgbNumberListBox.Text       = option.KagCompOption.RgbNumberList;

            otherStringListBox.Text = option.KagCompOption.OtherStringList;
            tjsStringListBox.Text   = option.KagCompOption.TjsStringList;
            fontStringListBox.Text  = option.KagCompOption.FontStringList;

            //KAG2
            scenarioFileExtBox.Text = option.KagCompOption.ScenarioFileExt;
            imageFileExtBox.Text    = option.KagCompOption.ImageFileExt;
            seFileExtBox.Text       = option.KagCompOption.SeFileExt;
            cursorFileExtBox.Text   = option.KagCompOption.CursorFileExt;
            bgmFileExtBox.Text      = option.KagCompOption.BgmFileExt;
            actionFileExtBox.Text   = option.KagCompOption.ActionFileExt;
            pluginFileExtBox.Text   = option.KagCompOption.PluginFileExt;
            fontFileExtBox.Text     = option.KagCompOption.FontFileExt;
            videoFileExtBox.Text    = option.KagCompOption.VideoFileExt;

            layerMaxNumberBox.Value        = option.KagCompOption.LayerMaxNumber;
            messageLayerMaxNumberBox.Value = option.KagCompOption.MessageLayerMaxNumber;
            seBufferMaxNumberBox.Value     = option.KagCompOption.SeBufferMaxNumber;
            videoBufferMaxNumberBox.Value  = option.KagCompOption.VideoBufferMaxNumber;

            //KAGEX
            isInsertedTagCopyExWorldExCheckBox.Checked = option.KagCompOption.IsInsertedTagCopyExWorldEx;
            isAddedTagSignWorldExCheckBox.Checked      = option.KagCompOption.IsAddedTagSignWorldEx;
            isAddedMsgTagWorldExCheckBox.Checked       = option.KagCompOption.IsAddedMsgTagWorldEx;
            if (option.KagCompOption.WorldExDoubleDef == KagCompletionOption.WorldExViewDCOption.Preview)
            {
                worldExDCActionPreviewRadioButton.Checked   = true;
                worldExDCActionPreviewExRadioButton.Checked = false;
            }
            else
            {
                worldExDCActionPreviewRadioButton.Checked   = false;
                worldExDCActionPreviewExRadioButton.Checked = true;
            }
            worldExSearchPathCharTextBox.Text       = option.KagCompOption.WorldExSearchPathChar;
            worldExSearchPathEventTextBox.Text      = option.KagCompOption.WorldExSearchPathEvent;
            worldExSearchPathStageTextBox.Text      = option.KagCompOption.WorldExSearchPathSe;
            worldExSearchPathBgmTextBox.Text        = option.KagCompOption.WorldExSearchPathBgm;
            worldExSearchPathSeTextBox.Text         = option.KagCompOption.WorldExSearchPathSe;
            worldExCopyTagTypeComboBox.SelectedItem = option.KagCompOption.WorldExCopyTagType;
        }