示例#1
0
        private static void Initialize(string[] args)
        {
            if (args.Count() != 2)
            {
                Console.WriteLine("Usage: h-opc-cli [Type] [serverurl]");
                Console.WriteLine("Supported types: " + GetSupportedTypes());
                return;
            }
            SupportedTypes type;

            try
            {
                type = GetOpcType(args[0]);
            }
            catch (ArgumentException)
            {
                Console.WriteLine(args[0] + " is not a supported type");
                Console.WriteLine("Supported types: " + GetSupportedTypes());
                return;
            }
            IClient <Node> client;

            try
            {
                client = GetClient(args[1], type);
                client.Connect();
            }
            catch (Exception)
            {
                Console.WriteLine("An error occured when trying connecting to the server");
                throw;
            }
            var repl = new Repl(client);

            repl.Start();
        }
示例#2
0
文件: Program.cs 项目: pilhokim/h-opc
 private static void Initialize(string[] args)
 {
     if (args.Count() != 2)
       {
     Console.WriteLine("Usage: h-opc-cli [Type] [serverurl]");
     Console.WriteLine("Supported types: " + GetSupportedTypes());
     return;
       }
       SupportedTypes type;
       try
       {
     type = GetOpcType(args[0]);
       }
       catch (ArgumentException)
       {
     Console.WriteLine(args[0] + " is not a supported type");
     Console.WriteLine("Supported types: " + GetSupportedTypes());
     return;
       }
       IClient<Node> client;
       try
       {
     client = GetClient(args[1], type);
     client.Connect();
       }
       catch (Exception)
       {
     Console.WriteLine("An error occured when trying connecting to the server");
     throw;
       }
       var repl = new Repl(client);
       repl.Start();
 }