Exemple #1
0
 void LoadConfigInternalColors(JsonObject o)
 {
     ColorCodeNameConverter conv = new ColorCodeNameConverter ();
     Background = LoadConfigInternalColors (o, "bg", conv, Background);
     Foreground = LoadConfigInternalColors (o, "fg", conv, Foreground);
     PostTextBox.Background = LoadConfigInternalColors (o, "postTextBoxBg", conv, PostTextBox.Background);
     PostTextBox.Foreground = LoadConfigInternalColors (o, "postTextBoxFg", conv, PostTextBox.Foreground);
     PostBackground = LoadConfigInternalColors (o, "postBg", conv, PostBackground);
     PostForeground = LoadConfigInternalColors (o, "postFg", conv, PostForeground);
     NameForeground = LoadConfigInternalColors (o, "postNameFg", conv, NameForeground);
     LinkForeground = LoadConfigInternalColors (o, "postLinkFg", conv, LinkForeground);
 }
Exemple #2
0
 Brush LoadConfigInternalColors(JsonObject o, string key, ColorCodeNameConverter conv, Brush def)
 {
     try {
         if (!o.Value.ContainsKey (key))
             return def;
         return (Brush)conv.ConvertBack ((o.Value[key] as JsonString).Value, null, null, null);
     } catch {
         return def;
     }
 }
Exemple #3
0
 void SaveConfigInternalColors(JsonTextWriter writer)
 {
     ColorCodeNameConverter conv = new ColorCodeNameConverter ();
     writer.WriteKey ("bg");
     writer.WriteString ((string)conv.Convert (Background, null, null, null));
     writer.WriteKey ("fg");
     writer.WriteString ((string)conv.Convert (Foreground, null, null, null));
     writer.WriteKey ("postTextBoxBg");
     writer.WriteString ((string)conv.Convert (PostTextBox.Background, null, null, null));
     writer.WriteKey ("postTextBoxFg");
     writer.WriteString ((string)conv.Convert (PostTextBox.Foreground, null, null, null));
     writer.WriteKey ("postBg");
     writer.WriteString ((string)conv.Convert (PostBackground, null, null, null));
     writer.WriteKey ("postFg");
     writer.WriteString ((string)conv.Convert (PostForeground, null, null, null));
     writer.WriteKey ("postNameFg");
     writer.WriteString ((string)conv.Convert (NameForeground, null, null, null));
     writer.WriteKey ("postLinkFg");
     writer.WriteString ((string)conv.Convert (LinkForeground, null, null, null));
 }