예제 #1
0
        public DroneEnv(DroneConfig config, DroneFlags flags)
        {
            if(config == null)
                throw new ArgumentNullException("config");

            if(flags == null)
                throw new ArgumentNullException("flags");

            this.Config = config;
            this.Flags = flags;
        }
예제 #2
0
        private void InitCommand(ParameterTokenSet tokens, DroneFlags flags)
        {
            if (File.Exists(flags.ConfigFileName))
            {
                this.log.Warn("file '{0}' already exists", flags.ConfigFileName);
                return;
            }

            var config = new DroneConfig();
            config.SetConfigFilename(flags.ConfigFileName);

            this.droneService.InitDroneDir(config);

            this.droneService.SaveConfig(config);

            this.log.Info("created '{0}'", Path.GetFileName(config.DroneDirPath));
            this.log.Info("created '{0}'", Path.GetFileName(config.FilePath));
        }