public static void AutoHideGroupVisibility(AutoHideGroup control)
        {
            if (control == null)
            {
                VNC.AppLog.Warning("control is null", Common.LOG_APPNAME);
                return;
            }

            if (Common.UserMode.Administrator || Common.UserMode.Advanced)
            {
                control.Visibility = Visibility.Visible;
            }
            else
            {
                control.Visibility = Visibility.Hidden;
            }
        }
Esempio n. 2
0
        private void CreateAutoHideGroups()
        {
            AutoHideGroup autoHideGroup1 = new AutoHideGroup();
            LayoutPanel   panel7         = CreateLayoutPanel("Panel7");
            LayoutPanel   panel8         = CreateLayoutPanel("Panel8");

            autoHideGroup1.AddRange(new BaseLayoutItem[] { panel7, panel8 });

            AutoHideGroup autoHideGroup2 = new AutoHideGroup()
            {
                DockType = DevExpress.Xpf.Layout.Core.Dock.Bottom
            };
            LayoutPanel panel9 = CreateLayoutPanel("Panel9");

            autoHideGroup2.Add(panel9);

            dockManager.AutoHideGroups.AddRange(new AutoHideGroup[] { autoHideGroup1, autoHideGroup2 });
        }
 protected virtual bool ValidateOrReplaceAutoHideGroup(ref AutoHideGroup autoHideGroup, WindowProfileValidationContext context)
 {
     return(true);
 }
        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);
        }
Esempio n. 5
0
        public ChildViewBase()
        {
            SetValue(DocumentsPropertyKey, new FreezableCollection<BaseLayoutItem>());

              // Если понадобится зависимый Ribbon для DocumentPanel, то он будет объединяться.
              MDIMergeStyle = MDIMergeStyle.Always;

              LayoutGroup layoutGroup = new LayoutGroup();
              layoutGroup.Orientation = Orientation.Horizontal;
              LayoutRoot = layoutGroup;

              documentGroup = DockController.AddDocumentGroup(DockType.None);
              DockController.Dock(documentGroup, layoutGroup, DockType.Fill);
              documentGroup.ItemWidth = new GridLength(70, GridUnitType.Star);
              // При изменении активного элемента, изменим зависимое свойство.
              documentGroup.SelectedItemChanged += (s, e) =>
              {
            SelectedDocumentIndex = documentGroup.Items.IndexOf(documentGroup.SelectedItem);
              };

              propLayoutPanel = DockController.AddPanel(DockType.None);
              DockController.Dock(propLayoutPanel, layoutGroup, DockType.Right);
              propLayoutPanel.Caption = "Свойства";
              propLayoutPanel.AllowDrag = false;
              propLayoutPanel.AllowClose = false;
              propLayoutPanel.ItemWidth = new GridLength(30, GridUnitType.Star);

              AutoHideGroup autoHideGroup = new AutoHideGroup();
              autoHideGroup.DockType = Dock.Bottom;
              AutoHideGroups.Add(autoHideGroup);

              LayoutPanel outLayoutPanel = new LayoutPanel();
              outLayoutPanel.Caption = "Вывод";
              outLayoutPanel.AllowDrag = false;
              outLayoutPanel.AllowClose = false;
              autoHideGroup.Add(outLayoutPanel);

              // Элемент для вывода информации о построении.
              txtMessages = new RichTextBox();
              txtMessages.IsReadOnly = true;
              txtMessages.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
              // Уберем отступы между параграфами.
              Style noSpaceStyle = new Style(typeof(Paragraph));
              noSpaceStyle.Setters.Add(new Setter(Paragraph.MarginProperty, new Thickness(0)));
              txtMessages.Resources.Add(typeof(Paragraph), noSpaceStyle);
              // При изменении содержимого активируем панель и будем прокручивать текст вниз.
              txtMessages.TextChanged += (s, e) =>
              {
            Activate(outLayoutPanel);
            (s as RichTextBox).ScrollToEnd();
              };
              outLayoutPanel.Content = txtMessages;

              synchronizationContext = SynchronizationContext.Current;
              managedThreadId = Thread.CurrentThread.ManagedThreadId;
        }