public void Initialize(List <OlapMemberInfo> infos, bool useStateIcons)
        {
            LayoutRoot.RowDefinitions.Clear();
            LayoutRoot.Children.Clear();
            if (infos != null)
            {
                int row = 0;
                foreach (OlapMemberInfo info in infos)
                {
                    LayoutRoot.RowDefinitions.Add(new RowDefinition()
                    {
                        Height = new GridLength(24)
                    });

                    MemberItemControl ctrl = null;
                    if (useStateIcons)
                    {
                        ctrl = new MemberItemControl(info.Info, MemberChoiceControl.GetIconImage(info));
                    }
                    else
                    {
                        ctrl = new MemberItemControl(info.Info);
                    }
                    ctrl.Tag = info;
                    LayoutRoot.Children.Add(ctrl);
                    Grid.SetRow(ctrl, row);
                    row++;

                    ctrl.IconClick += new EventHandler(MemberItem_IconClick);
                    ctrl.TextClick += new EventHandler(MemberItem_TextClick);
                }
            }
        }
コード例 #2
0
        private void UpdateNodeIcon()
        {
            TreeItemControl item_ctrl = Header as TreeItemControl;

            if (item_ctrl != null)
            {
                item_ctrl.Icon = MemberChoiceControl.GetIconImage(MemberInfo);
            }
        }
        public MemberChoiceDialog()
        {
            m_Dialog         = new FloatingDialog();
            m_Dialog.Caption = Localization.MemberChoice_Caption + "...";

            Grid LayoutRoot = new Grid();

            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });

            StackPanel buttonsPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right
            };

            buttonsPanel.Margin = new Thickness(5, 0, 5, 5);

            OkButton = new RanetButton()
            {
                Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 10, 0)
            };
            OkButton.Content = Localization.DialogButton_Ok;
            OkButton.Click  += new RoutedEventHandler(OkButton_Click);
            buttonsPanel.Children.Add(OkButton);

            CancelButton = new RanetButton()
            {
                Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 0, 0)
            };
            CancelButton.Content = Localization.DialogButton_Cancel;
            CancelButton.Click  += new RoutedEventHandler(CancelButton_Click);
            buttonsPanel.Children.Add(CancelButton);

            ContentRoot        = new Grid();
            ContentRoot.Margin = new Thickness(5);
            LayoutRoot.Children.Add(ContentRoot);
            LayoutRoot.Children.Add(buttonsPanel);
            Grid.SetRow(buttonsPanel, 1);

            m_ChoiceControl = new MemberChoiceControl();
            m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection);
            //m_ChoiceControl.CancelSelection += new EventHandler(m_ChoiceControl_CancelSelection);
            m_ChoiceControl.MultiSelect = false;
            ContentRoot.Children.Add(m_ChoiceControl);

            m_Dialog.SetContent(LayoutRoot);
            m_Dialog.DialogClosed += new EventHandler <DialogResultArgs>(m_Dialog_DialogClosed);
            m_Dialog.Width         = 500;
            m_Dialog.Height        = 400;
        }
        public FilterBuilderControl()
        {
            Grid grdLayoutRoot = new Grid();

            //LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            grdLayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grdLayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Фильтр
            grdFilter_LayoutRoot = new Grid();
            grdFilter_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grdFilter_LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Заголовок
            //HeaderControl lblFilter = new HeaderControl(UriResources.Images.ChangeFilter16, Localization.FilterControl_Caption) { Margin = new Thickness(0, 0, 0, 3) };
            lblFilter = new CheckedHeaderControl(false, Localization.FilterControl_Caption) { Margin = new Thickness(0, 0, 0, 3) };
            lblFilter.CheckedChanged += new EventHandler(lblFilter_CheckedChanged);
            grdFilter_LayoutRoot.Children.Add(lblFilter);
            // Фильтр
            filterPanel = new CustomPanel();
            m_Filter = new FilterControl() { Margin = new Thickness(5)};
            filterPanel.Content = m_Filter;
            grdFilter_LayoutRoot.Children.Add(filterPanel);
            Grid.SetRow(filterPanel, 1);

            // Выбор элементов в Set
            Grid grdMemberChoice_LayoutRoot = new Grid();
            grdMemberChoice_LayoutRoot.Margin = new Thickness(0, 5, 0, 0);
            grdMemberChoice_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto } );
            grdMemberChoice_LayoutRoot.RowDefinitions.Add(new RowDefinition());
            
            // Заголовок
            //HeaderControl lblMemberChoice = new HeaderControl(UriResources.Images.MemberChoice16, Localization.MemberChoice_Caption) { Margin = new Thickness(0, 0, 0, 3) };
            lblMemberChoice = new CheckedHeaderControl(false, Localization.MemberChoice_Caption) { Margin = new Thickness(0, 0, 0, 3) };
            lblMemberChoice.CheckedChanged += new EventHandler(lblMemberChoice_CheckedChanged);
            grdMemberChoice_LayoutRoot.Children.Add(lblMemberChoice);
            // Выбор элементов измерения
            m_MemberChoice = new MemberChoiceControl();
            grdMemberChoice_LayoutRoot.Children.Add(m_MemberChoice);
            Grid.SetRow(m_MemberChoice, 1);

            grdLayoutRoot.Children.Add(grdFilter_LayoutRoot);
            Grid.SetRow(grdFilter_LayoutRoot, 0);
            grdLayoutRoot.Children.Add(grdMemberChoice_LayoutRoot);
            Grid.SetRow(grdMemberChoice_LayoutRoot, 1);
            this.Content = grdLayoutRoot;

            Refresh();
        }
