コード例 #1
0
        public void Connect(IDictionary <string, string> properties)
        {
            using (new LogMethodExecution(ConnectorTypeDescription + connectionId.ToString(), methodInfo.GetCurrentMethodName()))
            {
                try
                {
                    // validate & get connection properties
                    var connectionProps = ConnectionHelper.GetConnectionProperties(properties);

                    if (service == null)
                    {
                        service = new ConnectorService();
                    }

                    service.Connect(connectionProps);
                }
                catch (InvalidConnectionException)
                {
                    clearLocals();
                    throw;
                }
                catch (Exception exception)
                {
                    clearLocals();
                    unhandledExecptionHandler(methodInfo.GetCurrentMethodName(), exception);
                }
            }
        }
コード例 #2
0
ファイル: Connector.cs プロジェクト: NateKeefe/iCIMS
 private void clearLocals()
 {
     if (service != null)
     {
         service.Disconnect();
         service = null;
     }
 }
コード例 #3
0
        internal MetadataProvider(ConnectorService service)
        {
            methodInfo = new MethodInfo(GetType().Name);

            if (service == null || service.IsConnected == false)
            {
                throw new ApplicationException("Must connect creating Metadata Provider");
            }

            this.service = service;
        }
コード例 #4
0
ファイル: Connector.cs プロジェクト: NateKeefe/scribe-edi
        private void clearLocals()
        {
            if (metadataProvider != null)
            {
                metadataProvider.Dispose();
                metadataProvider = null;
            }

            if (service != null)
            {
                service.Disconnect();
                service = null;
            }
        }
コード例 #5
0
 protected virtual void Dispose(bool disposing)
 {
     // free managed resources
     service = null;
 }