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)); }
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)); }
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); }
public int GetCount(KArgType type) => (this[type]?.Count).GetValueOrDefault();
public bool Exists(KArgType type) => GetCount(type) > 0;
public IDictionary <string, string> this[KArgType key] => Data.ContainsKey(key) ? Data[key] : null;