Example #1
0
        /// <summary>
        /// エディタオプションを取得する
        /// </summary>
        /// <param name="type">取得するファイルタイプ</param>
        /// <returns>エディタオプション</returns>
        public EditorOption GetEditorOption(FileType.KrkrType type)
        {
            if (type != FileType.KrkrType.Kag && type != FileType.KrkrType.Tjs)
            {
                //KAGとTJS以外はその他のファイルとして扱う
                type = FileType.KrkrType.Unknown;
            }

            if (GlobalStatus.EditorOption.ContainsKey(type) == false)
            {
                string filePath = GetEditorOptionFilePath(type);
                GlobalStatus.EditorOption.Add(type, EditorOption.LoadFile(filePath));
            }

            return(GlobalStatus.EditorOption[type]);
        }
Example #2
0
        /// <summary>
        /// エディタウィンドウを初期化する
        /// </summary>
        public void SetEditorOption()
        {
            EditorOption option = EditorOption.LoadFile(ConstEnvOption.DefOptionFilePath);

            resultEditor.Encoding = option.Encoding;
            resultEditor.Font     = option.Font;
            resultEditor.Document.TextEditorProperties.AllowCaretBeyondEOL   = option.AllowCaretBeyondEOL;
            resultEditor.Document.TextEditorProperties.TabIndent             = option.TabIndent;
            resultEditor.Document.TextEditorProperties.IndentationSize       = option.IndentationSize;
            resultEditor.Document.TextEditorProperties.IndentStyle           = option.IndentStyle;
            resultEditor.Document.TextEditorProperties.DocumentSelectionMode = option.DocumentSelectionMode;
            resultEditor.Document.TextEditorProperties.BracketMatchingStyle  = option.BracketMatchingStyle;
            resultEditor.Document.TextEditorProperties.ShowMatchingBracket   = option.ShowMatchingBracket;
            resultEditor.Document.TextEditorProperties.ShowLineNumbers       = option.ShowLineNumbers;
            resultEditor.Document.TextEditorProperties.ShowSpaces            = option.ShowSpaces;
            resultEditor.Document.TextEditorProperties.ShowWideSpaces        = option.ShowWideSpaces;
            resultEditor.Document.TextEditorProperties.ShowTabs               = option.ShowTabs;
            resultEditor.Document.TextEditorProperties.ShowEOLMarker          = option.ShowEOLMarker;
            resultEditor.Document.TextEditorProperties.ShowInvalidLines       = option.ShowInvalidLines;
            resultEditor.Document.TextEditorProperties.IsIconBarVisible       = option.IsIconBarVisible;
            resultEditor.Document.TextEditorProperties.EnableFolding          = option.EnableFolding;
            resultEditor.Document.TextEditorProperties.ShowHorizontalRuler    = false;
            resultEditor.Document.TextEditorProperties.ShowVerticalRuler      = false;
            resultEditor.Document.TextEditorProperties.ConvertTabsToSpaces    = option.ConvertTabsToSpaces;
            resultEditor.Document.TextEditorProperties.UseAntiAliasedFont     = option.UseAntiAliasedFont;
            resultEditor.Document.TextEditorProperties.CreateBackupCopy       = option.CreateBackupCopy;
            resultEditor.Document.TextEditorProperties.MouseWheelScrollDown   = option.MouseWheelScrollDown;
            resultEditor.Document.TextEditorProperties.MouseWheelTextZoom     = option.MouseWheelTextZoom;
            resultEditor.Document.TextEditorProperties.HideMouseCursor        = option.HideMouseCursor;
            resultEditor.Document.TextEditorProperties.CutCopyWholeLine       = option.CutCopyWholeLine;
            resultEditor.Document.TextEditorProperties.VerticalRulerRow       = option.VerticalRulerRow;
            resultEditor.Document.TextEditorProperties.LineViewerStyle        = option.LineViewerStyle;
            resultEditor.Document.TextEditorProperties.LineTerminator         = option.LineTerminator;
            resultEditor.Document.TextEditorProperties.AutoInsertCurlyBracket = option.AutoInsertCurlyBracket;
            resultEditor.Document.TextEditorProperties.UseCustomLine          = option.UseCustomLine;

            resultEditor.OptionsChanged();
        }