private void InitChild()
        {
            WindowFolderEntityCollection subFolders = _windowComponentService.GetFolderCollection(this.UniqueID.ToString());

            children = new FolderAddressNode[subFolders.Count];
            for (int i = 0; i < subFolders.Count; i++)
            {
                children[i] = new FolderAddressNode((WindowFolderEntity)subFolders[i], this);
            }
        }
Exemplo n.º 2
0
 public System.Collections.IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     {
         foreach (WindowFolderEntity folder in _windowComponentService.GetFolderCollection())
         {
             FolderItem item = new FolderItem(folder);
             yield return(item);
         }
         foreach (WindowEntity form in _windowComponentService.GetWindowList(String.Empty))
         {
             FormItem item = new FormItem(form, null);
             yield return(item);
         }
     }
     else
     {
         List <GlobalFormElementTreeItemBase> items  = new List <GlobalFormElementTreeItemBase>();
         GlobalFormElementTreeItemBase        parent = treePath.LastNode as GlobalFormElementTreeItemBase;
         if (parent != null)
         {
             if (parent is FolderItem)
             {
                 FolderItem         folderItem       = (FolderItem)parent;
                 WindowFolderEntity formFolderEntity = folderItem.Folder;
                 if (formFolderEntity != null)
                 {
                     foreach (WindowEntity formEntityItem in _windowComponentService.GetWindowList(formFolderEntity.Id))
                     {
                         GlobalFormElementTreeItemBase elementItem = new FormItem(formEntityItem, parent);
                         items.Add(elementItem);
                     }
                 }
             }
             WindowEntity formEntity = parent.Entity as WindowEntity;
             if (formEntity != null)
             {
                 foreach (UIElement formElementItem in  formEntity.GetFormElement())
                 {
                     if (this.AllowFormElementControlType.Allowable(formElementItem))
                     {
                         GlobalFormElementTreeItemBase elementItem = new FormElementItem(formElementItem, parent);
                         items.Add(elementItem);
                     }
                     else
                     {
                         foreach (UIElement innerElement in formElementItem.GetInnerElement())
                         {
                             if (this.AllowFormElementControlType.Allowable(innerElement))
                             {
                                 GlobalFormElementTreeItemBase elementItem = new FormElementItem(formElementItem, parent);
                                 items.Add(elementItem);
                                 break;
                             }
                         }
                     }
                 }
             }
             UIElement formElement = parent.Entity as UIElement;
             if (formElement != null)
             {
                 foreach (UIElement formElementItem in formElement.GetInnerElement())
                 {
                     if (this.AllowFormElementControlType.Allowable(formElementItem) == false)
                     {
                         continue;
                     }
                     GlobalFormElementTreeItemBase elementItem = new FormElementItem(formElementItem, parent);
                     items.Add(elementItem);
                 }
             }
             foreach (GlobalFormElementTreeItemBase item in items)
             {
                 yield return(item);
             }
         }
         else
         {
             yield break;
         }
     }
 }