void Dialog_DialogOk(object sender, EventArgs e)
        {
            MemberChoiceDialog dlg = sender as MemberChoiceDialog;

            if (dlg != null && dlg.UserData != null && dlg.UserData is MemberChoiceType)
            {
                CoordinateItem item = dlg.Tag as CoordinateItem;
                if (item != null)
                {
                    List <MemberChoiceSettings> selectedInfo = dlg.ChoiceControl.SelectedInfo;
                    if (selectedInfo != null && selectedInfo.Count == 1)
                    {
                        MemberWrap member = new MemberWrap();
                        member.Caption             = dlg.ChoiceControl.SelectedInfo[0].Caption;
                        member.UniqueName          = dlg.ChoiceControl.SelectedInfo[0].UniqueName;
                        member.HierarchyUniqueName = dlg.ChoiceControl.HierarchyUniqueName;
                        if (((MemberChoiceType)dlg.UserData) == MemberChoiceType.Source)
                        {
                            item.SourceMember = member;
                        }
                        if (((MemberChoiceType)dlg.UserData) == MemberChoiceType.Destination)
                        {
                            item.DestMember = member;
                        }
                    }
                }
                return;
            }

            MeasureChoiceDialog measure_dlg = sender as MeasureChoiceDialog;

            if (measure_dlg != null && measure_dlg.UserData != null && measure_dlg.UserData is MemberChoiceType)
            {
                CoordinateItem item = measure_dlg.Tag as CoordinateItem;
                if (item != null)
                {
                    if (measure_dlg.ChoiceControl.SelectedInfo != null)
                    {
                        MemberWrap member = new MemberWrap();
                        member.Caption             = measure_dlg.ChoiceControl.SelectedInfo.Caption;
                        member.UniqueName          = measure_dlg.ChoiceControl.SelectedInfo.UniqueName;
                        member.HierarchyUniqueName = "[Measures]";
                        if (((MemberChoiceType)measure_dlg.UserData) == MemberChoiceType.Source)
                        {
                            item.SourceMember = member;
                        }
                        if (((MemberChoiceType)measure_dlg.UserData) == MemberChoiceType.Destination)
                        {
                            item.DestMember = member;
                        }
                    }
                }
            }
        }
        public void InitializeMetadata(CubeDefInfo cubeInfo)
        {
            List <CoordinateItem> list = new List <CoordinateItem>();

            if (cubeInfo != null)
            {
                foreach (DimensionInfo dim_Info in cubeInfo.Dimensions)
                {
                    foreach (HierarchyInfo hier_info in dim_Info.Hierarchies)
                    {
                        CoordinateItem item = new CoordinateItem(dim_Info.UniqueName, hier_info.UniqueName);
                        item.Hierarchy_Custom_AllMemberUniqueName = hier_info.Custom_AllMemberUniqueName;
                        item.DimensionCaption = dim_Info.Caption;
                        item.HierarchyCaption = hier_info.Caption;
                        if (m_Slice != null && m_Slice.ContainsKey(hier_info.UniqueName))
                        {
                            MemberWrap wrap = m_Slice[hier_info.UniqueName];
                            item.SourceMember = wrap;

                            item.DestMember = wrap;
                            // Если в приемник попадает элемент типа ALL, то
                            // пытаемся заменить его на DefaultMember. Если же DefaultMember совпадет в итоге с AllMember
                            // то в приемник устанавливаем Unknown элемент
                            if (!String.IsNullOrEmpty(hier_info.Custom_AllMemberUniqueName) &&
                                hier_info.Custom_AllMemberUniqueName == wrap.UniqueName)
                            {
                                if (!String.IsNullOrEmpty(hier_info.DefaultMember) &&
                                    hier_info.DefaultMember == hier_info.Custom_AllMemberUniqueName)
                                {
                                    MemberWrap unk_wrap = new MemberWrap();
                                    unk_wrap.IsUnknownMember = true;
                                    item.DestMember          = unk_wrap;
                                }
                                else
                                {
                                    if (!String.IsNullOrEmpty(hier_info.DefaultMember))
                                    {
                                        MemberWrap def_wrap = new MemberWrap();
                                        def_wrap.IsDefaultMember = true;
                                        item.DestMember          = def_wrap;
                                    }
                                }
                            }
                        }
                        list.Add(item);
                    }
                }
            }
            m_Coordinates.Initialize(list);
        }
        void Dialog_DialogOk(object sender, EventArgs e)
        {
            MemberChoiceDialog dlg = sender as MemberChoiceDialog;
            if (dlg != null && dlg.UserData != null && dlg.UserData is MemberChoiceType)
            {
                CoordinateItem item = dlg.Tag as CoordinateItem;
                if (item != null)
                {
                    List<MemberChoiceSettings> selectedInfo = dlg.ChoiceControl.SelectedInfo;
                    if (selectedInfo != null && selectedInfo.Count == 1)
                    {
                        MemberWrap member = new MemberWrap();
                        member.Caption = dlg.ChoiceControl.SelectedInfo[0].Caption;
                        member.UniqueName = dlg.ChoiceControl.SelectedInfo[0].UniqueName;
                        member.HierarchyUniqueName = dlg.ChoiceControl.HierarchyUniqueName;
                        if(((MemberChoiceType)dlg.UserData) == MemberChoiceType.Source)
                            item.SourceMember = member;                    
                        if(((MemberChoiceType)dlg.UserData) == MemberChoiceType.Destination)
                            item.DestMember = member;                    

                    }
                }
                return;
            }

            MeasureChoiceDialog measure_dlg = sender as MeasureChoiceDialog;
            if (measure_dlg != null && measure_dlg.UserData != null && measure_dlg.UserData is MemberChoiceType)
            {
                CoordinateItem item = measure_dlg.Tag as CoordinateItem;
                if (item != null)
                {
                    if (measure_dlg.ChoiceControl.SelectedInfo != null)
                    {
                        MemberWrap member = new MemberWrap();
                        member.Caption = measure_dlg.ChoiceControl.SelectedInfo.Caption;
                        member.UniqueName = measure_dlg.ChoiceControl.SelectedInfo.UniqueName;
                        member.HierarchyUniqueName = "[Measures]";
                        if (((MemberChoiceType)measure_dlg.UserData) == MemberChoiceType.Source)
                            item.SourceMember = member;
                        if (((MemberChoiceType)measure_dlg.UserData) == MemberChoiceType.Destination)
                            item.DestMember = member;

                    }
                }
            }
        }
        public void InitializeMetadata(CubeDefInfo cubeInfo)
        {
            List<CoordinateItem> list = new List<CoordinateItem>();
            
            if(cubeInfo != null)
            {
                foreach (DimensionInfo dim_Info in cubeInfo.Dimensions)
                {
                    foreach (HierarchyInfo hier_info in dim_Info.Hierarchies)
                    {
                        CoordinateItem item = new CoordinateItem(dim_Info.UniqueName, hier_info.UniqueName);
                        item.Hierarchy_Custom_AllMemberUniqueName = hier_info.Custom_AllMemberUniqueName;
                        item.DimensionCaption = dim_Info.Caption;
                        item.HierarchyCaption = hier_info.Caption;
                        if (m_Slice != null && m_Slice.ContainsKey(hier_info.UniqueName))
                        {
                            MemberWrap wrap = m_Slice[hier_info.UniqueName];
                            item.SourceMember = wrap;

                            item.DestMember = wrap;
                            // Если в приемник попадает элемент типа ALL, то
                            // пытаемся заменить его на DefaultMember. Если же DefaultMember совпадет в итоге с AllMember
                            // то в приемник устанавливаем Unknown элемент
                            if (!String.IsNullOrEmpty(hier_info.Custom_AllMemberUniqueName) &&
                                hier_info.Custom_AllMemberUniqueName == wrap.UniqueName)
                            {
                                if (!String.IsNullOrEmpty(hier_info.DefaultMember) &&
                                    hier_info.DefaultMember == hier_info.Custom_AllMemberUniqueName)
                                {
                                    MemberWrap unk_wrap = new MemberWrap();
                                    unk_wrap.IsUnknownMember = true;
                                    item.DestMember = unk_wrap;
                                }
                                else
                                {
                                    if (!String.IsNullOrEmpty(hier_info.DefaultMember))
                                    {
                                        MemberWrap def_wrap = new MemberWrap();
                                        def_wrap.IsDefaultMember = true;
                                        item.DestMember = def_wrap;
                                    }
                                }
                            }
                        }
                        list.Add(item);
                    }
                }
            }
            m_Coordinates.Initialize(list);
        }