示例#1
0
 public static void AddChild(this List <NamedChild> list, string key, FileComponent child)
 {
     if (child != null)
     {
         list.Add(new NamedChild(key, child));
     }
 }
示例#2
0
        //public List<NamedChild> GenerateChildren()
        //{
        //    var type = this.GetType();
        //    var props = from property in type.GetProperties()
        //                where Attribute.IsDefined(property, typeof(AutoStructureAttribute))
        //                orderby ((AutoStructureAttribute)property
        //                          .GetCustomAttributes(typeof(AutoStructureAttribute), false)
        //                          .Single()).Order
        //                select property;

        //    //TODO Cache props

        //    var namedChildGetters = new List<NamedChildGetter>();

        //    var result = new List<NamedChild>();
        //    foreach(var prop in Props)
        //    {
        //        if(prop.Value() is FileComponent value)
        //            result.Add(new NamedChild(prop.Name, value);
        //    }

        //    return result;
        //}

        protected void AddChildDeprecated(string key, FileComponent child)
        {
            if (child != null)
            {
                children.Add(new NamedChild(key, child));
            }
        }
示例#3
0
 protected void AddChildNew(FileComponent child)
 {
     if (child != null)
     {
         child.Parent = this;
     }
     MarkAsChanged();
 }
示例#4
0
 internal NamedChild(string name, FileComponent child)
 {
     this.Name  = name;
     this.Child = child;
 }