示例#1
0
        public void Dispose()
        {
            //Check the server connections and close if needed.
            if (_SmartObjectClient != null)
            {
                _SmartObjectClient.CloseConnection();
                
                _SmartObjectClient = null;
            }

            //Check the server connections and close if needed.
            if (_WorkflowServer != null)
            {
                if (_WorkflowServer.Connection.IsConnected) _WorkflowServer.Connection.Close();
                _WorkflowServer = null;
            }

            //Check the server connections and close if needed.
            if (_WorkflowClient != null)
            {
                if (_WorkflowClient.connection != null) _WorkflowClient.CloseConnection();
                _WorkflowClient.Dispose();
                _WorkflowClient = null;
            }
        }
示例#2
0
 /// <summary>
 /// Workflow Client
 /// </summary>
 /// <returns>Workflow Client</returns>
 public K2WorkflowClient WorkflowClient()
 {
     if (_WorkflowClient == null)
     {
         _WorkflowClient = new K2WorkflowClient(_K2Server, _WorkflowClientPort, _SecurityLabelName);
         return _WorkflowClient;
     }
     else
     {
         return _WorkflowClient;
     }
 }