コード例 #1
0
ファイル: RenderProfile.cs プロジェクト: nwtajcky/RDManager
        public void Import(ConfigNode data)
        {
            CommonOptions opt = GEnv.Options;

            _fontName = data["font-name"];
            if (_fontName == null)
            {
                _fontName = opt.FontName;
            }
            _japaneseFontName = data["japanese-font-name"];
            if (_japaneseFontName == null)
            {
                _japaneseFontName = opt.JapaneseFontName;
            }
            _fontSize     = (float)GUtil.ParseInt(data["font-size"], 10);
            _useClearType = GUtil.ParseBool(data["clear-type"], false);
            ClearFont();

            unchecked {
                _forecolor = Color.FromArgb(GUtil.ParseHexInt(data["fore-color"], (int)0xFF000000));
                _bgcolor   = Color.FromArgb(GUtil.ParseHexInt(data["back-color"], (int)0xFFFFFFFF));
            }
            if (_esColorSet == null)
            {
                _esColorSet = (EscapesequenceColorSet)opt.ESColorSet.Clone();
            }
            _esColorSet.Load(data["color-sequence"]);
            ClearBrush();

            _backgroundImageFileName = data["image-file"];
            _imageLoadIsAttempted    = false;
            _imageStyle = (ImageStyle)EnumDescAttribute.For(typeof(ImageStyle)).FromName(data["bg-style"], ImageStyle.Center);
        }
コード例 #2
0
 public virtual void Import(ConfigNode data)
 {
     _encoding     = ParseEncoding(data["encoding"]);
     _terminalType = (TerminalType)EnumDescAttribute.For(typeof(TerminalType)).FromName(data["terminal-type"], TerminalType.VT100);
     _transmitnl   = (NewLine)EnumDescAttribute.For(typeof(NewLine)).FromName(data["transmit-nl"], NewLine.CR);
     _localecho    = GUtil.ParseBool(data["localecho"], false);
     //_lineFeedByCR = GUtil.ParseBool((string)data["linefeed-by-cr"], false);
     _lineFeedRule = (LineFeedRule)EnumDescAttribute.For(typeof(LineFeedRule)).FromName(data["linefeed"], LineFeedRule.Normal);
     _caption      = data["caption"];
     if (data.Contains("font-name")) //項目がなければ空のまま
     {
         _renderProfile = new RenderProfile(data);
     }
 }
コード例 #3
0
        public void Load(ConfigNode sec)
        {
            Path       = sec["path"];
            _title     = sec["title"];
            _debugMode = GUtil.ParseBool(sec["debug"], false);
            Keys   shortcut = Keys.None;
            string t        = sec["shortcut"];

            if (t != null)
            {
                shortcut = GUtil.ParseKey(t.Split(','));
            }
            GApp.Options.Commands.AddEntry(new Commands.MacroEntry(_title, shortcut & Keys.Modifiers, shortcut & Keys.KeyCode, _index));
            _additionalAssemblies = sec["additional-assemblies"].Split(',');
        }
コード例 #4
0
        private void ImportTerminalSettings(Hashtable values)
        {
            ContainerOptions opt = GApp.Options;

            opt.LeftAltKey           = (AltKeyAction)GUtil.ParseEnum(typeof(AltKeyAction), (string)values["left-alt"], opt.LeftAltKey);
            opt.RightAltKey          = (AltKeyAction)GUtil.ParseEnum(typeof(AltKeyAction), (string)values["right-alt"], opt.RightAltKey);
            opt.AutoCopyByLeftButton = GUtil.ParseBool((string)values["auto-copy-by-left-button"], opt.AutoCopyByLeftButton);
            opt.RightButtonAction    = (RightButtonAction)GUtil.ParseEnum(typeof(RightButtonAction), (string)values["right-button"], opt.RightButtonAction);
            opt.TerminalBufferSize   = GUtil.ParseInt((string)values["buffer-size"], opt.TerminalBufferSize);
            string fontname    = (string)values["font-family"];
            string ja_fontname = (string)values["japanese-font-family"];
            float  size        = GUtil.ParseFloat((string)values["font-size"], opt.FontSize);

            opt.Font         = new Font(fontname, size);
            opt.JapaneseFont = new Font(ja_fontname, size);
            opt.UseClearType = GUtil.ParseBool((string)values["cleartype"], opt.UseClearType);
            opt.BGColor      = GUtil.ParseColor((string)values["bg-color"], opt.BGColor);
            opt.TextColor    = GUtil.ParseColor((string)values["text-color"], opt.TextColor);
            opt.ESColorSet.Load((string)values["escapesequence-color"]);
            opt.BackgroundImageFileName = (string)values["bg-image"];
            opt.ImageStyle          = (ImageStyle)GUtil.ParseEnum(typeof(ImageStyle), (string)values["bg-style"], opt.ImageStyle);
            opt.DefaultLogType      = (LogType)GUtil.ParseEnum(typeof(LogType), (string)values["default-log-type"], opt.DefaultLogType);
            opt.DefaultLogDirectory = (string)values["default-log-directory"];
        }