예제 #1
0
        static async Task Main(string[] args)
        {
            if (args.Length < 1)
            {
                ShowUsage();
                return;
            }

            var path = args[0];
            var cmd  = args[1];

            IConnectionService connectionService = new ConnectionService();
            await connectionService.LoadDatabase(@".\WINCC", path);

            switch (cmd)
            {
            case "list":
            {
                ConsoleTable
                .From(connectionService.Connections)
                .Write(Format.Alternative);

                break;
            }

            case "set":
            {
                if (args.Length < 4)
                {
                    ShowUsage();
                    return;
                }

                var connectionName = args[2];
                var parameter      = args[3];
                await SetConnectionParameter(connectionService, connectionName, parameter);

                break;
            }
            }

            connectionService.CloseDatabase();
        }