Пример #1
0
 private void GoogleComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (GoogleComboBox.SelectedItem != null)
     {
         GoogleItemTextBox.Text = ContactMatch.GetSummary((Google.Contacts.Contact)GoogleComboBox.SelectedItem);
     }
 }
Пример #2
0
        public DeleteResolution ResolveDelete(OutlookContactInfo outlookContact)
        {
            string name = ContactMatch.GetName(outlookContact);

            _form.Text = "Google Contact deleted";
            _form.messageLabel.Text =
                "Google Contact \"" + name +
                "\" doesn't exist anymore. Do you want to delete it also on Outlook side?";

            _form.OutlookItemTextBox.Text = string.Empty;
            _form.GoogleItemTextBox.Text  = string.Empty;
            Outlook.ContactItem item = outlookContact.GetOriginalItemFromOutlook();
            try
            {
                _form.OutlookItemTextBox.Text = ContactMatch.GetSummary(item);
            }
            finally
            {
                if (item != null)
                {
                    Marshal.ReleaseComObject(item);
                    item = null;
                }
            }

            _form.keepOutlook.Text = "Keep Outlook";
            _form.keepGoogle.Text  = "Delete Outlook";
            _form.skip.Enabled     = false;

            return(ResolveDeletedGoogle());
        }
Пример #3
0
        public ConflictResolution Resolve(ContactMatch match, bool isNewMatch)
        {
            string name = match.ToString();

            if (isNewMatch)
            {
                _form.messageLabel.Text =
                    "This is the first time these Outlook and Google Contacts \"" + name +
                    "\" are synced. Choose which you would like to keep.";
                _form.skip.Text = "Keep both";
            }
            else
            {
                _form.messageLabel.Text =
                    "Both the Outlook Contact and the Google Contact \"" + name +
                    "\" have been changed. Choose which you would like to keep.";
            }

            _form.OutlookItemTextBox.Text = string.Empty;
            _form.GoogleItemTextBox.Text  = string.Empty;
            if (match.OutlookContact != null)
            {
                Microsoft.Office.Interop.Outlook.ContactItem item = match.OutlookContact.GetOriginalItemFromOutlook();
                try
                {
                    _form.OutlookItemTextBox.Text = ContactMatch.GetSummary(item);
                }
                finally
                {
                    if (item != null)
                    {
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(item);
                        item = null;
                    }
                }
            }

            if (match.GoogleContact != null)
            {
                _form.GoogleItemTextBox.Text = ContactMatch.GetSummary(match.GoogleContact);
            }


            return(Resolve());
        }
Пример #4
0
        public DeleteResolution ResolveDelete(Contact googleContact)
        {
            string name = ContactMatch.GetName(googleContact);

            _form.Text = "Outlook Contact deleted";
            _form.messageLabel.Text =
                "Outlook Contact \"" + name +
                "\" doesn't exist anymore. Do you want to delete it also on Google side?";

            _form.OutlookItemTextBox.Text = string.Empty;
            _form.GoogleItemTextBox.Text  = string.Empty;
            _form.GoogleItemTextBox.Text  = ContactMatch.GetSummary(googleContact);

            _form.keepOutlook.Text = "Keep Google";
            _form.keepGoogle.Text  = "Delete Google";
            _form.skip.Enabled     = false;

            return(ResolveDeletedOutlook());
        }
Пример #5
0
        public ConflictResolution ResolveDuplicate(OutlookContactInfo outlookContact, List <Contact> googleContacts, out Contact googleContact)
        {
            string name = ContactMatch.GetName(outlookContact);

            _form.messageLabel.Text =
                "There are multiple Google Contacts (" + googleContacts.Count + ") matching unique properties for Outlook Contact \"" + name +
                "\". Please choose from the combobox below the Google Contact you would like to match with Outlook and if you want to keep the Google or Outlook properties of the selected contact.";


            _form.OutlookItemTextBox.Text = string.Empty;
            _form.GoogleItemTextBox.Text  = string.Empty;

            Microsoft.Office.Interop.Outlook.ContactItem item = outlookContact.GetOriginalItemFromOutlook();
            try
            {
                _form.OutlookItemTextBox.Text = ContactMatch.GetSummary(item);
            }
            finally
            {
                if (item != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(item);
                    item = null;
                }
            }



            _form.GoogleComboBox.DataSource = googleContacts;
            _form.GoogleComboBox.Visible    = true;
            _form.AllCheckBox.Visible       = false;
            _form.skip.Text = "Keep both";


            ConflictResolution res = Resolve();

            googleContact = _form.GoogleComboBox.SelectedItem as Contact;

            return(res);
        }