1 // OpenTween - Client of Twitter
2 // Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
3 // (c) 2008-2011 Moz (@syo68k)
4 // (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
5 // (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
6 // (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
7 // (c) 2011 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
8 // All rights reserved.
10 // This file is part of OpenTween.
12 // This program is free software; you can redistribute it and/or modify it
13 // under the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 3 of the License, or (at your option)
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 // You should have received a copy of the GNU General Public License along
23 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
24 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
25 // Boston, MA 02110-1301, USA.
28 using System.Collections.Generic;
32 using System.Xml.Serialization;
37 public class SettingLocal : SettingBase<SettingLocal>, IDisposable
40 public static SettingLocal Load()
42 return LoadSettings();
51 public Point FormLocation = new Point(0, 0);
52 public int SplitterDistance = 200;
53 public int AdSplitterDistance = 350;
54 public Size FormSize = new Size(600, 500);
55 public string StatusText = "";
56 public bool UseRecommendStatus = false;
57 public int Width1 = 48;
58 public int Width2 = 80;
59 public int Width3 = 290;
60 public int Width4 = 120;
61 public int Width5 = 50;
62 public int Width6 = 16;
63 public int Width7 = 32;
64 public int Width8 = 50;
65 public int DisplayIndex1 = 2;
66 public int DisplayIndex2 = 3;
67 public int DisplayIndex3 = 4;
68 public int DisplayIndex4 = 5;
69 public int DisplayIndex5 = 6;
70 public int DisplayIndex6 = 1;
71 public int DisplayIndex7 = 0;
72 public int DisplayIndex8 = 7;
73 public string BrowserPath = "";
74 public HttpConnection.ProxyType ProxyType = HttpConnection.ProxyType.IE;
75 public string ProxyAddress = "127.0.0.1";
76 public int ProxyPort = 80;
77 public string ProxyUser = "";
78 public bool StatusMultiline = false;
79 public int StatusTextHeight = 38;
80 public int PreviewDistance = -1;
83 public Font FontUnread = new Font(SystemFonts.DefaultFont, FontStyle.Bold | FontStyle.Underline);
84 public string FontUnreadStr
86 get { return this.FontToString(this.FontUnread); }
87 set { this.FontUnread = this.StringToFont(value); }
91 public Color ColorUnread = System.Drawing.SystemColors.ControlText;
92 public string ColorUnreadStr
94 get { return this.ColorToString(this.ColorUnread); }
95 set { this.ColorUnread = this.StringToColor(value); }
99 public Font FontRead = System.Drawing.SystemFonts.DefaultFont;
100 public string FontReadStr
102 get { return this.FontToString(this.FontRead); }
103 set { this.FontRead = this.StringToFont(value); }
107 public Color ColorRead = System.Drawing.SystemColors.ControlText;
108 public string ColorReadStr
110 get { return this.ColorToString(this.ColorRead); }
111 set { this.ColorRead = this.StringToColor(value); }
115 public Color ColorFav = Color.FromKnownColor(System.Drawing.KnownColor.Red);
116 public string ColorFavStr
118 get { return this.ColorToString(this.ColorFav); }
119 set { this.ColorFav = this.StringToColor(value); }
123 public Color ColorOWL = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
124 public string ColorOWLStr
126 get { return this.ColorToString(this.ColorOWL); }
127 set { this.ColorOWL = this.StringToColor(value); }
131 public Color ColorRetweet = Color.FromKnownColor(System.Drawing.KnownColor.Green);
132 public string ColorRetweetStr
134 get { return this.ColorToString(this.ColorRetweet); }
135 set { this.ColorRetweet = this.StringToColor(value); }
139 public Font FontDetail = System.Drawing.SystemFonts.DefaultFont;
140 public string FontDetailStr
142 get { return this.FontToString(this.FontDetail); }
143 set { this.FontDetail = this.StringToFont(value); }
147 public Color ColorSelf = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue);
148 public string ColorSelfStr
150 get { return this.ColorToString(this.ColorSelf); }
151 set { this.ColorSelf = this.StringToColor(value); }
155 public Color ColorAtSelf = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite);
156 public string ColorAtSelfStr
158 get { return this.ColorToString(this.ColorAtSelf); }
159 set { this.ColorAtSelf = this.StringToColor(value); }
163 public Color ColorTarget = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
164 public string ColorTargetStr
166 get { return this.ColorToString(this.ColorTarget); }
167 set { this.ColorTarget = this.StringToColor(value); }
171 public Color ColorAtTarget = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush);
172 public string ColorAtTargetStr
174 get { return this.ColorToString(this.ColorAtTarget); }
175 set { this.ColorAtTarget = this.StringToColor(value); }
179 public Color ColorAtFromTarget = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew);
180 public string ColorAtFromTargetStr
182 get { return this.ColorToString(this.ColorAtFromTarget); }
183 set { this.ColorAtFromTarget = this.StringToColor(value); }
187 public Color ColorAtTo = Color.FromKnownColor(System.Drawing.KnownColor.Pink);
188 public string ColorAtToStr
190 get { return this.ColorToString(this.ColorAtTo); }
191 set { this.ColorAtTo = this.StringToColor(value); }
195 public Color ColorInputBackcolor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
196 public string ColorInputBackcolorStr
198 get { return this.ColorToString(this.ColorInputBackcolor); }
199 set { this.ColorInputBackcolor = this.StringToColor(value); }
203 public Color ColorInputFont = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
204 public string ColorInputFontStr
206 get { return this.ColorToString(this.ColorInputFont); }
207 set { this.ColorInputFont = this.StringToColor(value); }
211 public Font FontInputFont = System.Drawing.SystemFonts.DefaultFont;
212 public string FontInputFontStr
214 get { return this.FontToString(this.FontInputFont); }
215 set { this.FontInputFont = this.StringToFont(value); }
219 public Color ColorListBackcolor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
220 public string ColorListBackcolorStr
222 get { return this.ColorToString(this.ColorListBackcolor); }
223 set { this.ColorListBackcolor = this.StringToColor(value); }
227 public Color ColorDetailBackcolor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
228 public string ColorDetailBackcolorStr
230 get { return this.ColorToString(this.ColorDetailBackcolor); }
231 set { this.ColorDetailBackcolor = this.StringToColor(value); }
235 public Color ColorDetail = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
236 public string ColorDetailStr
238 get { return this.ColorToString(this.ColorDetail); }
239 set { this.ColorDetail = this.StringToColor(value); }
243 public Color ColorDetailLink = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
244 public string ColorDetailLinkStr
246 get { return this.ColorToString(this.ColorDetailLink); }
247 set { this.ColorDetailLink = this.StringToColor(value); }
251 public Font FontUIGlobal = null;
254 /// [隠し設定] UI フォントを指定します
257 /// フォントによっては一部レイアウトが崩れるためこっそり追加
259 public string FontUIGlobalStr
261 get { return this.FontToString(this.FontUIGlobal); }
262 set { this.FontUIGlobal = this.StringToFont(value); }
266 public string ProxyPassword = "";
267 public string EncryptProxyPassword
271 string pwd = ProxyPassword;
272 if (string.IsNullOrEmpty(pwd)) pwd = "";
277 return MyCommon.EncryptString(pwd);
292 if (string.IsNullOrEmpty(pwd)) pwd = "";
297 pwd = MyCommon.DecryptString(pwd);
309 private FontConverter fontConverter = new FontConverter();
311 protected string FontToString(Font font)
313 return font != null ? this.fontConverter.ConvertToString(font) : null;
316 protected Font StringToFont(string str)
318 return str != null ? (Font)this.fontConverter.ConvertFromString(str) : null;
322 private ColorConverter colorConverter = new ColorConverter();
324 protected string ColorToString(Color color)
326 return this.colorConverter.ConvertToString(color);
329 protected Color StringToColor(string str)
331 return (Color)this.colorConverter.ConvertFromString(str);
334 public void Dispose()
337 GC.SuppressFinalize(this);
340 protected virtual void Dispose(bool disposing)
344 this.FontUnread.Dispose();
345 this.FontRead.Dispose();
346 this.FontDetail.Dispose();
347 this.FontInputFont.Dispose();