/// <summary> /// Creates the instance. /// </summary> /// <param name="appSetting">The app setting.</param> /// <param name="oItemType">Type of the o item.</param> /// <returns></returns> public static RemoteProviderProxy CreateInstance(syncAppSetting appSetting, Outlook.OlItemType oItemType) { RemoteProviderProxy retVal = null; NetworkCredential cred = new NetworkCredential(); cred.UserName = appSetting.ibnPortalLogin; cred.Password = appSetting.ibnPortalPassword; SynchronizationService syncService = new SynchronizationService(); //enable session syncService.CookieContainer = new System.Net.CookieContainer(); string syncServiceUrl = appSetting.ibnPortalUrl; if (!syncServiceUrl.Contains(OutlookAddin.Resources.System_IbnSyncWebServicePath)) { Uri url = new Uri(syncServiceUrl); UriBuilder uriBuilder = new UriBuilder(); uriBuilder.Scheme = Uri.UriSchemeHttp; uriBuilder.Port = url.Port; uriBuilder.Host = url.Host; uriBuilder.Path = url.AbsolutePath + OutlookAddin.Resources.System_IbnSyncWebServicePath; syncServiceUrl = uriBuilder.ToString(); } syncService.Url = syncServiceUrl; //Authentificate syncService.SetCredentials(cred); //Set sync provider syncService.SetProviderTypeForSyncSession((OutlookAddin.SyncService.eSyncProviderType)oItemType); retVal = new RemoteProviderProxy(syncService); return(retVal); }
/// <summary> /// Creates the instance. /// </summary> /// <param name="appSetting">The app setting.</param> /// <param name="oItemType">Type of the o item.</param> /// <returns></returns> public static RemoteProviderProxy CreateInstance(syncAppSetting appSetting, Outlook.OlItemType oItemType) { RemoteProviderProxy retVal = null; NetworkCredential cred = new NetworkCredential(); cred.UserName = appSetting.ibnPortalLogin; cred.Password = appSetting.ibnPortalPassword; SynchronizationService syncService = new SynchronizationService(); //enable session syncService.CookieContainer = new System.Net.CookieContainer(); string syncServiceUrl = appSetting.ibnPortalUrl; if (!syncServiceUrl.Contains(OutlookAddin.Resources.System_IbnSyncWebServicePath)) { Uri url = new Uri(syncServiceUrl); UriBuilder uriBuilder = new UriBuilder(); uriBuilder.Scheme = Uri.UriSchemeHttp; uriBuilder.Port = url.Port; uriBuilder.Host = url.Host; uriBuilder.Path = url.AbsolutePath + OutlookAddin.Resources.System_IbnSyncWebServicePath; syncServiceUrl = uriBuilder.ToString(); } syncService.Url = syncServiceUrl; //Authentificate syncService.SetCredentials(cred); //Set sync provider syncService.SetProviderTypeForSyncSession((OutlookAddin.SyncService.eSyncProviderType)oItemType); retVal = new RemoteProviderProxy(syncService); return retVal; }
public void HarvestSetting(ref object setting) { syncAppSetting acountSetting = setting as syncAppSetting; if (acountSetting != null) { acountSetting.ibnPortalUrl = this.tbServer.Text; acountSetting.ibnPortalLogin = this.tbUser.Text; acountSetting.ibnPortalPassword = this.tbPass.Text; } }
public void SetSetting(object setting) { syncAppSetting acountSetting = setting as syncAppSetting; if (acountSetting != null) { this.tbServer.Text = acountSetting.ibnPortalUrl; this.tbUser.Text = acountSetting.ibnPortalLogin; this.tbPass.Text = acountSetting.ibnPortalPassword; } }