protected override void BeginVisit(IGroupListCatalogs cn)
 {
     if (cn is INodeGenSettings)
     {
         _act(cn as INodeGenSettings);
     }
 }
        //protected override void BeginVisit(IGroupDocuments cn)
        //{
        //}
        protected override void EndVisit(IGroupListCatalogs cn)
        {
            var p = (GroupListCatalogs)cn;

            foreach (var t in p.ListCatalogs)
            {
                t.IsMarkedForDeletion = false;
                t.IsNew = false;
            }
        }
Пример #3
0
        //protected override void BeginVisit(IGroupDocuments cn)
        //{
        //}
        protected override void EndVisit(IGroupListCatalogs cn)
        {
            var p = (GroupListCatalogs)cn;

            if (p.IsHasMarkedForDeletion && p.IsHasNew)
            {
                var lst = p.ListCatalogs.ToList();
                foreach (var t in lst)
                {
                    if (t.IsMarkedForDeletion && t.IsNew)
                    {
                        p.ListCatalogs.Remove(t);
                    }
                }
            }
        }
Пример #4
0
 protected virtual void Visit(IGroupListCatalogs cn)
 {
 }
Пример #5
0
 private static void ValidateSpecialProperties(string name, ValidationContext <Property> cntx, Property p, Catalog c, IGroupListCatalogs gc)
 {
     if (c.GetUseCodeProperty())
     {
         if (gc.PropertyCodeName == name)
         {
             var vf = new ValidationFailure(nameof(p.Name),
                                            $"Catalog parameter 'UseCodeProperty' is set to 'true'. Property name '{gc.PropertyCodeName}' is reserved for auto generated property");
             vf.Severity = Severity.Error;
             cntx.AddFailure(vf);
         }
     }
     if (c.GetUseNameProperty())
     {
         if (gc.PropertyNameName == name)
         {
             var vf = new ValidationFailure(nameof(p.Name),
                                            $"Catalog parameter 'UseNameProperty' is set to 'true'. Property name '{gc.PropertyNameName}' is reserved for auto generated property");
             vf.Severity = Severity.Error;
             cntx.AddFailure(vf);
         }
     }
     if (c.GetUseDescriptionProperty())
     {
         if (gc.PropertyDescriptionName == name)
         {
             var vf = new ValidationFailure(nameof(p.Name),
                                            $"Catalog parameter 'UseDescriptionProperty' is set to 'true'. Property name '{gc.PropertyDescriptionName}' is reserved for auto generated property");
             vf.Severity = Severity.Error;
             cntx.AddFailure(vf);
         }
     }
 }