Ejemplo n.º 1
0
        private static void Start(StringDictionary args)
        {
            if (!args.ContainsKey("debug"))
            {
                throw new ArgumentException("Missing argument `debug`.");
            }
            if (!args.ContainsKey("ipcguid"))
            {
                throw new ArgumentException("Missing argument `ipcguid`.");
            }
            if (!args.ContainsKey("parentpid"))
            {
                throw new ArgumentException("Missing argument `parentpid`.");
            }

            DebugMode debugMode;

            if (!DebugMode.TryParse(args["debug"], out debugMode))
            {
                throw new ArgumentException("Invalid value of `debug`: " + args["debug"]);
            }

            int parentPid;

            if (!int.TryParse(args["parentpid"], out parentPid))
            {
                throw new ArgumentException("Invalid value of `parentpid`: " + args["parentpid"]);
            }

            Start(debugMode, args["ipcguid"], parentPid);
        }