コード例 #5
0
        protected override void OnBeforePopUp(object sender, EventArgs e)
        {
            if (m_ChoiceControl == null)
            {
                m_ChoiceControl = GetChoiceControl();
                m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection);
                //m_ChoiceControl.CancelSelection += new EventHandler(m_ChoiceControl_CancelSelection);
                m_ChoiceControl.SelectedItemChanged += new EventHandler <ItemEventArgs>(m_ChoiceControl_SelectedItemChanged);

                ContentControl = m_ChoiceControl;
                PopUpContainer.PopupControl.Caption = Localization.MemberChoice_Caption + "...";
            }

            UpdateButtonsState();

            BeforePopUp();

            m_ChoiceControl.SelectLeafs = m_SelectLeafs;

            if (NeedReload)
            {
                m_ChoiceControl.URL                 = URL;
                m_ChoiceControl.Connection          = m_AConnection;
                m_ChoiceControl.CubeName            = m_ACubeName;
                m_ChoiceControl.SubCube             = m_ASubCube;
                m_ChoiceControl.HierarchyUniqueName = m_AHierarchyName;

                m_ChoiceControl.MultiSelect               = m_AMultiSelect;
                m_ChoiceControl.UseStepLoading            = m_AUseStepLoading;
                m_ChoiceControl.Step                      = m_AStep;
                m_ChoiceControl.StartLevelUniqueName      = m_AStartLevelUniqueName;
                m_ChoiceControl.SelectedSet               = m_SelectedSet;
                m_ChoiceControl.SelectedInfo              = m_SelectedInfo;
                m_ChoiceControl.ShowOnlyFirstLevelMembers = m_AShowOnlyFirstLevelMembers;
                m_ChoiceControl.MemberVisualizationType   = m_MemberVisualizationType;

                m_ChoiceControl.Initialize();
                NeedReload = false;
            }
        }
        public MemberChoiceDialog()
        {
            m_Dialog = new FloatingDialog();
            m_Dialog.Caption = Localization.MemberChoice_Caption + "..."; 

            Grid LayoutRoot = new Grid();
            LayoutRoot.RowDefinitions.Add(new RowDefinition() { });
            LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            StackPanel buttonsPanel = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right };
            buttonsPanel.Margin = new Thickness(5, 0, 5, 5);

            OkButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 10, 0) };
            OkButton.Content = Localization.DialogButton_Ok;
            OkButton.Click += new RoutedEventHandler(OkButton_Click);
            buttonsPanel.Children.Add(OkButton);

            CancelButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 0, 0) };
            CancelButton.Content = Localization.DialogButton_Cancel;
            CancelButton.Click += new RoutedEventHandler(CancelButton_Click);
            buttonsPanel.Children.Add(CancelButton);

            ContentRoot = new Grid();
            ContentRoot.Margin = new Thickness(5);
            LayoutRoot.Children.Add(ContentRoot);
            LayoutRoot.Children.Add(buttonsPanel);
            Grid.SetRow(buttonsPanel, 1);

            m_ChoiceControl = new MemberChoiceControl();
            m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection);
            //m_ChoiceControl.CancelSelection += new EventHandler(m_ChoiceControl_CancelSelection);
            m_ChoiceControl.MultiSelect = false;
            ContentRoot.Children.Add(m_ChoiceControl);

            m_Dialog.SetContent(LayoutRoot);
            m_Dialog.DialogClosed += new EventHandler<DialogResultArgs>(m_Dialog_DialogClosed);
            m_Dialog.Width = 500;
            m_Dialog.Height = 400;
        }
        public FilterBuilderControl()
        {
            Grid grdLayoutRoot = new Grid();

            //LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition());
            grdLayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            grdLayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Фильтр
            grdFilter_LayoutRoot = new Grid();
            grdFilter_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            grdFilter_LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Заголовок
            //HeaderControl lblFilter = new HeaderControl(UriResources.Images.ChangeFilter16, Localization.FilterControl_Caption) { Margin = new Thickness(0, 0, 0, 3) };
            lblFilter = new CheckedHeaderControl(false, Localization.FilterControl_Caption)
            {
                Margin = new Thickness(0, 0, 0, 3)
            };
            lblFilter.CheckedChanged += new EventHandler(lblFilter_CheckedChanged);
            grdFilter_LayoutRoot.Children.Add(lblFilter);
            // Фильтр
            filterPanel = new CustomPanel();
            m_Filter    = new FilterControl()
            {
                Margin = new Thickness(5)
            };
            filterPanel.Content = m_Filter;
            grdFilter_LayoutRoot.Children.Add(filterPanel);
            Grid.SetRow(filterPanel, 1);

            // Выбор элементов в Set
            Grid grdMemberChoice_LayoutRoot = new Grid();

            grdMemberChoice_LayoutRoot.Margin = new Thickness(0, 5, 0, 0);
            grdMemberChoice_LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            grdMemberChoice_LayoutRoot.RowDefinitions.Add(new RowDefinition());

            // Заголовок
            //HeaderControl lblMemberChoice = new HeaderControl(UriResources.Images.MemberChoice16, Localization.MemberChoice_Caption) { Margin = new Thickness(0, 0, 0, 3) };
            lblMemberChoice = new CheckedHeaderControl(false, Localization.MemberChoice_Caption)
            {
                Margin = new Thickness(0, 0, 0, 3)
            };
            lblMemberChoice.CheckedChanged += new EventHandler(lblMemberChoice_CheckedChanged);
            grdMemberChoice_LayoutRoot.Children.Add(lblMemberChoice);
            // Выбор элементов измерения
            m_MemberChoice = new MemberChoiceControl();
            grdMemberChoice_LayoutRoot.Children.Add(m_MemberChoice);
            Grid.SetRow(m_MemberChoice, 1);

            grdLayoutRoot.Children.Add(grdFilter_LayoutRoot);
            Grid.SetRow(grdFilter_LayoutRoot, 0);
            grdLayoutRoot.Children.Add(grdMemberChoice_LayoutRoot);
            Grid.SetRow(grdMemberChoice_LayoutRoot, 1);
            this.Content = grdLayoutRoot;

            Refresh();
        }