예제 #1
0
 public Taxonomy(TaxonomyProcessor parent, string name, string single, string url, ScriptObject map) : base(parent)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (single == null)
     {
         throw new ArgumentNullException(nameof(single));
     }
     Name    = name;
     Url     = url ?? $"/{Name}/";
     Map     = map ?? new ScriptObject();
     Single  = single;
     Terms   = new DynamicObject <Taxonomy>(this, StringComparer.OrdinalIgnoreCase);
     byName  = new TaxonomyTermCollection();
     byCount = new TaxonomyTermCollection();
     SetValue("name", Name, true);
     SetValue("url", Url, true);
     SetValue("single", Single, true);
     SetValue("map", Map, true);
     SetValue("terms", Terms, true);
     Terms.SetValue("by_name", ByName, true);
     Terms.SetValue("by_count", ByCount, true);
 }
예제 #2
0
 public Taxonomy(TaxonomyProcessor parent, string name, string single) : base(parent)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (single == null)
     {
         throw new ArgumentNullException(nameof(single));
     }
     Name    = name;
     Url     = $"/{Name}/";
     Single  = single;
     Terms   = new DynamicObject <Taxonomy>(this);
     byName  = new TaxonomyTermCollection();
     byCount = new TaxonomyTermCollection();
     SetValue("name", Name, true);
     SetValue("url", Url, true);
     SetValue("single", Single, true);
     SetValue("terms", Terms, true);
     Terms.SetValue("by_name", ByName, true);
     Terms.SetValue("by_count", ByCount, true);
 }