Beispiel #1
0
        public void AddProxy(string name, ProxyDefinition proxyDefinition)
        {
            var proxyFile = new ProxyFile(ProxyFilePath);

            proxyFile.AddProxy(name, proxyDefinition);
            proxyFile.Commit();
        }
Beispiel #2
0
 public void AddProxy(string name, ProxyDefinition proxyDefinition)
 {
     if (Proxies.ContainsKey(name))
     {
         var response = "n";
         do
         {
             ColoredConsole.Write($"A proxy with the name {name} already exists. Overwrite [y/n]? [n] ");
             response = Console.ReadLine();
         } while (response != "n" && response != "y");
         if (response == "n")
         {
             return;
         }
         Proxies[name] = proxyDefinition;
     }
     else
     {
         Proxies.Add(name, proxyDefinition);
     }
 }