예제 #1
0
 private bool isConnected()
 {
     try
     {
         if (_client != null && _client.IsConnected)
         {
             return(true);
         }
         var instance = GetInstance();
         if (instance == null)
         {
             return(false);
         }
         _client = new OpenIDE.Core.EditorEngineIntegration.Client();
         _client.Connect(instance.Port, (m) => _handler(m));
         if (_client.IsConnected)
         {
             return(true);
         }
         _client = null;
         return(false);
     }
     catch
     {
         return(false);
     }
 }
예제 #2
0
 private bool isConnected()
 {
     try
     {
         if (_client != null && _client.IsConnected)
         {
             return(true);
         }
         var instance = GetInstance();
         if (instance == null)
         {
             return(false);
         }
         _client = new OpenIDE.Core.EditorEngineIntegration.Client();
         _client.Connect(instance.Port, (m) => {
             var publisherStart = m.IndexOf("|");
             var publisher      = m.Substring(0, publisherStart);
             var message        = m.Substring(publisherStart + 1, m.Length - (publisherStart + 1));
             _handler(publisher, message);
         });
         if (_client.IsConnected)
         {
             return(true);
         }
         _client = null;
         return(false);
     }
     catch
     {
         return(false);
     }
 }
예제 #3
0
 private bool trySend(Instance info, string message)
 {
     var client = new OpenIDE.Core.EditorEngineIntegration.Client();
     client.Connect(info.Port, (s) => {});
     var connected = client.IsConnected;
     if (connected)
         client.SendAndWait(message);
     client.Disconnect();
     if (!connected)
         File.Delete(info.File);
     return connected;
 }
예제 #4
0
 private bool trySend(Instance info, string message)
 {
     var client = new OpenIDE.Core.EditorEngineIntegration.Client();
     client.Connect(info.Port, (s) => {});
     var connected = client.IsConnected;
     if (connected) {
         Logger.Write("Dispatching event");
         client.SendAndWait(message);
     } else {
         Logger.Write("Could not connect to event endpoint");
     }
     client.Disconnect();
     if (!connected)
         File.Delete(info.File);
     return connected;
 }
예제 #5
0
        private bool canConnectTo(Instance info)
        {
            var client = new OpenIDE.Core.EditorEngineIntegration.Client();

            client.Connect(info.Port, (s) => {});
            var connected = client.IsConnected;

            client.Disconnect();
            if (!connected)
            {
                try {
                    Process.GetProcessById(info.ProcessID);
                } catch {
                    File.Delete(info.File);
                }
            }
            return(connected);
        }
 private bool isConnected()
 {
     try
     {
         if (_client != null && _client.IsConnected)
             return true;
         var instance = GetInstance();
         if (instance == null)
             return false;
         _client = new OpenIDE.Core.EditorEngineIntegration.Client();
         _client.Connect(instance.Port, (m) => _handler(m));
         if (_client.IsConnected)
             return true;
         _client = null;
         return false;
     }
     catch
     {
         return false;
     }
 }
예제 #7
0
        private bool trySend(Instance info, string message)
        {
            var client = new OpenIDE.Core.EditorEngineIntegration.Client();

            client.Connect(info.Port, (s) => {});
            var connected = client.IsConnected;

            if (connected)
            {
                Logger.Write("Dispatching event");
                client.SendAndWait(message);
            }
            else
            {
                Logger.Write("Could not connect to event endpoint");
            }
            client.Disconnect();
            if (!connected)
            {
                File.Delete(info.File);
            }
            return(connected);
        }
 private bool canConnectTo(Instance info)
 {
     var client = new OpenIDE.Core.EditorEngineIntegration.Client();
     client.Connect(info.Port, (s) => {});
     var connected = client.IsConnected;
     client.Disconnect();
     if (!connected) {
         try {
             Process.GetProcessById(info.ProcessID);
         } catch {
             File.Delete(info.File);
         }
     }
     return connected;
 }
 private bool isConnected()
 {
     try
     {
         if (_client != null && _client.IsConnected)
             return true;
         var instance = GetInstance();
         if (instance == null)
             return false;
         _client = new OpenIDE.Core.EditorEngineIntegration.Client();
         _client.Connect(instance.Port, (m) => {
             var publisherStart = m.IndexOf("|");
             var publisher = m.Substring(0, publisherStart);
             var message = m.Substring(publisherStart + 1, m.Length - (publisherStart+1));
             _handler(publisher, message);
         });
         if (_client.IsConnected)
             return true;
         _client = null;
         return false;
     }
     catch
     {
         return false;
     }
 }