Beispiel #1
0
 public Arg(string name, string helpText, ValidatorDelegate validator)
 {
     this.name      = name;
     this.flag      = ' ';
     this.type      = Type.SINGLE;
     this.helpText  = helpText;
     this.validator = validator;
 }
 public Entry(string name, MenuItemDelegate onCreate, ValidatorDelegate isActive, Entry parent, int priority, Type createdType = null)
 {
     Text        = name;
     Create      = onCreate;
     IsActive    = isActive;
     IsExpanded  = true;
     IsFolder    = false;
     Children    = null;
     IsShown     = true;
     IndentLevel = parent?.IndentLevel + 1 ?? 0;
     Priority    = priority;
     CreatedType = createdType;
 }
Beispiel #3
0
 public OptionalArg(string name,
                    char flag,
                    string helpText,
                    string defaultValue,
                    Type type,
                    ValidatorDelegate validator,
                    string[] conflicts,
                    string[] overrides)
     : base(name, helpText, validator)
 {
     this.flag         = flag;
     this.defaultValue = defaultValue;
     this.type         = type;
     this.conflicts    = conflicts;
     this.overrides    = overrides;
     wasParsed         = false;
 }
Beispiel #4
0
        public static void registerSetting(string file, string name, object defaultValue, ValidatorDelegate validator, SaveFormatDelegate saveFormat)
        {
            INIFile f;
            setting v = new setting();

            if (!Directory.Exists(SettingsDirectory()))
            {
                Directory.CreateDirectory(SettingsDirectory());
            }

            string[] taxonomy = name.Split(".".ToCharArray(), 2);

            //Debug.Assert(taxonomy.Length == 2, "Taxonomy must include at least one dot character [.]");

            v.name     = name;
            v.fileName = file;

            v.validate   = validator;
            v.saveFormat = saveFormat;

            v.defaultValue = defaultValue;

            f             = new INIFile(SettingsDirectory() + v.fileName + configSuffix);
            v.actualValue = validator(f.ReadValue(taxonomy[0], taxonomy[1], saveFormat(defaultValue)));

            settings.Add(name, v);
        }
Beispiel #5
0
 public PositionalArg(string name, string helpText, ValidatorDelegate validator)
     : base(name, helpText, validator)
 {
 }
 public GeneratorManager(Recomposable<ILogger> logger, ValidatorDelegate<IGenerator> generatorValidator)
 {
     _recompLogger = logger;
     _generatorValidator = generatorValidator;
 }