Beispiel #1
0
        private void RemoveServer(object sender, RoutedEventArgs e)
        {
            Button B = sender as Button;

            if (B == null)
            {
                return;
            }

            ServerChoice C     = B.DataContext as ServerChoice;
            XParameter   Param = new XParameter(C.Name);

            Param.SetValue(new XKey("disabled", true));
            ServerReg.SetParameter(Param);
            ServerReg.Save();

            RefreshServers();
        }
Beispiel #2
0
 internal void Parse(List <string> args)
 {
     for (var i = 0; i < args.Count; i++)
     {
         if (args[i].StartsWith("--pipe="))
         {
             pipe      = args[i].Substring(args[i].IndexOf("=") + 1);
             transport = TransportChoice.NamedPipe;
         }
         else if (args[i].StartsWith("--port="))
         {
             port = int.Parse(args[i].Substring(args[i].IndexOf("=") + 1));
             if (transport != TransportChoice.TlsSocket)
             {
                 transport = TransportChoice.Socket;
             }
         }
         else if (args[i] == "-b" || args[i] == "--buffered" || args[i] == "--transport=buffered")
         {
             buffering = BufferChoice.Buffered;
         }
         else if (args[i] == "-f" || args[i] == "--framed" || args[i] == "--transport=framed")
         {
             buffering = BufferChoice.Framed;
         }
         else if (args[i] == "--binary" || args[i] == "--protocol=binary")
         {
             protocol = ProtocolChoice.Binary;
         }
         else if (args[i] == "--compact" || args[i] == "--protocol=compact")
         {
             protocol = ProtocolChoice.Compact;
         }
         else if (args[i] == "--json" || args[i] == "--protocol=json")
         {
             protocol = ProtocolChoice.Json;
         }
         else if (args[i] == "--server-type=simple")
         {
             server = ServerChoice.Simple;
         }
         else if (args[i] == "--threaded" || args[i] == "--server-type=threaded")
         {
             throw new NotImplementedException(args[i]);
         }
         else if (args[i] == "--threadpool" || args[i] == "--server-type=threadpool")
         {
             server = ServerChoice.ThreadPool;
         }
         else if (args[i] == "--prototype" || args[i] == "--processor=prototype")
         {
             throw new NotImplementedException(args[i]);
         }
         else if (args[i] == "--ssl")
         {
             transport = TransportChoice.TlsSocket;
         }
         else if (args[i] == "--help")
         {
             PrintOptionsHelp();
             return;
         }
         else
         {
             Console.WriteLine("Invalid argument: {0}", args[i]);
             PrintOptionsHelp();
             return;
         }
     }
 }