コード例 #1
0
 private bool AddMSBuildArgTo(KArgType type, string arg, string key, string kshort = null)
 {
     if (AddArgTo(type, arg, '/' + key, kshort == null ? null : '/' + kshort))
     {
         return(true);
     }
     return(AddArgTo(type, arg, '-' + key, kshort == null ? null : '-' + kshort));
 }
コード例 #2
0
        public IEnumerable <string> GetKeys(KArgType type, bool?val = null)
        {
            if (val == null)
            {
                return(this[type]?.Select(a => a.Key));
            }

            return(this[type]?.Where(a =>
                                     (val == true && a.Value != null) || (val == false && a.Value == null)
                                     )
                   .Select(a => a.Key));
        }
コード例 #3
0
        private bool AddArgTo(KArgType type, string arg, string key, string kshort = null)
        {
            var val = ExtractKey(arg.TrimStart(), key, kshort);

            if (val == null)
            {
                return(false);
            }

            foreach (var v in SplitIfRight(val, ';'))
            {
                var kv = v.Split('=');

                if (!string.IsNullOrWhiteSpace(kv[0]))
                {
                    Data[type][kv[0]] = kv.Length > 1 ? kv[1] : null;
                }
            }
            return(true);
        }
コード例 #4
0
 public int GetCount(KArgType type) => (this[type]?.Count).GetValueOrDefault();
コード例 #5
0
 public bool Exists(KArgType type) => GetCount(type) > 0;
コード例 #6
0
 public IDictionary <string, string> this[KArgType key]
 => Data.ContainsKey(key) ? Data[key] : null;