Esempio n. 1
0
        protected void _loadConversations()
        {
            if (this.InvokeRequired)
            {
                remoteDelegate r = new remoteDelegate(_loadConversations);
                this.Invoke(r);
            }
            else
            {
                DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite");
                using (DbConnection cnn = fact.CreateConnection())
                {
                    cnn.ConnectionString = MessageStore.ConnectionString;
                    cnn.Open();
                    DbCommand cmd = cnn.CreateCommand();
                    cmd = cnn.CreateCommand();
                    cmd.CommandText = "SELECT jid FROM Messages GROUP BY jid";
                    DbDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        string jid = reader["jid"].ToString();
                        Contact contact = ContactStore.GetContactByJid(jid);
                        if (contact != null)
                        {
                            this.contacts.Add(contact);
                        }
                    }
                }

                //done
                this.label1.Hide();
                this.listBox1.Enabled = true;
            }
        }
Esempio n. 2
0
 protected void doExit()
 {
     if (this.InvokeRequired)
     {
         remoteDelegate d = new remoteDelegate(doExit);
         this.Invoke(d);
     }
     else
     {
         this.Dispose();
     }
 }
Esempio n. 3
0
 protected void doExit()
 {
     if (this.InvokeRequired)
     {
         remoteDelegate d = new remoteDelegate(doExit);
         this.Invoke(d);
     }
     else
     {
         this.Dispose();
     }
 }
Esempio n. 4
0
        protected void _loadConversations()
        {
            
            if (this.InvokeRequired)
            {
                remoteDelegate r = new remoteDelegate(_loadConversations);
                this.Invoke(r);
            }
            else
            {
                this.flowLayoutPanel1.Controls.Clear();
                DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite");
                using (DbConnection cnn = fact.CreateConnection())
                {
                    cnn.ConnectionString = MessageStore.ConnectionString;
                    cnn.Open();
                    DbCommand cmd = cnn.CreateCommand();
                    cmd = cnn.CreateCommand();
                    cmd.CommandText = "SELECT jid FROM Messages GROUP BY jid";
                    DbDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        string jid = reader["jid"].ToString();
                        Contact contact = ContactStore.GetContactByJid(jid);
                        if (contact != null)
                        {
                            this.contacts.Add(contact);

                            //add to richtextbox
                            ListContact c = new ListContact(contact.jid, this.Style);
                            c.DoubleClick += this.contact_dblClick;
                            this.flowLayoutPanel1.Controls.Add(c);
                        }
                    }
                }

                //done
                this.label1.Hide();
            }
        }
Esempio n. 5
0
        protected void _loadConversations()
        {
            if (this.InvokeRequired)
            {
                remoteDelegate r = new remoteDelegate(_loadConversations);
                this.Invoke(r);
            }
            else
            {
                this.flowLayoutPanel1.Controls.Clear();
                DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite");
                using (DbConnection cnn = fact.CreateConnection())
                {
                    cnn.ConnectionString = MessageStore.ConnectionString;
                    cnn.Open();
                    DbCommand cmd = cnn.CreateCommand();
                    cmd             = cnn.CreateCommand();
                    cmd.CommandText = "SELECT jid FROM Messages GROUP BY jid";
                    DbDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        string  jid     = reader["jid"].ToString();
                        Contact contact = ContactStore.GetContactByJid(jid);
                        if (contact != null)
                        {
                            this.contacts.Add(contact);

                            //add to richtextbox
                            ListContact c = new ListContact(contact.jid);
                            c.DoubleClick += this.contact_dblClick;
                            this.flowLayoutPanel1.Controls.Add(c);
                        }
                    }
                }

                //done
                this.label1.Hide();
            }
        }