Пример #1
0
            public void Load()
            {
                db = new MorkDatabase(file);
                db.Read();

                switch (account.Type)
                {
                case AccountType.Pop3:
                case AccountType.Imap:
                case AccountType.Rss:
                case AccountType.Nntp:
                case AccountType.MoveMail:
                    db.EnumNamespace = "ns:msg:db:row:scope:msgs:all";
                    break;

                case AccountType.AddressBook:
                    db.EnumNamespace = "ns:addrbk:db:row:scope:card:all";
                    break;
                }

                current = db.GetEnumerator();
            }
Пример #2
0
		public void LoadDatabase ()
		{
			// Load the database file
			try {
				database = new MorkDatabase (uri.AbsolutePath);
				database.Read ();
				database.EnumNamespace = "ns:addrbk:db:row:scope:card:all";
			} catch (Exception e) {
				MessageDialog dialog = new MessageDialog (
					MainWindow,
					DialogFlags.DestroyWithParent, 
					MessageType.Error, 
					ButtonsType.Ok, 
					false, 
					String.Format (Catalog.GetString ("Unable to open mork database:\n\n {0}"), e.Message));
				
				dialog.Run ();
				dialog.Destroy ();
				Environment.Exit (1);
			}
			
			// Populate the gui with nice stuff
			Clear ();
			FillContactList ();
			
			try {
				Match m = Regex.Match (uri.Query, @"\?id=(?<id>[0-9A-Fa-f]+)");	
				ShowContact (m.Result ("${id}"));
			} catch {
				Gtk.MessageDialog dialog = new MessageDialog (
					MainWindow,
					DialogFlags.DestroyWithParent,
					MessageType.Warning,
					ButtonsType.Ok,
					Catalog.GetString ("The specified ID does not exist in this database!"));
				
				dialog.Run ();
				dialog.Destroy ();
			}
		}
Пример #3
0
 public DatabaseEnumerator(MorkDatabase db, Account account, IEnumerator enumerator)
 {
     this.db         = db;
     this.enumerator = enumerator;
     this.account    = account;
 }
Пример #4
0
				public DatabaseEnumerator (MorkDatabase db, Account account, IEnumerator enumerator)
				{
					this.db = db;
					this.enumerator = enumerator;
					this.account = account;
				}
Пример #5
0
			public void Load ()
			{
				db = new MorkDatabase (file);
				db.Read();
				
				switch (account.Type) {
				case AccountType.Pop3:
				case AccountType.Imap:
				case AccountType.Rss:
				case AccountType.Nntp:
				case AccountType.MoveMail:
					db.EnumNamespace = "ns:msg:db:row:scope:msgs:all";
					break;
				case AccountType.AddressBook:
					db.EnumNamespace = "ns:addrbk:db:row:scope:card:all";
					break;
				}
				
				current = db.GetEnumerator ();
			}