Esempio n. 1
0
 /// <summary>
 /// gets component with name from a root node
 /// </summary>
 /// <param name="name"></param>
 /// <param name="component"></param>
 /// <returns>return compont</returns>
 public IComponentContainer GetComponent(string name, IComponentContainer component)
 {
     if (component.Name == name)
     {
         return(component);
     }
     if (component is ComponentContainerGroup)
     {
         ComponentContainerGroup group = (ComponentContainerGroup)component;
         foreach (IComponentContainer container in group.Components)
         {
             IComponentContainer found = GetComponent(name, container);
             if (found != null)
             {
                 return(found);
             }
         }
     }
     return(null);
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">name of the view</param>
 /// <param name="displayname">displayname of the view</param>
 public View(string name, string displayname)
 {
     this.Name          = name;
     this.DisplayName   = displayname;
     this.RootComponent = new ComponentContainerGroup("Root");
 }