コード例 #1
0
        void m_DeleteCalcMemberButton_Click(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show(Localization.DeleteCurrent_Question, Localization.Warning, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                CalcMemberInfo memberInfo = MembersList.CurrentObject as CalcMemberInfo;
                if (memberInfo != null)
                {
                    Members.Remove(memberInfo.Name);
                    MembersList.RemoveItem(memberInfo);
                }
                else
                {
                    CalculatedNamedSetInfo setInfo = MembersList.CurrentObject as CalculatedNamedSetInfo;
                    if (setInfo != null)
                    {
                        Sets.Remove(setInfo.Name);
                        MembersList.RemoveItem(setInfo);
                    }
                }

                m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;
                RefreshMetadataTree();
            }
            return;
        }
コード例 #2
0
        void RefreshMetadataTree()
        {
            List <CalcMemberInfo> members = new List <CalcMemberInfo>();

            foreach (CalculationInfoBase info in Members.Values)
            {
                CalcMemberInfo memberInfo = info as CalcMemberInfo;
                if (memberInfo != null)
                {
                    members.Add(memberInfo);
                }
            }

            List <CalculatedNamedSetInfo> sets = new List <CalculatedNamedSetInfo>();

            foreach (CalculationInfoBase info in Sets.Values)
            {
                CalculatedNamedSetInfo setInfo = info as CalculatedNamedSetInfo;
                if (setInfo != null)
                {
                    sets.Add(setInfo);
                }
            }

            CubeBrowser.CalculatedMembers   = members;
            CubeBrowser.CalculatedNamedSets = sets;
        }
コード例 #3
0
 public override object Clone()
 {
     CalculatedNamedSetInfo ret = new CalculatedNamedSetInfo();
     ret.Name = Name;
     ret.Expression = Expression;
     return ret;
 }
コード例 #4
0
        public override object Clone()
        {
            CalculatedNamedSetInfo ret = new CalculatedNamedSetInfo();

            ret.Name       = Name;
            ret.Expression = Expression;
            return(ret);
        }
コード例 #5
0
        public void Initialize(CalculatedNamedSetInfo info)
        {
            this.IsEnabled = info != null;

            m_Set              = info;
            txtName.Text       = info != null ? info.Name : String.Empty;
            txtExpression.Text = info != null ? info.Expression : String.Empty;
        }
        public CalculatedNamedSetTreeNode(CalculatedNamedSetInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("info");

            Icon = UriResources.Images.CustomNamedSet16;
            Text = info.Name;
            m_Info = info;
        }
コード例 #7
0
        void m_AddNamedSetButton_Click(object sender, RoutedEventArgs e)
        {
            CalculatedNamedSetInfo info = new CalculatedNamedSetInfo();

            info.Name = BuildNewCalculatedNamedSetName(String.Empty);
            Sets.Add(info.Name, info);

            MembersList.Initialize(Members, Sets, info);
            RefreshMetadataTree();
            m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;
        }
コード例 #8
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;
        }
        void m_AddNamedSetButton_Click(object sender, RoutedEventArgs e)
        {
            CalculatedNamedSetInfo info = new CalculatedNamedSetInfo();
            info.Name = BuildNewCalculatedNamedSetName(String.Empty);
            Sets.Add(info.Name, info);

            MembersList.Initialize(Members, Sets, info);
            RefreshMetadataTree();
            m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;
        }
 public CalculatedNamedSet_AreaItemWrapper(CalculatedNamedSetInfo info)
     : base(info)
 {
 }
        public void Initialize(CalculatedNamedSetInfo info)
        {
            this.IsEnabled = info != null;

            m_Set = info;
            txtName.Text = info != null ? info.Name : String.Empty;
            txtExpression.Text = info != null ? info.Expression : String.Empty;
        }