Exemple #1
0
 void m_ClearButton_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show(Localization.DeleteAll_Question, Localization.Warning, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
     {
         Members.Clear();
         Sets.Clear();
         m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;
         MembersList.Initialize(Members, Sets);
         RefreshMetadataTree();
     }
 }
Exemple #2
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;
        }
Exemple #3
0
        void m_AddCalcMemberButton_Click(object sender, RoutedEventArgs e)
        {
            CalcMemberInfo info = new CalcMemberInfo();

            // Если по выбранному узлу можем определить иерархию, то уникальное имя иерархии добавляем в имя вычисляемого элемента
            // В этом случае элемент попадет в данную иерархию
            // В противном случае - в иерархию [Measures] даже если она явно не прописана в имени
            String name_prefix = String.Empty;
            var    hierarchy   = CubeBrowser.SelectedNode as HierarchyTreeNode;

            if (hierarchy != null)
            {
                if (hierarchy.Info != null && hierarchy.Info is HierarchyInfo)
                {
                    name_prefix = ((HierarchyInfo)hierarchy.Info).UniqueName;
                }
            }
            var level = CubeBrowser.SelectedNode as LevelTreeNode;

            if (level != null)
            {
                if (level.Info != null && level.Info is LevelInfo)
                {
                    name_prefix = ((LevelInfo)level.Info).ParentHirerachyId;
                }
            }
            var member = CubeBrowser.SelectedNode as MemberLiteTreeNode;

            if (member != null)
            {
                if (member.Info != null)
                {
                    name_prefix = member.Info.HierarchyUniqueName;
                }
            }

            String defaultName = String.IsNullOrEmpty(name_prefix) ? "[Calculated Member]" : name_prefix + "." + "[Calculated Member]";

            info.Name = BuildNewCalculatedMemberName(defaultName);
            Members.Add(info.Name, info);

            MembersList.Initialize(Members, Sets, info);
            RefreshMetadataTree();
            m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;
        }
Exemple #4
0
        public void Initialize(Dictionary <String, CalculationInfoBase> members, Dictionary <String, CalculationInfoBase> sets, CubeDefInfo cubeInfo, String measureGroupName)
        {
            m_Members = members;
            m_Sets    = sets;
            m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0;

            MemberCtrl.InitializeMetadata(cubeInfo);

            if (CubeBrowser.CubeInfo != cubeInfo)
            {
                CubeBrowser.Initialize(cubeInfo);
            }
            CubeBrowser.MeasureGroupName = measureGroupName;

            MemberCtrl.IsEnabled = SetCtrl.IsEnabled = false;

            foreach (CalculationInfoBase info in Members.Values)
            {
                CalcMemberInfo member = info as CalcMemberInfo;
                if (member != null)
                {
                    // Добавляем в список стандартных пользовательские строки форматирования
                    if (!String.IsNullOrEmpty(member.FormatString))
                    {
                        if (!FormatStrings.Contains(member.FormatString))
                        {
                            FormatStrings.Add(member.FormatString);
                        }
                    }
                }
            }

            MemberCtrl.FormatStrings = FormatStrings;
            MembersList.Initialize(members, sets);

            RefreshMetadataTree();

            //CalcMemberInfo memberInfo = MembersList.CurrentObject as CalcMemberInfo;
            //if (memberInfo != null)
            //{
            //    MemberCtrl.Initialize(memberInfo);
            //}
        }