Exemplo n.º 1
0
 private ConsoleApplicationHandler PrepareCall(string command, string args, int timeout)
 {
     if ((command == "fetch" || command == "push" || command == "clone") && !string.IsNullOrWhiteSpace(RemoteUrl) && RemoteUrl.StartsWith("http"))
     {
         if (!IsRemoteAccessible())
         {
             if (null != OnNotConnected)
             {
                 OnNotConnected.Invoke();
             }
             if (!NoErrorOnNotConnected)
             {
                 throw new Exception("Cannot perform " + command + " because remote url " + RemoteUrl + " is not accessible");
             }
             return(ConsoleApplicationHandler.Null);
         }
     }
     return(new ConsoleApplicationHandler {
         ExePath = "git",
         WorkingDirectory = DirectoryName ?? Environment.CurrentDirectory,
         Arguments = command + " " + args,
         NoWindow = true,
         Timeout = timeout
     });
 }
Exemplo n.º 2
0
        private void LoopConnect(object o)
        {
            if (PingIpOrDomainName() == false)
            {
                OnNotConnected?.BeginInvoke(null, null);
                //Dispose();
            }

            if (IsConnectInternet() == false)
            {
                OnNotConnected?.BeginInvoke(null, null);
                //Dispose();
            }
        }