Exemple #1
0
        public void EndEdit()
        {
            if (MemberCtrl.IsEnabled && MemberCtrl.Visibility == Visibility.Visible)
            {
                if (MemberCtrl.Member != null && MemberCtrl.Member.Name != MemberCtrl.NameText)
                {
                    Members.Remove(MemberCtrl.Member.Name);
                    String newName = BuildNewCalculatedMemberName(MemberCtrl.NameText);
                    MemberCtrl.Member.Name = newName;
                    Members.Add(MemberCtrl.Member.Name, MemberCtrl.Member);
                    MemberCtrl.Initialize(MemberCtrl.Member);

                    MembersList.Refresh();
                }
            }

            if (SetCtrl.IsEnabled && SetCtrl.Visibility == Visibility.Visible)
            {
                if (SetCtrl.Set != null && SetCtrl.Set.Name != SetCtrl.NameText)
                {
                    Sets.Remove(SetCtrl.Set.Name);
                    String newName = BuildNewCalculatedNamedSetName(SetCtrl.NameText);
                    SetCtrl.Set.Name = newName;
                    Sets.Add(SetCtrl.Set.Name, SetCtrl.Set);
                    SetCtrl.Initialize(SetCtrl.Set);

                    MembersList.Refresh();
                }
            }

            RefreshMetadataTree();
        }
Exemple #2
0
        void CubeBrowser_DragDelta(object sender, DragNodeArgs <DragDeltaEventArgs> e)
        {
            Point m_DragDelta = new Point(m_PrevDrag.X + e.Args.HorizontalChange, m_PrevDrag.Y + e.Args.VerticalChange);

            if (MemberCtrl.Visibility == Visibility.Visible)
            {
                MemberCtrl.HighlightDrop(m_DragDelta);
            }
            if (SetCtrl.Visibility == Visibility.Visible)
            {
                SetCtrl.HighlightDrop(m_DragDelta);
            }

            m_PrevDrag = m_DragDelta;
        }
Exemple #3
0
        void CubeBrowser_DragCompleted(object sender, DragNodeArgs <DragCompletedEventArgs> e)
        {
            if (e.Args.Canceled == false)
            {
                TreeViewItem node = e.Node;

                Point point = new Point(m_DragStart.X + e.Args.HorizontalChange, m_DragStart.Y + e.Args.VerticalChange);
                if (MemberCtrl.Visibility == Visibility.Visible && MemberCtrl.CanDrop(point))
                {
                    MemberCtrl.Drop(point, CubeBrowser.GetNodeString(node as CustomTreeNode));
                }
                if (SetCtrl.Visibility == Visibility.Visible && SetCtrl.CanDrop(point))
                {
                    SetCtrl.Drop(point, CubeBrowser.GetNodeString(node as CustomTreeNode));
                }
            }
        }
Exemple #4
0
        void MembersList_SelectionChanged(object sender, SelectionChangedEventArgs <CalculationInfoBase> e)
        {
            EndEdit();

            MemberCtrl.IsEnabled = SetCtrl.IsEnabled = e.NewValue != null;
            if (e.NewValue == null)
            {
                if (MemberCtrl.Visibility == Visibility.Visible)
                {
                    MemberCtrl.Initialize(null);
                }
                if (SetCtrl.Visibility == Visibility.Visible)
                {
                    SetCtrl.Initialize(null);
                }
            }

            CalcMemberInfo memberInfo = e.NewValue as CalcMemberInfo;

            if (memberInfo != null)
            {
                MemberCtrl.Visibility = Visibility.Visible;
                SetCtrl.Visibility    = Visibility.Collapsed;
                MemberCtrl.Initialize(memberInfo);
            }

            CalculatedNamedSetInfo setInfo = e.NewValue as CalculatedNamedSetInfo;

            if (setInfo != null)
            {
                MemberCtrl.Visibility = Visibility.Collapsed;
                SetCtrl.Visibility    = Visibility.Visible;
                SetCtrl.Initialize(setInfo);
            }

            m_DeleteCalcMemberButton.IsEnabled = e.NewValue != null;
        }