Пример #1
0
 public void Load(string value)
 {
     if (value == null)
     {
         SetDefault();
     }
     else
     {
         string[] cols = value.Split(',');
         if (cols.Length < _colors.Length)
         {
             SetDefault();
         }
         else
         {
             for (int i = 0; i < cols.Length; i++)
             {
                 _colors[i] = GUtil.ParseColor(cols[i], Color.Empty);
                 if (_colors[i].IsEmpty)
                 {
                     _colors[i] = GetDefaultColor(i);
                 }
             }
             _isDefault = false;
         }
     }
 }
Пример #2
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"];
        }
Пример #3
0
 public override void ImportFrom(object holder, ConfigNode node)
 {
     _fieldInfo.SetValue(holder, GUtil.ParseColor(node[_externalName], ToColor(_initial)));
 }