Пример #1
0
        protected bool ValidateOrReplaceViewSite(ref ViewSite viewSite, WindowProfileValidationContext context)
        {
            if (viewSite.Parent != null)
            {
                return(false);
            }
            FloatSite floatSite = viewSite as FloatSite;

            if (floatSite != null)
            {
                if (floatSite.Children.Count == 0)
                {
                    return(false);
                }
                bool flag = this.ValidateOrReplaceFloatSite(ref floatSite, context);
                viewSite = (ViewSite)floatSite;
                return(flag);
            }
            MainSite mainSite = viewSite as MainSite;

            if (mainSite == null)
            {
                return(this.ValidateOrReplaceCustomViewSite(ref viewSite, context));
            }
            context.MainSites.Add(mainSite);
            bool flag1 = this.ValidateOrReplaceMainSite(ref mainSite, context);

            viewSite = (ViewSite)mainSite;
            return(flag1);
        }
Пример #2
0
        protected bool ValidateOrReplaceViewElement(ref ViewElement element, WindowProfileValidationContext context)
        {
            this.ValidateOrReplaceViewElementSizes(element);
            this.ValidateOrReplaceViewElementPosition(element);
            View view = element as View;

            if (view != null)
            {
                bool flag = this.ValidateOrReplaceView(ref view, context);
                element = (ViewElement)view;
                return(flag);
            }
            ViewGroup viewGroup = element as ViewGroup;

            if (viewGroup != null)
            {
                bool flag = this.ValidateOrReplaceViewGroup(ref viewGroup, context);
                element = (ViewElement)viewGroup;
                return(flag);
            }
            ViewBookmark viewBookmark = element as ViewBookmark;

            if (viewBookmark == null)
            {
                return(this.ValidateOrReplaceCustomViewElement(ref element, context));
            }
            bool flag1 = this.ValidateOrReplaceViewBookmark(ref viewBookmark, context);

            element = (ViewElement)viewBookmark;
            return(flag1);
        }
Пример #3
0
        public virtual bool Validate(WindowProfile profile)
        {
            WindowProfileValidationContext validationContext = this.CreateValidationContext();

            if (!this.ValidateOrReplaceViewElementCollection(profile.Children, validationContext))
            {
                return(false);
            }
            this.PostValidation(profile, validationContext);
            return(true);
        }
Пример #4
0
 protected override bool ValidateOrReplaceView(ref View view, WindowProfileValidationContext context)
 {
     if (!(view is ExpressionView))
     {
         View view1 = ViewElementFactory.Current.CreateView(typeof(ExpressionView));
         if (view1 == null || !(view1 is ExpressionView))
         {
             return(false);
         }
         this.CopyViewProperties(view, view1);
         view = view1;
     }
     return(true);
 }
Пример #5
0
 protected override bool ValidateOrReplaceDockRoot(ref DockRoot dockRoot, WindowProfileValidationContext context)
 {
     if (!(dockRoot is ExpressionDockRoot))
     {
         DockRoot dockRoot1 = ViewElementFactory.Current.CreateDockRoot();
         if (dockRoot1 == null || !(dockRoot1 is ExpressionDockRoot))
         {
             return(false);
         }
         this.CopyDockRootProperties(dockRoot, dockRoot1);
         dockRoot = dockRoot1;
     }
     return(true);
 }
Пример #6
0
 protected override bool ValidateOrReplaceDockGroup(ref DockGroup dockGroup, WindowProfileValidationContext context)
 {
     if (!(dockGroup is ExpressionDockGroup) && typeof(DockGroup) == dockGroup.GetType())
     {
         DockGroup dockGroup1 = ViewElementFactory.Current.CreateDockGroup();
         if (dockGroup1 == null || !(dockGroup1 is ExpressionDockGroup))
         {
             return(false);
         }
         this.CopyDockGroupProperties(dockGroup, dockGroup1);
         dockGroup = dockGroup1;
     }
     return(true);
 }
Пример #7
0
        protected virtual bool ValidateOrReplaceDockGroup(ref DockGroup dockGroup, WindowProfileValidationContext context)
        {
            DocumentGroupContainer documentGroupContainer = dockGroup as DocumentGroupContainer;

            if (documentGroupContainer == null)
            {
                return(true);
            }
            if (documentGroupContainer.Children.Count == 0)
            {
                documentGroupContainer.Children.Add((ViewElement)DocumentGroup.Create());
            }
            bool flag = this.ValidateOrReplaceDocumentGroupContainer(ref documentGroupContainer, context);

            dockGroup = (DockGroup)documentGroupContainer;
            return(flag);
        }
Пример #8
0
 protected virtual void PostValidation(WindowProfile profile, WindowProfileValidationContext context)
 {
     if (context.MainSites.Count == 0)
     {
         MainSite mainSite = MainSite.Create();
         mainSite.Child = WindowProfile.CreateDefaultMainSiteContent();
         profile.Children.Add((ViewElement)mainSite);
     }
     else
     {
         if (context.MainSites.Count > 1)
         {
             this.DeleteExtraMainSites(context.MainSites, profile);
         }
         foreach (MainSite site in context.MainSites)
         {
             this.PostValidateMainSite(site);
         }
     }
 }
