Example #1
0
        public ContactsWindow(ClientForm clientForm, NTContact selectedMyContact, Hashtable properties)
        {
            InitializeComponent();

            this.ClientSize = this.Size;
            this.MaximizeBox = false;
            this.MaximumSize = this.Size;

            myClientForm = clientForm;
            myWebPhonebook = myClientForm.myContactsBook;
            if (selectedMyContact != null)
            {
                myNTContact = selectedMyContact;
            }
            else
            {
                myNTContact = new NTContact();
            }


            myContactFirstNameInput.Text = myNTContact.NTFirstName;
            myContactMiddleNameInput.Text = myNTContact.NTMiddleName;
            myContactLastNameInput.Text = myNTContact.NTLastName;
            myContactPhoneHomeInput.Text = myNTContact.NTHomeTelephoneNumber;
            myContactPhoneMobileInput.Text = myNTContact.NTMobileTelephoneNumber;
            myContactPhoneBusinessInput.Text = myNTContact.NTBusinessTelephoneNumber;
            myContactPhoneVoIPInput.Text = myNTContact.NTVoIPTelephoneNumber;

            myContactAddressStreetInput.Text = myNTContact.NTHomeAddressStreet;
            myContactAddressCityInput.Text = myNTContact.NTHomeAddressCity;
            myContactAddressZipCodeInput.Text = myNTContact.NTHomeAddressPostalCode;
            myContactAddressStateInput.Text = myNTContact.NTHomeAddressState;
            myContactAddressCountryInput.Text = myNTContact.NTHomeAddressCountry;

            if (properties != null)
            {
                myContactFirstNameInput.Text = properties["NTFirstName"] != null ? properties["NTFirstName"].ToString() : myNTContact.NTFirstName;
                myContactMiddleNameInput.Text = properties["NTMiddleName"] != null ? properties["NTMiddleName"].ToString() : myNTContact.NTMiddleName;
                myContactLastNameInput.Text = properties["NTLastName"] != null ? properties["NTLastName"].ToString() : myNTContact.NTLastName;
                myContactPhoneHomeInput.Text = properties["NTHomeTelephoneNumber"] != null ? properties["NTHomeTelephoneNumber"].ToString() : myNTContact.NTHomeTelephoneNumber;
                myContactPhoneMobileInput.Text = properties["NTMobileTelephoneNumber"] != null ? properties["NTMobileTelephoneNumber"].ToString() : myNTContact.NTMobileTelephoneNumber;
                myContactPhoneBusinessInput.Text = properties["NTBusinessTelephoneNumber"] != null ? properties["NTBusinessTelephoneNumber"].ToString() : myNTContact.NTBusinessTelephoneNumber;
                myContactPhoneVoIPInput.Text = properties["NTVoIPTelephoneNumber"] != null ? properties["NTVoIPTelephoneNumber"].ToString() : myNTContact.NTVoIPTelephoneNumber;
                myContactJabberIDListBox.Text = properties["NTJabberID"] != null ? properties["NTJabberID"].ToString() : myNTContact.NTJabberID;

                myContactAddressStreetInput.Text = properties["NTHomeAddressStreet"] != null ? properties["NTHomeAddressStreet"].ToString() : myNTContact.NTHomeAddressStreet;
                myContactAddressCityInput.Text = properties["NTHomeAddressCity"] != null ? properties["NTHomeAddressCity"].ToString() : myNTContact.NTHomeAddressCity;
                myContactAddressZipCodeInput.Text = properties["NTHomeAddressPostalCode"] != null ? properties["NTHomeAddressPostalCode"].ToString() : myNTContact.NTHomeAddressPostalCode;
                myContactAddressStateInput.Text = properties["NTHomeAddressState"] != null ? properties["NTHomeAddressState"].ToString() : myNTContact.NTHomeAddressState;
                myContactAddressCountryInput.Text = properties["NTHomeAddressCountry"] != null ? properties["NTHomeAddressCountry"].ToString() : myNTContact.NTHomeAddressCountry;
            }

            myContactJabberIDListBox.Items.Clear();
            myContactJabberIDListBox.Items.Add("");

            myContactJabberGroupListBox.Items.Clear();
            myContactJabberGroupListBox.Items.Add("");

            foreach (DictionaryEntry buddy in myClientForm.myBuddyList)
            {
                myContactJabberIDListBox.Items.Add(buddy.Key.ToString());
                myContactJabberGroupListBox.Items.Add(buddy.Value.ToString());
                if(myNTContact.NTJabberID == buddy.Key.ToString())
                {
                     myContactJabberIDListBox.SelectedIndex = myContactJabberIDListBox.Items.Count - 1;
                     myContactJabberGroupListBox.SelectedIndex = myContactJabberGroupListBox.Items.Count - 1;
                }
            }

        }
Example #2
0
        private void setContactBook(WEBPhoneBook webPhoneBook)
        {

            if (this.InvokeRequired)
            {
                BeginInvoke(new setContactBookDelegate(setContactBook), new object[] { webPhoneBook });
            }
            else
            {
                myContactsBook = webPhoneBook;
            }

        }
