예제 #1
0
 private void AgentDisconnectHandler(object sernder, EventArgs args)
 {
     ((ICommunicationObject)_agent).Open();
     ((ICommunicationObject)_agent).Closed  -= AgentDisconnectHandler;
     ((ICommunicationObject)_agent).Faulted -= AgentDisconnectHandler;
     _agent = null;
 }
예제 #2
0
        private void AgentReconnectHandler(object sernder, EventArgs args)
        {
            ((ICommunicationObject)_agent).Closed  -= AgentDisconnectHandler;
            ((ICommunicationObject)_agent).Faulted -= AgentDisconnectHandler;

            _agent = CreateClient(ActiveAgent.Host);

            ((ICommunicationObject)_agent).Closed  += AgentDisconnectHandler;
            ((ICommunicationObject)_agent).Faulted += AgentReconnectHandler;
        }
예제 #3
0
        private void Connect()
        {
            if (_agent != null)
            {
                ((ICommunicationObject)_agent).Close();
            }

            _agent = CreateClient(ActiveAgent.Host);

            ((ICommunicationObject)_agent).Closed  += AgentDisconnectHandler;
            ((ICommunicationObject)_agent).Faulted += AgentReconnectHandler;

            FileSystemEntires = _agent.EnumerateEntries("\\");

            ActiveDirectory = new DirectoryEntry
            {
                Name     = "\\",
                FullName = "\\",
                Parent   = null
            };
        }