Esempio n. 1
0
 public static Key FromGroupNameClassifiers(string group, string name, Classifiers classifiers)
 {
     return new Key(String.Format("{0}:{1}:{2}"
         , group
         , name
         , classifiers.ToString()
     ).ToLower());
 }
Esempio n. 2
0
 public static bool TryParse(String s, out Classifiers c)
 {
     try {
         c = Parse(s);
         return true;
     } catch (Exception) {
         c = null;
         return false;
     }
 }
Esempio n. 3
0
 public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue,
     JsonSerializer serializer)
 {
     var classifier = existingValue as Classifiers;
     if (classifier == null) {
         classifier = new Classifiers();
     }
     if (reader.TokenType == JsonToken.String) {
         var val = (String)reader.Value;
         return Classifiers.Parse(classifier, val);
     }
     if (reader.TokenType == JsonToken.StartObject) {
         var dict = DictConverter.ReadJson(reader, typeof(IDictionary<String, String>), existingValue, serializer);
         classifier.SetAll(dict as IDictionary<String, String>);
         return classifier;
     }
     throw new Exception(String.Format("Unexpected token parsing classifiers. Expected String, got {0}.", reader.TokenType));
 }
Esempio n. 4
0
 public static Classifiers Parse(Classifiers existing,String s)
 {
     var dict = ParseIntoDict(s);
     existing.SetAll(dict);
     return existing;
 }
Esempio n. 5
0
 public new NewModule Classifiers(Classifiers c)
 {
     base.Classifiers = c;
     return this;
 }
Esempio n. 6
0
 public static IMatcher<Classifiers> EqualTo(Classifiers expect)
 {
     return EqualTo(expect==null?null:expect.ToString());
 }
Esempio n. 7
0
 public new NewDependency Classifiers(Classifiers c)
 {
     base.Classifiers = c;
     return this;
 }