Exemple #1
0
		public NokiaDiscoverer(IGUICallbacks owner, NokiaContactsProvider provider)
		{
			window = owner;
			nokiaProvider = provider;
			nokiaProvider.pCANotifyCallBack = CANotifyCallBack;
			nokiaProvider.pCAOperationCallback = CAOperationCallback;
			nokiaProvider.pDeviceCallBack = DeviceNotifyCallback;
			
			int iResult = CONADeviceManagement.DMAPI_Initialize(CONADeviceManagement.DMAPI_VERSION_32, 0);
			iResult = DAContentAccess.CAAPI_Initialize(DAContentAccess.CAAPI_VERSION_30, 0);
			iResult = CONADeviceManagement.CONAOpenDM(ref m_hDMHandle);
			if (iResult != PCCSErrors.CONA_OK) error = 1;
			pDeviceCallBack = DeviceNotifyCallback;
			iResult = CONADeviceManagement.CONARegisterNotifyCallback(m_hDMHandle, CONADefinitions.API_REGISTER, pDeviceCallBack);
			if (iResult != PCCSErrors.CONA_OK) error = 2;

			//window.syncButton.DropDown.Opened +=new RoutedEventHandler(DropDown_Opened);

		}
		public NokiaContactsProvider(IGUICallbacks host, SyncEngine syncEngine)
		{
			owner = host;
			this.syncEngine = syncEngine;
		}
Exemple #3
0
		public SyncEngine(IGUICallbacks host, bool XP)
		{
			owner = host;
			IsXP = XP;
		}
		public WindowsContactsProvider(IGUICallbacks host, SyncEngine syncEngine)
		{
			owner = host;
			manager = new ContactManager();
			this.syncEngine = syncEngine;
		}
		public OutlookContactsProvider(IGUICallbacks host, SyncEngine syncEngine)
		{
			owner = host;

			outlookApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
			Microsoft.Office.Interop.Outlook.NameSpace ns = outlookApp .GetNamespace("MAPI");
			nsObject = ns.MAPIOBJECT;

			if (!IsRedemptionInstalled())
			{
				Process reg = new Process();
				reg.StartInfo.FileName = "regsvr32.exe";
				reg.StartInfo.Arguments = "/s Redemption.dll";
				reg.StartInfo.UseShellExecute = false;
				reg.StartInfo.CreateNoWindow = true;
				reg.StartInfo.RedirectStandardOutput = true;
				reg.Start();
				reg.WaitForExit();
				reg.Close();
			}
			else
			{
			}

			rdoSession = new RDOSessionClass();
			try
			{
				rdoSession.MAPIOBJECT = nsObject;
			}
			catch
			{
				Microsoft.Office.Interop.Outlook.MAPIFolder mf = outlookApp.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
				string pstPath = GetStorePath(mf.StoreID);
				//string pstPath = @"C:\Users\maxim\AppData\Local\Microsoft\Outlook\Outlook.pst";
				rdoSession.LogonPstStore(pstPath, 1, "", "", 0);
			}
			
			rdoAddressBook = rdoSession.AddressBook;
			rdoAddressList = rdoAddressBook.GAL;
			rdoFld = rdoSession.GetDefaultFolder(rdoDefaultFolders.olFolderContacts);
			rdoItems = rdoFld.Items;

			this.syncEngine = syncEngine;
		}
		public GmailContactsProvider(IGUICallbacks host, SyncEngine syncEngine)
		{
			this.syncEngine = syncEngine;
			owner = host;
		}