Ejemplo n.º 1
0
 private void AgentDisconnectHandler(object sernder, EventArgs args)
 {
     ((ICommunicationObject)_agent).Open();
     ((ICommunicationObject)_agent).Closed  -= AgentDisconnectHandler;
     ((ICommunicationObject)_agent).Faulted -= AgentDisconnectHandler;
     _agent = null;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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
            };
        }