2 using System
.Collections
.Generic
;
3 using System
.Xml
.Serialization
;
7 public delegate void AccountModelDelegate (AccountModel model
);
9 public class AccountModel
15 bool require_encryption
;
23 public AccountModel () { }
25 public AccountModel (string protocol
)
27 this.protocol
= protocol
;
31 account
= "user@" + protocol
;
32 require_encryption
= false;
38 [XmlAttribute("Protocol")]
39 public string Protocol
41 get { return protocol; }
42 set { protocol = value; FireChanged (); }
45 [XmlElement("Server")]
48 get { return server; }
49 set { server = value; FireChanged (); }
52 [XmlElement("Account")]
53 public string AccountStr
55 get { return account; }
56 set { account = value; FireChanged (); }
59 [XmlElement("RequireEncryption")]
60 public bool RequireEncryption
62 get { return require_encryption; }
63 set { require_encryption = value; FireChanged (); }
66 [XmlElement("AutoConnect")]
67 public bool AutoConnect
69 get { return auto_connect; }
70 set { auto_connect = value; FireChanged (); }
74 public string Password
78 return Global.PluginManager.IPassword.GetPassword ("chatter-account-" + protocol + "-" + account);
82 Global.PluginManager.IPassword.SetPassword ("chatter-account-" + protocol + "-" + account, value);
86 [XmlElement("Password")]
87 public string Password
95 password
= value; FireChanged();
104 set { port = value; FireChanged (); }
108 public IDictionary
<string, object> Parameters
112 IDictionary
<string, object> list
= new Dictionary
<string, object> ();
114 list
.Add (new KeyValuePair
<string, object> ("server", Server
));
115 if (AccountStr
!= "")
116 list
.Add (new KeyValuePair
<string, object> ("account", AccountStr
));
118 list
.Add (new KeyValuePair
<string, object> ("password", Password
));
120 list
.Add (new KeyValuePair
<string, object> ("port", Port
));
122 list
.Add (new KeyValuePair
<string, object> ("ignore-ssl-errors", true));
123 list
.Add (new KeyValuePair
<string, object> ("old-ssl", (bool) true));
130 if (Changed
!= null) Changed (this);
133 public event AccountModelDelegate Changed
;