+++ /dev/null
-' Tween - Client of Twitter
-' Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
-' (c) 2008-2011 Moz (@syo68k)
-' (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
-' (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
-' (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
-' All rights reserved.
-'
-' This file is part of Tween.
-'
-' This program is free software; you can redistribute it and/or modify it
-' under the terms of the GNU General Public License as published by the Free
-' Software Foundation; either version 3 of the License, or (at your option)
-' any later version.
-'
-' This program is distributed in the hope that it will be useful, but
-' WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-' or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-' for more details.
-'
-' You should have received a copy of the GNU General Public License along
-' with this program. If not, see <http://www.gnu.org/licenses/>, or write to
-' the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
-' Boston, MA 02110-1301, USA.
-
-<Serializable()> _
-Public Class SettingLocal
- Inherits SettingBase(Of SettingLocal)
-
-#Region "Settingクラス基本"
- Public Shared Function Load() As SettingLocal
- Return LoadSettings()
- End Function
-
- Public Sub Save()
- SaveSettings(Me)
- End Sub
-#End Region
-
- Private _fc As New FontConverter
- Private _cc As New ColorConverter
-
- Public FormLocation As New Point(0, 0)
- Public SplitterDistance As Integer = 200
- Public AdSplitterDistance As Integer = 350
- Public FormSize As New Size(600, 500)
- Public StatusText As String = ""
- Public UseRecommendStatus As Boolean = False
- Public Width1 As Integer = 48
- Public Width2 As Integer = 80
- Public Width3 As Integer = 290
- Public Width4 As Integer = 120
- Public Width5 As Integer = 50
- Public Width6 As Integer = 16
- Public Width7 As Integer = 32
- Public Width8 As Integer = 50
- Public DisplayIndex1 As Integer = 2
- Public DisplayIndex2 As Integer = 3
- Public DisplayIndex3 As Integer = 4
- Public DisplayIndex4 As Integer = 5
- Public DisplayIndex5 As Integer = 6
- Public DisplayIndex6 As Integer = 1
- Public DisplayIndex7 As Integer = 0
- Public DisplayIndex8 As Integer = 7
- Public BrowserPath As String = ""
- Public ProxyType As HttpConnection.ProxyType = HttpConnection.ProxyType.IE
- Public ProxyAddress As String = "127.0.0.1"
- Public ProxyPort As Integer = 80
- Public ProxyUser As String = ""
- Public StatusMultiline As Boolean = False
- Public StatusTextHeight As Integer = 38
- Public PreviewDistance As Integer = -1
-
- <Xml.Serialization.XmlIgnore()> _
- Public FontUnread As New Font(SystemFonts.DefaultFont, FontStyle.Bold Or FontStyle.Underline)
- Public Property FontUnreadStr() As String
- Get
- Return _fc.ConvertToString(FontUnread)
- End Get
- Set(ByVal value As String)
- FontUnread = DirectCast(_fc.ConvertFromString(value), Font)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorUnread As Color = System.Drawing.SystemColors.ControlText
- Public Property ColorUnreadStr() As String
- Get
- Return _cc.ConvertToString(ColorUnread)
- End Get
- Set(ByVal value As String)
- ColorUnread = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public FontRead As Font = System.Drawing.SystemFonts.DefaultFont
- Public Property FontReadStr() As String
- Get
- Return _fc.ConvertToString(FontRead)
- End Get
- Set(ByVal value As String)
- FontRead = DirectCast(_fc.ConvertFromString(value), Font)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorRead As Color = System.Drawing.SystemColors.ControlText
- Public Property ColorReadStr() As String
- Get
- Return _cc.ConvertToString(ColorRead)
- End Get
- Set(ByVal value As String)
- ColorRead = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorFav As Color = Color.FromKnownColor(System.Drawing.KnownColor.Red)
- Public Property ColorFavStr() As String
- Get
- Return _cc.ConvertToString(ColorFav)
- End Get
- Set(ByVal value As String)
- ColorFav = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorOWL As Color = Color.FromKnownColor(System.Drawing.KnownColor.Blue)
- Public Property ColorOWLStr() As String
- Get
- Return _cc.ConvertToString(ColorOWL)
- End Get
- Set(ByVal value As String)
- ColorOWL = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorRetweet As Color = Color.FromKnownColor(System.Drawing.KnownColor.Green)
- Public Property ColorRetweetStr() As String
- Get
- Return _cc.ConvertToString(ColorRetweet)
- End Get
- Set(ByVal value As String)
- ColorRetweet = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public FontDetail As Font = System.Drawing.SystemFonts.DefaultFont
- Public Property FontDetailStr() As String
- Get
- Return _fc.ConvertToString(FontDetail)
- End Get
- Set(ByVal value As String)
- FontDetail = DirectCast(_fc.ConvertFromString(value), Font)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorSelf As Color = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue)
- Public Property ColorSelfStr() As String
- Get
- Return _cc.ConvertToString(ColorSelf)
- End Get
- Set(ByVal value As String)
- ColorSelf = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorAtSelf As Color = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite)
- Public Property ColorAtSelfStr() As String
- Get
- Return _cc.ConvertToString(ColorAtSelf)
- End Get
- Set(ByVal value As String)
- ColorAtSelf = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorTarget As Color = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon)
- Public Property ColorTargetStr() As String
- Get
- Return _cc.ConvertToString(ColorTarget)
- End Get
- Set(ByVal value As String)
- ColorTarget = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorAtTarget As Color = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush)
- Public Property ColorAtTargetStr() As String
- Get
- Return _cc.ConvertToString(ColorAtTarget)
- End Get
- Set(ByVal value As String)
- ColorAtTarget = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorAtFromTarget As Color = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew)
- Public Property ColorAtFromTargetStr() As String
- Get
- Return _cc.ConvertToString(ColorAtFromTarget)
- End Get
- Set(ByVal value As String)
- ColorAtFromTarget = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorAtTo As Color = Color.FromKnownColor(System.Drawing.KnownColor.Pink)
- Public Property ColorAtToStr() As String
- Get
- Return _cc.ConvertToString(ColorAtTo)
- End Get
- Set(ByVal value As String)
- ColorAtTo = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorInputBackcolor As Color = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon)
- Public Property ColorInputBackcolorStr() As String
- Get
- Return _cc.ConvertToString(ColorInputBackcolor)
- End Get
- Set(ByVal value As String)
- ColorInputBackcolor = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorInputFont As Color = Color.FromKnownColor(System.Drawing.KnownColor.ControlText)
- Public Property ColorInputFontStr() As String
- Get
- Return _cc.ConvertToString(ColorInputFont)
- End Get
- Set(ByVal value As String)
- ColorInputFont = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public FontInputFont As Font = System.Drawing.SystemFonts.DefaultFont
- Public Property FontInputFontStr() As String
- Get
- Return _fc.ConvertToString(FontInputFont)
- End Get
- Set(ByVal value As String)
- FontInputFont = DirectCast(_fc.ConvertFromString(value), Font)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorListBackcolor As Color = Color.FromKnownColor(System.Drawing.KnownColor.Window)
- Public Property ColorListBackcolorStr() As String
- Get
- Return _cc.ConvertToString(ColorListBackcolor)
- End Get
- Set(ByVal value As String)
- ColorListBackcolor = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorDetailBackcolor As Color = Color.FromKnownColor(System.Drawing.KnownColor.Window)
- Public Property ColorDetailBackcolorStr() As String
- Get
- Return _cc.ConvertToString(ColorDetailBackcolor)
- End Get
- Set(ByVal value As String)
- ColorDetailBackcolor = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorDetail As Color = Color.FromKnownColor(System.Drawing.KnownColor.ControlText)
- Public Property ColorDetailStr() As String
- Get
- Return _cc.ConvertToString(ColorDetail)
- End Get
- Set(ByVal value As String)
- ColorDetail = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ColorDetailLink As Color = Color.FromKnownColor(System.Drawing.KnownColor.Blue)
- Public Property ColorDetailLinkStr() As String
- Get
- Return _cc.ConvertToString(ColorDetailLink)
- End Get
- Set(ByVal value As String)
- ColorDetailLink = DirectCast(_cc.ConvertFromString(value), Color)
- End Set
- End Property
-
- <Xml.Serialization.XmlIgnore()> _
- Public ProxyPassword As String = ""
- Public Property EncryptProxyPassword() As String
- Get
- Dim pwd As String = ProxyPassword
- If String.IsNullOrEmpty(pwd) Then pwd = ""
- If pwd.Length > 0 Then
- Try
- Return EncryptString(pwd)
- Catch ex As Exception
- Return ""
- End Try
- Else
- Return ""
- End If
- End Get
- Set(ByVal value As String)
- Dim pwd As String = value
- If String.IsNullOrEmpty(pwd) Then pwd = ""
- If pwd.Length > 0 Then
- Try
- pwd = DecryptString(pwd)
- Catch ex As Exception
- pwd = ""
- End Try
- End If
- ProxyPassword = pwd
- End Set
- End Property
-End Class
--- /dev/null
+// Tween - Client of Twitter
+// Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
+// (c) 2008-2011 Moz (@syo68k)
+// (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
+// (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
+// (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
+// (c) 2011 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
+// All rights reserved.
+//
+// This file is part of Tween.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>, or write to
+// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml.Serialization;
+
+namespace Tween
+{
+[Serializable]
+public class SettingLocal : SettingBase<SettingLocal>
+{
+#region "Settingクラス基本"
+ public static SettingLocal Load()
+ {
+ return LoadSettings();
+ }
+
+ public void Save()
+ {
+ SaveSettings(this);
+ }
+#endregion
+
+ private FontConverter _fc = new FontConverter();
+ private ColorConverter _cc = new ColorConverter();
+
+ public Point FormLocation = new Point(0, 0);
+ public int SplitterDistance = 200;
+ public int AdSplitterDistance = 350;
+ public Size FormSize = new Size(600, 500);
+ public string StatusText = "";
+ public bool UseRecommendStatus = false;
+ public int Width1 = 48;
+ public int Width2 = 80;
+ public int Width3 = 290;
+ public int Width4 = 120;
+ public int Width5 = 50;
+ public int Width6 = 16;
+ public int Width7 = 32;
+ public int Width8 = 50;
+ public int DisplayIndex1 = 2;
+ public int DisplayIndex2 = 3;
+ public int DisplayIndex3 = 4;
+ public int DisplayIndex4 = 5;
+ public int DisplayIndex5 = 6;
+ public int DisplayIndex6 = 1;
+ public int DisplayIndex7 = 0;
+ public int DisplayIndex8 = 7;
+ public string BrowserPath = "";
+ public HttpConnection.ProxyType ProxyType = HttpConnection.ProxyType.IE;
+ public string ProxyAddress = "127.0.0.1";
+ public int ProxyPort = 80;
+ public string ProxyUser = "";
+ public bool StatusMultiline = false;
+ public int StatusTextHeight = 38;
+ public int PreviewDistance = -1;
+
+ [XmlIgnore]
+ public Font FontUnread = new Font(SystemFonts.DefaultFont, FontStyle.Bold | FontStyle.Underline);
+ public string FontUnreadStr
+ {
+ get { return _fc.ConvertToString(FontUnread); }
+ set { FontUnread = (Font)_fc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorUnread = System.Drawing.SystemColors.ControlText;
+ public string ColorUnreadStr
+ {
+ get { return _cc.ConvertToString(ColorUnread); }
+ set { ColorUnread = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Font FontRead = System.Drawing.SystemFonts.DefaultFont;
+ public string FontReadStr
+ {
+ get { return _fc.ConvertToString(FontRead); }
+ set { FontRead = (Font) _fc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorRead = System.Drawing.SystemColors.ControlText;
+ public string ColorReadStr
+ {
+ get { return _cc.ConvertToString(ColorRead); }
+ set { ColorRead = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorFav = Color.FromKnownColor(System.Drawing.KnownColor.Red);
+ public string ColorFavStr
+ {
+ get { return _cc.ConvertToString(ColorFav); }
+ set { ColorFav = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorOWL = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
+ public string ColorOWLStr
+ {
+ get { return _cc.ConvertToString(ColorOWL); }
+ set { ColorOWL = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorRetweet = Color.FromKnownColor(System.Drawing.KnownColor.Green);
+ public string ColorRetweetStr
+ {
+ get { return _cc.ConvertToString(ColorRetweet); }
+ set { ColorRetweet = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Font FontDetail = System.Drawing.SystemFonts.DefaultFont;
+ public string FontDetailStr
+ {
+ get { return _fc.ConvertToString(FontDetail); }
+ set { FontDetail = (Font) _fc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorSelf = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue);
+ public string ColorSelfStr
+ {
+ get { return _cc.ConvertToString(ColorSelf); }
+ set { ColorSelf = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorAtSelf = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite);
+ public string ColorAtSelfStr
+ {
+ get { return _cc.ConvertToString(ColorAtSelf); }
+ set { ColorAtSelf = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorTarget = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
+ public string ColorTargetStr
+ {
+ get { return _cc.ConvertToString(ColorTarget); }
+ set { ColorTarget = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorAtTarget = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush);
+ public string ColorAtTargetStr
+ {
+ get { return _cc.ConvertToString(ColorAtTarget); }
+ set { ColorAtTarget = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorAtFromTarget = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew);
+ public string ColorAtFromTargetStr
+ {
+ get { return _cc.ConvertToString(ColorAtFromTarget); }
+ set { ColorAtFromTarget = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorAtTo = Color.FromKnownColor(System.Drawing.KnownColor.Pink);
+ public string ColorAtToStr
+ {
+ get { return _cc.ConvertToString(ColorAtTo); }
+ set { ColorAtTo = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorInputBackcolor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
+ public string ColorInputBackcolorStr
+ {
+ get { return _cc.ConvertToString(ColorInputBackcolor); }
+ set { ColorInputBackcolor = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorInputFont = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
+ public string ColorInputFontStr
+ {
+ get { return _cc.ConvertToString(ColorInputFont); }
+ set { ColorInputFont = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Font FontInputFont = System.Drawing.SystemFonts.DefaultFont;
+ public string FontInputFontStr
+ {
+ get { return _fc.ConvertToString(FontInputFont); }
+ set { FontInputFont = (Font) _fc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorListBackcolor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
+ public string ColorListBackcolorStr
+ {
+ get { return _cc.ConvertToString(ColorListBackcolor); }
+ set { ColorListBackcolor = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorDetailBackcolor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
+ public string ColorDetailBackcolorStr
+ {
+ get { return _cc.ConvertToString(ColorDetailBackcolor); }
+ set { ColorDetailBackcolor = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorDetail = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
+ public string ColorDetailStr
+ {
+ get { return _cc.ConvertToString(ColorDetail); }
+ set { ColorDetail = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public Color ColorDetailLink = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
+ public string ColorDetailLinkStr
+ {
+ get { return _cc.ConvertToString(ColorDetailLink); }
+ set { ColorDetailLink = (Color) _cc.ConvertFromString(value); }
+ }
+
+ [XmlIgnore]
+ public string ProxyPassword = "";
+ public string EncryptProxyPassword
+ {
+ get
+ {
+ string pwd = ProxyPassword;
+ if (string.IsNullOrEmpty(pwd)) pwd = "";
+ if (pwd.Length > 0)
+ {
+ try
+ {
+ return MyCommon.EncryptString(pwd);
+ }
+ catch (Exception)
+ {
+ return "";
+ }
+ }
+ else
+ {
+ return "";
+ }
+ }
+ set
+ {
+ string pwd = value;
+ if (string.IsNullOrEmpty(pwd)) pwd = "";
+ if (pwd.Length > 0)
+ {
+ try
+ {
+ pwd = MyCommon.DecryptString(pwd);
+ }
+ catch (Exception)
+ {
+ pwd = "";
+ }
+ }
+ ProxyPassword = pwd;
+ }
+ }
+}
+}