Пример #9
0
        protected bool ValidateOrReplaceNestedGroup(ref NestedGroup nestedGroup, WindowProfileValidationContext context)
        {
            TabGroup tabGroup = nestedGroup as TabGroup;

            if (tabGroup != null)
            {
                bool flag = this.ValidateOrReplaceTabGroup(ref tabGroup, context);
                nestedGroup = (NestedGroup)tabGroup;
                return(flag);
            }
            DocumentGroup documentGroup = nestedGroup as DocumentGroup;

            if (documentGroup == null)
            {
                return(this.ValidateOrReplaceCustomNestedGroup(ref nestedGroup, context));
            }
            bool flag1 = this.ValidateOrReplaceDocumentGroup(ref documentGroup, context);

            nestedGroup = (NestedGroup)documentGroup;
            return(flag1);
        }
Пример #10
0
 protected virtual bool ValidateOrReplaceCustomViewElement(ref ViewElement element, WindowProfileValidationContext context)
 {
     return(false);
 }
Пример #11
0
 protected virtual bool ValidateOrReplaceViewBookmark(ref ViewBookmark viewBookmark, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #12
0
 protected virtual bool ValidateOrReplaceCustomViewGroup(ref ViewGroup viewGroup, WindowProfileValidationContext context)
 {
     return(false);
 }
Пример #13
0
 protected virtual bool ValidateOrReplaceDockRoot(ref DockRoot dockRoot, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #14
0
 protected virtual bool ValidateOrReplaceAutoHideRoot(ref AutoHideRoot autoHideRoot, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #15
0
 protected virtual bool ValidateOrReplaceViewElementCollection(IObservableCollection <ViewElement> children, WindowProfileValidationContext context)
 {
     for (int index = 0; index < children.Count; ++index)
     {
         ViewElement element = children[index];
         using (element.PreventCollapse())
         {
             bool flag = this.ValidateOrReplaceViewElement(ref element, context);
             if (element != children[index])
             {
                 children[index] = element;
             }
             else if (!flag)
             {
                 children.Remove(element);
                 --index;
             }
         }
     }
     return(true);
 }
Пример #16
0
 protected override bool ValidateOrReplaceCustomViewElement(ref ViewElement element, WindowProfileValidationContext context)
 {
     if (element is NakedView)
     {
         return(true);
     }
     return(base.ValidateOrReplaceCustomViewElement(ref element, context));
 }
Пример #17
0
 protected virtual bool ValidateOrReplaceAutoHideChannel(ref AutoHideChannel autoHideChannel, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #18
0
 protected virtual bool ValidateOrReplaceDocumentGroup(ref DocumentGroup documentGroup, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #19
0
 protected virtual bool ValidateOrReplaceTabGroup(ref TabGroup tabGroup, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #20
0
 protected virtual bool ValidateOrReplaceMainSite(ref MainSite mainSite, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #21
0
 protected virtual bool ValidateOrReplaceFloatSite(ref FloatSite floatSite, WindowProfileValidationContext context)
 {
     return(true);
 }
Пример #22
0
        protected bool ValidateOrReplaceViewGroup(ref ViewGroup viewGroup, WindowProfileValidationContext context)
        {
            DockOperations.TryCollapse((ViewElement)viewGroup);
            DockGroup dockGroup = viewGroup as DockGroup;

            if (dockGroup != null)
            {
                bool flag = this.ValidateOrReplaceDockGroup(ref dockGroup, context);
                viewGroup = (ViewGroup)dockGroup;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            NestedGroup nestedGroup = viewGroup as NestedGroup;

            if (nestedGroup != null)
            {
                bool flag = this.ValidateOrReplaceNestedGroup(ref nestedGroup, context);
                viewGroup = (ViewGroup)nestedGroup;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            AutoHideGroup autoHideGroup = viewGroup as AutoHideGroup;

            if (autoHideGroup != null)
            {
                autoHideGroup.SelectedElement = (ViewElement)null;
                bool flag = this.ValidateOrReplaceAutoHideGroup(ref autoHideGroup, context);
                viewGroup = (ViewGroup)autoHideGroup;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            AutoHideChannel autoHideChannel = viewGroup as AutoHideChannel;

            if (autoHideChannel != null)
            {
                bool flag = this.ValidateOrReplaceAutoHideChannel(ref autoHideChannel, context);
                viewGroup = (ViewGroup)autoHideChannel;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            ViewSite viewSite = viewGroup as ViewSite;

            if (viewSite != null)
            {
                bool flag = this.ValidateOrReplaceViewSite(ref viewSite, context);
                viewGroup = (ViewGroup)viewSite;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            AutoHideRoot autoHideRoot = viewGroup as AutoHideRoot;

            if (autoHideRoot != null)
            {
                bool flag = this.ValidateOrReplaceAutoHideRoot(ref autoHideRoot, context);
                viewGroup = (ViewGroup)autoHideRoot;
                this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
                return(flag);
            }
            DockRoot dockRoot = viewGroup as DockRoot;

            if (dockRoot == null)
            {
                return(this.ValidateOrReplaceCustomViewGroup(ref viewGroup, context));
            }
            bool flag1 = this.ValidateOrReplaceDockRoot(ref dockRoot, context);

            viewGroup = (ViewGroup)dockRoot;
            this.ValidateOrReplaceViewElementCollection(viewGroup.Children, context);
            return(flag1);
        }