示例#1
0
 private void VisitPropertiesTabs(IGroupListPropertiesTabs parent, List <IPropertiesTab> lst)
 {
     this.Visit(parent, lst);
     foreach (var t in lst)
     {
         this.Visit(t);
         if (t.IsDeleted())
         {
             continue;
         }
         this.currPropTabStack.Push(t);
         if (_act != null)
         {
             _act(this, t);
         }
         this.VisitProperties(t.GroupProperties, new DiffLists <IProperty>(
                                  t.GroupProperties.ListProperties,
                                  ((IPropertiesTab)t[DiffEnumHistoryAnnotation.PrevVersion.ToString()])?.GroupProperties.ListProperties,
                                  ((IPropertiesTab)t[DiffEnumHistoryAnnotation.OldVersion.ToString()])?.GroupProperties.ListProperties
                                  ).ListAll);
         this.VisitPropertiesTabs(t.GroupPropertiesTabs, new DiffLists <IPropertiesTab>(
                                      t.GroupPropertiesTabs.ListPropertiesTabs,
                                      ((IPropertiesTab)t[DiffEnumHistoryAnnotation.PrevVersion.ToString()])?.GroupPropertiesTabs.ListPropertiesTabs,
                                      ((IPropertiesTab)t[DiffEnumHistoryAnnotation.OldVersion.ToString()])?.GroupPropertiesTabs.ListPropertiesTabs
                                      ).ListAll);
         this.currPropTabStack.Pop();
     }
 }
 protected override void BeginVisit(IGroupListPropertiesTabs t)
 {
     if (t is INodeGenSettings)
     {
         _act(t as INodeGenSettings);
     }
 }
 private void ScanPropertiesTabs(ModelNode md, IGroupListPropertiesTabs t)
 {
     foreach (var tt in t.ListPropertiesTabs)
     {
         ScanProperties(md, tt.GroupProperties.ListProperties);
         ScanPropertiesTabs(md, tt.GroupPropertiesTabs);
     }
 }
        protected override void EndVisit(IGroupListPropertiesTabs cn)
        {
            var p = (GroupListPropertiesTabs)cn;

            foreach (var t in p.ListPropertiesTabs)
            {
                t.IsMarkedForDeletion = false;
                t.IsNew = false;
            }
        }
示例#5
0
        protected override void Visit(IGroupListPropertiesTabs parent, List <IPropertiesTab> diff_lst)
        {
            Contract.Requires(diff_lst != null);
            Contract.Requires(parent != null);
            List <PropertiesTab> lst = new List <PropertiesTab>();

            foreach (var t in diff_lst)
            {
                lst.Add((PropertiesTab)t);
            }
            var grp = (GroupListPropertiesTabs)parent;

            grp.ListPropertiesTabs.Clear();
            grp.ListPropertiesTabs.AddRange(lst);
        }
示例#6
0
        protected override void EndVisit(IGroupListPropertiesTabs cn)
        {
            var p = (GroupListPropertiesTabs)cn;

            if (p.IsHasMarkedForDeletion && p.IsHasNew)
            {
                var lst = p.ListPropertiesTabs.ToList();
                foreach (var t in lst)
                {
                    if (t.IsMarkedForDeletion && t.IsNew)
                    {
                        p.ListPropertiesTabs.Remove(t);
                    }
                }
            }
        }
示例#7
0
 private void VisitPropertiesTabs(IGroupListPropertiesTabs parent, IEnumerable <IPropertiesTab> lst)
 {
     this.BeginVisit(parent);
     if (_act != null)
     {
         _act(this, parent);
     }
     foreach (var t in lst)
     {
         this.BeginVisit(t);
         //if (t.IsDeleted())
         //    continue;
         this.currPropTabStack.Push(t);
         if (_act != null)
         {
             _act(this, t);
         }
         this.VisitProperties(t.GroupProperties, t.GroupProperties.ListProperties);
         this.VisitPropertiesTabs(t.GroupPropertiesTabs, t.GroupPropertiesTabs.ListPropertiesTabs);
         this.currPropTabStack.Pop();
         this.EndVisit(t);
     }
     this.EndVisit(parent);
 }
 private static void CheckTabs(ValidationContext <Model> cntx, Dictionary <string, ITreeConfigNode> dic, IGroupListPropertiesTabs tabs, string recom)
 {
     foreach (var t in tabs.ListPropertiesTabs)
     {
         if (string.IsNullOrWhiteSpace(t.CompositeName))
         {
             continue;
         }
         if (dic.ContainsKey(t.CompositeName))
         {
             var sb = GenMessage(dic, t, t.CompositeName);
             sb.Append("'.");
             sb.Append(recom);
             cntx.AddFailure(sb.ToString());
         }
         else
         {
             dic[t.CompositeName] = t;
         }
         CheckTabs(cntx, dic, t.GroupPropertiesTabs, recom);
     }
 }
示例#9
0
 protected virtual void Visit(IGroupListPropertiesTabs parent, List <IPropertiesTab> diff_lst)
 {
 }
示例#10
0
 protected virtual void EndVisit(IGroupListPropertiesTabs cn)
 {
 }