void Raise_GetOlapDataLoader(GetIDataLoaderArgs args)
 {
     EventHandler<GetIDataLoaderArgs> handler = this.GetOlapDataLoader;
     if (handler != null)
     {
         handler(this, args);
     }
 }
        void Raise_GetOlapDataLoader(GetIDataLoaderArgs args)
        {
            EventHandler <GetIDataLoaderArgs> handler = this.GetOlapDataLoader;

            if (handler != null)
            {
                handler(this, args);
            }
        }
        bool BeginEdit(CoordinateItem item)
        {
            if (item != null)
            {
                // Если элемент только для чтения, то при отключенном режиме администрирования редактировать его не даем
                if (!IsAdminMode && item.CoordinateState == CoordinateStateTypes.Readonly)
                {
                    return(false);
                }

                if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[0])
                {
                    return(true);
                }
                if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3] ||
                    (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4]))
                {
                    IChoiceDialog dlg = null;

                    if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                    {
                        if (m_SourceDialogs.ContainsKey(item))
                        {
                            dlg = m_SourceDialogs[item];
                        }
                    }

                    if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                    {
                        if (m_DestDialogs.ContainsKey(item))
                        {
                            dlg = m_DestDialogs[item];
                        }
                    }

                    if (dlg == null)
                    {
                        if (item.DimensionUniqueName == "[Measures]")
                        {
                            // Выбор меры
                            MeasureChoiceDialog dialog = new MeasureChoiceDialog();
                            dialog.ChoiceControl.CubeName   = CubeName;
                            dialog.ChoiceControl.Connection = ConnectionID;
                            dialog.ChoiceControl.LogManager = LogManager;
                            GetIDataLoaderArgs args = new GetIDataLoaderArgs();
                            Raise_GetOlapDataLoader(args);
                            if (args.Handled)
                            {
                                dialog.ChoiceControl.OlapDataLoader = args.Loader;
                            }
                            dialog.Tag           = item;
                            dialog.DialogOk     += new EventHandler(Dialog_DialogOk);
                            dialog.DialogCancel += new EventHandler(dlg_DialogCancel);
                            dialog.Show();
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                            {
                                dialog.UserData = MemberChoiceType.Source;
                            }
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                            {
                                dialog.UserData = MemberChoiceType.Destination;
                            }
                            dlg = dialog;
                        }
                        else
                        {
                            // Выбор элемента измерения
                            MemberChoiceDialog dialog = new MemberChoiceDialog();
                            dialog.ChoiceControl.CubeName            = CubeName;
                            dialog.ChoiceControl.Connection          = ConnectionID;
                            dialog.ChoiceControl.HierarchyUniqueName = item.HierarchyUniqueName;
                            dialog.ChoiceControl.LogManager          = LogManager;

                            GetIDataLoaderArgs args = new GetIDataLoaderArgs();
                            Raise_GetOlapDataLoader(args);
                            if (args.Handled)
                            {
                                dialog.ChoiceControl.OlapDataLoader = args.Loader;
                            }

                            dialog.Tag           = item;
                            dialog.DialogOk     += new EventHandler(Dialog_DialogOk);
                            dialog.DialogCancel += new EventHandler(dlg_DialogCancel);
                            dialog.Show();
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                            {
                                dialog.UserData = MemberChoiceType.Source;
                            }
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                            {
                                dialog.UserData = MemberChoiceType.Destination;
                            }
                            dlg = dialog;
                        }
                        if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                        {
                            m_SourceDialogs[item] = dlg;
                        }
                        if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                        {
                            m_DestDialogs[item] = dlg;
                        }
                    }

                    if (dlg != null)
                    {
                        dlg.Show();
                        return(true);
                    }
                }
            }
            return(false);
        }
		void CopyControl_GetMetadataLoader(object sender, GetIDataLoaderArgs e)
		{
			e.Loader = GetOlapDataLoader();
			e.Handled = true;
		}
 void tupleControl_GetOlapDataLoader(object sender, GetIDataLoaderArgs e)
 {
     Raise_GetOlapDataLoader(e);
 }
        bool BeginEdit(CoordinateItem item)
        {
            if (item != null)
            {
                // Если элемент только для чтения, то при отключенном режиме администрирования редактировать его не даем
                if (!IsAdminMode && item.CoordinateState == CoordinateStateTypes.Readonly)
                    return false;

                if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[0])
                {
                    return true;
                }
                if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3] ||
                    (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4]))
                {
                    IChoiceDialog dlg = null;

                    if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                    {
                        if (m_SourceDialogs.ContainsKey(item))
                        {
                            dlg = m_SourceDialogs[item];
                        }
                    }

                    if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                    {
                        if (m_DestDialogs.ContainsKey(item))
                        {
                            dlg = m_DestDialogs[item];
                        }
                    }

                    if (dlg == null)
                    {
                        if (item.DimensionUniqueName == "[Measures]")
                        {
                            // Выбор меры
                            MeasureChoiceDialog dialog = new MeasureChoiceDialog();
                            dialog.ChoiceControl.CubeName = CubeName;
                            dialog.ChoiceControl.Connection = ConnectionID;
                            dialog.ChoiceControl.LogManager = LogManager;
                            GetIDataLoaderArgs args = new GetIDataLoaderArgs();
                            Raise_GetOlapDataLoader(args);
                            if (args.Handled)
                                dialog.ChoiceControl.OlapDataLoader = args.Loader;
                            dialog.Tag = item;
                            dialog.DialogOk += new EventHandler(Dialog_DialogOk);
                            dialog.DialogCancel += new EventHandler(dlg_DialogCancel);
                            dialog.Show();
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                            {
                                dialog.UserData = MemberChoiceType.Source;
                            }
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                            {
                                dialog.UserData = MemberChoiceType.Destination;
                            }
                            dlg = dialog;
                        }
                        else
                        {
                            // Выбор элемента измерения
                            MemberChoiceDialog dialog = new MemberChoiceDialog();
                            dialog.ChoiceControl.CubeName = CubeName;
                            dialog.ChoiceControl.Connection = ConnectionID;
                            dialog.ChoiceControl.HierarchyUniqueName = item.HierarchyUniqueName;
                            dialog.ChoiceControl.LogManager = LogManager;

                            GetIDataLoaderArgs args = new GetIDataLoaderArgs();
                            Raise_GetOlapDataLoader(args);
                            if (args.Handled)
                                dialog.ChoiceControl.OlapDataLoader = args.Loader;

                            dialog.Tag = item;
                            dialog.DialogOk += new EventHandler(Dialog_DialogOk);
                            dialog.DialogCancel += new EventHandler(dlg_DialogCancel);
                            dialog.Show();
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                            {
                                dialog.UserData = MemberChoiceType.Source;
                            }
                            if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                            {
                                dialog.UserData = MemberChoiceType.Destination;
                            }
                            dlg = dialog;
                        }
                        if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[3])
                        {
                            m_SourceDialogs[item] = dlg;
                        }
                        if (coordinatesGrid.CurrentColumn == coordinatesGrid.Columns[4])
                        {
                            m_DestDialogs[item] = dlg;
                        }

                    }

                    if (dlg != null)
                    {
                        dlg.Show();
                        return true;
                    }
                }
            }
            return false;
        }
 void m_Coordinates_GetOlapDataLoader(object sender, GetIDataLoaderArgs e)
 {
     Raise_GetOlapDataLoader(e);
 }
        bool BeginMemberEdit(TupleItem item)
        {
            if (item != null)
            {
                IChoiceDialog dlg = null;
                if (!String.IsNullOrEmpty(item.HierarchyUniqueName) && m_ChoiceDialogs.ContainsKey(item.HierarchyUniqueName))
                {
                    dlg = m_ChoiceDialogs[item.HierarchyUniqueName];
                }
                
                if (dlg == null)
                {
                    if (item.HierarchyUniqueName == "[Measures]")
                    {
                        // Выбор меры
                        MeasureChoiceDialog dialog = new MeasureChoiceDialog();
                        dialog.ChoiceControl.CubeName = CubeName;
                        dialog.ChoiceControl.Connection = ConnectionID;
                        dialog.ChoiceControl.LogManager = LogManager;
                        GetIDataLoaderArgs args = new GetIDataLoaderArgs();
                        Raise_GetOlapDataLoader(args);
                        if (args.Handled)
                            dialog.ChoiceControl.OlapDataLoader = args.Loader;
                        dialog.Tag = item;
                        dialog.DialogOk += new EventHandler(Dialog_DialogOk);
                        dialog.DialogCancel += new EventHandler(Dialog_DialogCancel);
                        dialog.Show();
                        dlg = dialog;
                    }
                    else
                    {
                        // Выбор элемента измерения
                        MemberChoiceDialog dialog = new MemberChoiceDialog();
                        dialog.ChoiceControl.CubeName = CubeName;
                        dialog.ChoiceControl.Connection = ConnectionID;
                        dialog.ChoiceControl.HierarchyUniqueName = item.HierarchyUniqueName;
                        dialog.ChoiceControl.LogManager = LogManager;

                        GetIDataLoaderArgs args = new GetIDataLoaderArgs();
                        Raise_GetOlapDataLoader(args);
                        if (args.Handled)
                            dialog.ChoiceControl.OlapDataLoader = args.Loader;

                        dialog.Tag = item;
                        dialog.DialogOk += new EventHandler(Dialog_DialogOk);
                        dialog.DialogCancel += new EventHandler(Dialog_DialogCancel);
                        dialog.Show();
                        dlg = dialog;
                    }
                    if(!String.IsNullOrEmpty(item.HierarchyUniqueName))
                        m_ChoiceDialogs[item.HierarchyUniqueName] = dlg;
                }

                if (dlg != null)
                {
                    dlg.Show();
                    return true;
                }
            }
            return false;
        }
 void m_Coordinates_GetOlapDataLoader(object sender, GetIDataLoaderArgs e)
 {
     Raise_GetOlapDataLoader(e);
 }