~cszikszoy/do-plugins/pastebin

« back to all changes in this revision

Viewing changes to GMailContacts/src/GMail.cs

  • Committer: Alex Launi
  • Date: 2008-06-07 05:52:01 UTC
  • Revision ID: alex@eriktorvaldsonn-20080607055201-gip5v5ppp2emon37
Fix null error and config in GMail

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
                static GMail()
42
42
                {
43
43
                        string username, password;
 
44
                        username = password = "";
44
45
                        ServicePointManager.CertificatePolicy = new CertHandler ();
45
46
                        contacts = new List<IItem> ();
46
47
                        last_updated = new DateTime (1987, 11, 28);
47
 
                        Configuration.GetAccountData (out username, out password,
48
 
                                typeof (Configuration));
 
48
                        GMailConfig.GetAccountData (out username, out password,
 
49
                                typeof (GMailConfig));
49
50
                        Connect (username, password);
50
51
                }
51
52
                
89
90
                                        }
90
91
                                        
91
92
                                        buddy = ContactItem.CreateWithName (entry.Title.Text);
92
 
                                        buddy ["address.gmail"] = 
93
 
                                                entry.PrimaryPostalAddress.Value.Replace ('\n',' ');
94
 
                                        buddy ["phone.gmail"] = 
95
 
                                                entry.PrimaryPhonenumber.Value.Replace ('\n',' ');
 
93
                                        try {
 
94
                                                buddy ["address.gmail"] = 
 
95
                                                        entry.PrimaryPostalAddress.Value.Replace ('\n',' ');
 
96
                                        } catch { }
 
97
                                        try {
 
98
                                                buddy ["phone.gmail"] = 
 
99
                                                        entry.PrimaryPhonenumber.Value.Replace ('\n',' ');
 
100
                                        } catch { }
96
101
                                        int i = 0;
97
102
                                        foreach (EMail email in entry.Emails)
98
103
                                        {