Example #3
0
        public ContactsWindow(ClientForm clientForm, NTContact selectedMyContact, Hashtable properties)
        {
            InitializeComponent();

            this.ClientSize  = this.Size;
            this.MaximizeBox = false;
            this.MaximumSize = this.Size;

            myClientForm   = clientForm;
            myWebPhonebook = myClientForm.myContactsBook;
            if (selectedMyContact != null)
            {
                myNTContact = selectedMyContact;
            }
            else
            {
                myNTContact = new NTContact();
            }


            myContactFirstNameInput.Text     = myNTContact.NTFirstName;
            myContactMiddleNameInput.Text    = myNTContact.NTMiddleName;
            myContactLastNameInput.Text      = myNTContact.NTLastName;
            myContactPhoneHomeInput.Text     = myNTContact.NTHomeTelephoneNumber;
            myContactPhoneMobileInput.Text   = myNTContact.NTMobileTelephoneNumber;
            myContactPhoneBusinessInput.Text = myNTContact.NTBusinessTelephoneNumber;
            myContactPhoneVoIPInput.Text     = myNTContact.NTVoIPTelephoneNumber;

            myContactAddressStreetInput.Text  = myNTContact.NTHomeAddressStreet;
            myContactAddressCityInput.Text    = myNTContact.NTHomeAddressCity;
            myContactAddressZipCodeInput.Text = myNTContact.NTHomeAddressPostalCode;
            myContactAddressStateInput.Text   = myNTContact.NTHomeAddressState;
            myContactAddressCountryInput.Text = myNTContact.NTHomeAddressCountry;

            if (properties != null)
            {
                myContactFirstNameInput.Text     = properties["NTFirstName"] != null ? properties["NTFirstName"].ToString() : myNTContact.NTFirstName;
                myContactMiddleNameInput.Text    = properties["NTMiddleName"] != null ? properties["NTMiddleName"].ToString() : myNTContact.NTMiddleName;
                myContactLastNameInput.Text      = properties["NTLastName"] != null ? properties["NTLastName"].ToString() : myNTContact.NTLastName;
                myContactPhoneHomeInput.Text     = properties["NTHomeTelephoneNumber"] != null ? properties["NTHomeTelephoneNumber"].ToString() : myNTContact.NTHomeTelephoneNumber;
                myContactPhoneMobileInput.Text   = properties["NTMobileTelephoneNumber"] != null ? properties["NTMobileTelephoneNumber"].ToString() : myNTContact.NTMobileTelephoneNumber;
                myContactPhoneBusinessInput.Text = properties["NTBusinessTelephoneNumber"] != null ? properties["NTBusinessTelephoneNumber"].ToString() : myNTContact.NTBusinessTelephoneNumber;
                myContactPhoneVoIPInput.Text     = properties["NTVoIPTelephoneNumber"] != null ? properties["NTVoIPTelephoneNumber"].ToString() : myNTContact.NTVoIPTelephoneNumber;
                myContactJabberIDListBox.Text    = properties["NTJabberID"] != null ? properties["NTJabberID"].ToString() : myNTContact.NTJabberID;

                myContactAddressStreetInput.Text  = properties["NTHomeAddressStreet"] != null ? properties["NTHomeAddressStreet"].ToString() : myNTContact.NTHomeAddressStreet;
                myContactAddressCityInput.Text    = properties["NTHomeAddressCity"] != null ? properties["NTHomeAddressCity"].ToString() : myNTContact.NTHomeAddressCity;
                myContactAddressZipCodeInput.Text = properties["NTHomeAddressPostalCode"] != null ? properties["NTHomeAddressPostalCode"].ToString() : myNTContact.NTHomeAddressPostalCode;
                myContactAddressStateInput.Text   = properties["NTHomeAddressState"] != null ? properties["NTHomeAddressState"].ToString() : myNTContact.NTHomeAddressState;
                myContactAddressCountryInput.Text = properties["NTHomeAddressCountry"] != null ? properties["NTHomeAddressCountry"].ToString() : myNTContact.NTHomeAddressCountry;
            }

            myContactJabberIDListBox.Items.Clear();
            myContactJabberIDListBox.Items.Add("");

            myContactJabberGroupListBox.Items.Clear();
            myContactJabberGroupListBox.Items.Add("");

            foreach (DictionaryEntry buddy in myClientForm.myBuddyList)
            {
                myContactJabberIDListBox.Items.Add(buddy.Key.ToString());
                myContactJabberGroupListBox.Items.Add(buddy.Value.ToString());
                if (myNTContact.NTJabberID == buddy.Key.ToString())
                {
                    myContactJabberIDListBox.SelectedIndex    = myContactJabberIDListBox.Items.Count - 1;
                    myContactJabberGroupListBox.SelectedIndex = myContactJabberGroupListBox.Items.Count - 1;
                }
            }
        }