/// <summary> /// Method which is invoked by the AddIn framework when the control is created. /// </summary> /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param> /// <param name="RecordContext">The current workspace record context.</param> /// <returns>The control which implements the IWorkspaceComponent2 interface.</returns> public IWorkspaceComponent2 CreateControl(bool inDesignMode, IRecordContext RecordContext) { if (!ConfigurationSetting.configVerbPerfect) { if (!ConfigurationSetting.loginUserIsAdmin) { MessageBox.Show("Activity Add-In is not initialized properly. \nPlease contact your system administrator.\n You are now logged out."); _gContext.Logout(); } else // don't want to logout admin { MessageBox.Show("Activity Add-In is not loaded because of invalid configuration verb."); return(new ActivityAddIn(inDesignMode, RecordContext)); } } _rContext = RecordContext; if (!inDesignMode && _rContext != null) { ConfigurationSetting instance = ConfigurationSetting.Instance(_gContext); _usr = ConfigurationSetting.username; _pwd = ConfigurationSetting.password; //_client = ConfigurationSetting.client; _rnSrv = ConfigurationSetting.rnSrv; _log = ConfigurationSetting.logWrap; _siebelServiceUserId = ConfigurationSetting.siebelServiceUserId; _siebelDefaultSrOwnerId = ConfigurationSetting.siebelDefaultSrOwnerId; Activity.ServiceProvider = ConfigurationSetting.SiebelProvider; Activity.LookupURL = ConfigurationSetting.CreateSR_WSDL; Activity.ServiceUsername = String.IsNullOrEmpty(_usr) ? "ebusiness" : _usr; Activity.ServicePassword = String.IsNullOrEmpty(_pwd) ? "password" : _pwd; Activity.ServiceClientTimeout = ConfigurationSetting.SiebelServiceTimeout; Activity.InitSiebelProvider(); } _wsAddIn = new ActivityAddIn(inDesignMode, _rContext); _wsAddIn._rnSrv = _rnSrv; _wsAddIn._log = _log; _wsAddIn._siebelServiceUserId = _siebelServiceUserId; if (_log != null) { string logMessage = "Activity AddIn is setup."; _log.DebugLog(logMessage: logMessage); } return(_wsAddIn); }
/// <summary> /// Method which is invoked by the AddIn framework when the control is created. /// </summary> /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param> /// <param name="RecordContext">The current workspace record context.</param> /// <returns>The control which implements the IWorkspaceComponent2 interface.</returns> public IWorkspaceComponent2 CreateControl(bool inDesignMode, IRecordContext RecordContext) { if (!ConfigurationSetting.configVerbPerfect) { if (!ConfigurationSetting.loginUserIsAdmin) { MessageBox.Show("Activity Add-In is not initialized properly. \nPlease contact your system administrator.\n You are now logged out."); _gContext.Logout(); } else // don't want to logout admin { MessageBox.Show("Activity Add-In is not loaded because of invalid configuration verb."); return new ActivityAddIn(inDesignMode, RecordContext); } } _rContext = RecordContext; if (!inDesignMode && _rContext != null) { ConfigurationSetting instance = ConfigurationSetting.Instance(_gContext); _usr = ConfigurationSetting.username; _pwd = ConfigurationSetting.password; //_client = ConfigurationSetting.client; _rnSrv = ConfigurationSetting.rnSrv; _log = ConfigurationSetting.logWrap; _siebelServiceUserId = ConfigurationSetting.siebelServiceUserId; _siebelDefaultSrOwnerId = ConfigurationSetting.siebelDefaultSrOwnerId; Activity.ServiceProvider = ConfigurationSetting.SiebelProvider; Activity.LookupURL = ConfigurationSetting.CreateSR_WSDL; Activity.ServiceUsername = String.IsNullOrEmpty(_usr) ? "ebusiness" : _usr; Activity.ServicePassword = String.IsNullOrEmpty(_pwd) ? "password" : _pwd; Activity.ServiceClientTimeout = ConfigurationSetting.SiebelServiceTimeout; Activity.InitSiebelProvider(); } _wsAddIn = new ActivityAddIn(inDesignMode, _rContext); _wsAddIn._rnSrv = _rnSrv; _wsAddIn._log = _log; _wsAddIn._siebelServiceUserId = _siebelServiceUserId; if (_log != null) { string logMessage = "Activity AddIn is setup."; _log.DebugLog(logMessage: logMessage); } return _wsAddIn; }