Ejemplo 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());
 }
Ejemplo n.º 2
0
 public static bool TryParse(String s, out Classifiers c)
 {
     try {
         c = Parse(s);
         return true;
     } catch (Exception) {
         c = null;
         return false;
     }
 }
Ejemplo 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));
 }
Ejemplo n.º 4
0
 public static Classifiers Parse(Classifiers existing,String s)
 {
     var dict = ParseIntoDict(s);
     existing.SetAll(dict);
     return existing;
 }
Ejemplo n.º 5
0
 public new NewModule Classifiers(Classifiers c)
 {
     base.Classifiers = c;
     return this;
 }
Ejemplo n.º 6
0
 public static IMatcher<Classifiers> EqualTo(Classifiers expect)
 {
     return EqualTo(expect==null?null:expect.ToString());
 }
Ejemplo n.º 7
0
 public new NewDependency Classifiers(Classifiers c)
 {
     base.Classifiers = c;
     return this;
 }