/// <summary>Initializes a new instance of TemplateInputComponentBase class.</summary>
 protected TemplateInputComponentBase(ComponentType type, object obj, string name, ITemplateInputComponent parent)
 {
     this.Type = type;
     this.Instance = obj;
     this.Class = obj.GetType();
     this.Name = name ?? this.Class.Name;
     this.Parent = parent;
     this.Root = (parent != null) ? parent.Root : this;
 }
Esempio n. 2
0
 private SpComponent(ComponentType type, object obj, string name, ITemplateInputComponent parent)
     : base(type, obj, name, parent)
 {
 }
        /// <summary>Checks whether the current object has of the specified type matching specified criteria.</summary>
        public bool ExistsChild(ComponentType type, params Predicate<ITemplateInputComponent>[] criteria)
        {
            EnsureSubcomponents();
            if (ArrayUtil.IsNullOrEmpty(criteria))
                return ExistsChild(type);

            foreach (ITemplateInputComponent component in this.Subcomponents)
            {
                if ((component.Type == type) && Template.MatchesCriteria(component, criteria))
                    return true;
            }

            return false;
        }
 /// <summary>Checks whether the current object has subcomponents of the specified type.</summary>
 public bool ExistsChild(ComponentType type)
 {
     EnsureSubcomponents();
     return ArrayUtil.Exists<ITemplateInputComponent>(GetChildren(), (comp) => (comp.Type == type));
 }
 /// <summary>Gets all subcomponents of the specified type matching specified criteria and which belong to the specified range.</summary>
 public IEnumerable<ITemplateInputComponent> GetChildren(ComponentType type, int startAt, int maxCount, params Predicate<ITemplateInputComponent>[] criteria)
 {
     var allMatches = Template.GetMatchingComponents(GetChildren(type), criteria);
     return ArrayUtil.GetRange<ITemplateInputComponent>(allMatches, startAt, maxCount);
 }
 /// <summary>Gets all subcomponents of the specified type matching specified criteria.</summary>
 public IEnumerable<ITemplateInputComponent> GetChildren(ComponentType type, params Predicate<ITemplateInputComponent>[] criteria)
 {
     return Template.GetMatchingComponents(GetChildren(type), criteria);
 }
 /// <summary>Gets all subcomponents of the specified type and belong to the specified range.</summary>
 public IEnumerable<ITemplateInputComponent> GetChildren(ComponentType type, int startAt, int maxCount)
 {
     var allMatches = ArrayUtil.FindAll<List<ITemplateInputComponent>, ITemplateInputComponent>(GetChildren(), (comp) => (comp.Type == type));
     return ArrayUtil.GetRange<ITemplateInputComponent>(allMatches, startAt, maxCount);
 }
 /// <summary>Gets all subcomponents of the specified type.</summary>
 public IEnumerable<ITemplateInputComponent> GetChildren(ComponentType type)
 {
     return ArrayUtil.FindAll<List<ITemplateInputComponent>, ITemplateInputComponent>(GetChildren(), (comp) => (comp.Type == type));
 }