Esempio n. 1
0
 public void VisitTabs(string appGenGuig, EnumVisitType typeOp, ITreeConfigNode p, Action <IReadOnlyList <TableInfo> > action)
 {
     if (p is IPropertiesTab)
     {
         this.VisitTabs(appGenGuig, p as IPropertiesTab, action, typeOp);
     }
     else if (p is ICatalog)
     {
         this.VisitTabs(appGenGuig, p as ICatalog, action, typeOp);
     }
     else if (p is ICatalogFolder)
     {
         this.VisitTabs(appGenGuig, p as ICatalogFolder, action, typeOp);
     }
     else if (p is IDocument)
     {
         this.VisitTabs(appGenGuig, p as IDocument, action, typeOp);
     }
     else if (p is IGroupListConstants)
     {
     }
     else
     {
         throw new ArgumentException();
     }
 }
Esempio n. 2
0
        private void VisitTabs(string appGenGuig, ICatalog p, Action <List <TableInfo> > action, EnumVisitType typeOp, List <TableInfo> lst = null)
        {
            if (lst == null)
            {
                lst = new List <TableInfo>();
            }
            var lstt = p.GetIncludedPropertiesTabs(appGenGuig);

            if (lstt.Count == 0)
            {
                return;
            }
            TabsRecursive(appGenGuig, lstt, action, typeOp, lst);
        }
Esempio n. 3
0
 private void TabsRecursive(string appGenGuig, IReadOnlyList <IPropertiesTab> lstt, Action <List <TableInfo> > action, EnumVisitType typeOp, List <TableInfo> lst)
 {
     foreach (var t in lstt)
     {
         var ti = new TableInfo()
         {
             Node        = t,
             List        = t.GetIncludedProperties(appGenGuig),
             ClassName   = t.Name,
             TableName   = t.CompositeName,
             TableParent = (t.Parent.Parent as ICompositeName).CompositeName
         };
         if (typeOp == EnumVisitType.Load) // from current to top
         {
             lst.Add(ti);
             List <TableInfo> lstReverse = new List <TableInfo>();
             for (int i = lst.Count - 1; i > -1; i--)
             {
                 lstReverse.Add(lst[i]);
             }
             if (lstReverse.Count > 0)
             {
                 action(lstReverse);
             }
             var lstt2 = t.GetIncludedPropertiesTabs(appGenGuig);
             TabsRecursive(appGenGuig, lstt2, action, typeOp, lst);
             lst.Remove(ti);
         }
         else if (typeOp == EnumVisitType.Remove)
         {
             lst.Add(ti);
             List <TableInfo> lstReverse = new List <TableInfo>();
             for (int i = lst.Count - 1; i > -1; i--)
             {
                 lstReverse.Add(lst[i]);
             }
             var lstt2 = t.GetIncludedPropertiesTabs(appGenGuig);
             TabsRecursive(appGenGuig, lstt2, action, typeOp, lst);
             if (lstReverse.Count > 0)
             {
                 action(lstReverse);
             }
             lst.Remove(ti);
         }
         else
         {
             throw new NotImplementedException();
         }
     }
 }