コード例 #1
0
        public int ShowProperties(IntPtr hWndParent, ref Guid ItemID)
        {
            if (syncMgrSynchronizeCallback == null)
            {
                unchecked
                {
                    return (int) 0x80004005;  // E_FAIL
                }
            }

			string name = "Unknown";
			if (enumItems != null)
			foreach(SyncItem g in enumItems.items)
			{
				if (g.Guid.Equals(ItemID)) {
					name = g.Name;
					break;
				}
			}

			NativeWindow nw = NativeWindow.FromHandle(hWndParent);
			if (name == "Google Contacts")
			{
				GooglePropertiesForm propertiesForm = new GooglePropertiesForm();
				if (DialogResult.OK == propertiesForm.ShowDialog((IWin32Window)nw))
				{
					// save
				}
			}
			else if (name == "Outlook PIM")
			{
				GooglePropertiesForm propertiesForm = new GooglePropertiesForm();
				if (DialogResult.OK == propertiesForm.ShowDialog((IWin32Window)nw))
				{
					// save
				}
			}

            syncMgrSynchronizeCallback.ShowPropertiesCompleted(0);
            return 0;
        }
コード例 #2
0
    //
    // propertiesButton_Click
    //
    // Display the FileSync Properties dialog.
    //
    // Parameters:
	//  sender - The source Button object for this event.
	//  e - The EventArgs object that contains the event data.
	//
	private void propertiesButton_Click(object sender, System.EventArgs e)
	{
		try
		{
			GooglePropertiesForm propertiesForm = new GooglePropertiesForm();
			SynrcSync fileSync = new SynrcSync();
			//propertiesForm.ClientFolder = fileSync.ClientFolder;
			//propertiesForm.ServerFolder = fileSync.ServerFolder;
			//propertiesForm.SyncHandlerName = fileSync.SyncHandlerName;
			//propertiesForm.SyncItemName = fileSync.SyncItemName;
			//propertiesForm.RegistryComment = fileSync.RegistryComment;
			
		
			if (DialogResult.OK == propertiesForm.ShowDialog(this))
			{
				//fileSync.ClientFolder = propertiesForm.ClientFolder;
				//fileSync.ServerFolder = propertiesForm.ServerFolder;
				//fileSync.SyncHandlerName = propertiesForm.SyncHandlerName;
				//fileSync.SyncItemName = propertiesForm.SyncItemName;
				//fileSync.RegistryComment = propertiesForm.RegistryComment;
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show("Exception from properties dialog: " + ex.Message);
		}

	}