/// <summary>
        /// Determines if the command should be displayed or not.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public override bool DisplayCommand(UIHierarchyItem item)
        {
            try
            {
                UIHierarchy solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                if (((System.Array)solExplorer.SelectedItems).Length != 1)
                {
                    return(false);
                }

                UIHierarchyItem hierItem  = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                string          sFileName = ((ProjectItem)hierItem.Object).Name.ToLower();
                if (sFileName.EndsWith(".bim") && !(this is UsedColumnsPlugin))
                {
                    return(true);                                                            //show the menu if this is the .bim file of a Tabular model, but don't show the Used Columns Report for Tabular since the data source view isn't really something a Tabular developer manages
                }
                ProjectItem pi = (ProjectItem)hierItem.Object;
                if (!(pi.Object is DataSourceView))
                {
                    return(false);
                }
                Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)pi.ContainingProject;

                return(projExt.Kind == BIDSProjectKinds.SSAS);  //only show in an SSAS project, not in a report model or SSIS project (which also can have a DSV)
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        protected Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt GetSelectedProjectReference(bool onlyIfFileNotSelected)
        {
            UIHierarchy     solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
            UIHierarchyItem hierItem    = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));

            Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt proj = hierItem.Object as Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt;

            // if a project is in a folder the UIHierarchy object appears to return a project
            // wrapped in a ProjectItem so we need to unwrap it to get to the project.
            if (proj == null && hierItem.Object is ProjectItem)
            {
                ProjectItem pi = (ProjectItem)hierItem.Object;
                if ((pi.Object as Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt) != null)
                {
                    proj = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)pi.Object;
                }
                else if (pi is Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)
                {
                    proj = pi as Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt;
                }
                else if (!onlyIfFileNotSelected)
                {
                    proj = pi.ContainingProject as Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt;
                }
            }
            return(proj);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Determines if the command should be displayed or not.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public override bool ShouldDisplayCommand()
        {
            try
            {
                UIHierarchy solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                if (((System.Array)solExplorer.SelectedItems).Length != 1)
                {
                    return(false);
                }

                UIHierarchyItem hierItem = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                ProjectItem     pi       = (ProjectItem)hierItem.Object;
                if (pi.Object is DataSourceView)
                {
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)pi.ContainingProject;
                    return(projExt.Kind == BIDSProjectKinds.SSAS);  //only show in an SSAS project, not in a report model or SSIS project (which also can have a DSV)
                }
                else if (pi.Object is Dimension)
                {
                    Dimension dim = pi.Object as Dimension;
                    if (dim != null && dim.IsParentChild)
                    {
                        return(true);
                    }
                }
                return(false);
            }
            catch
            {
                return(false);
            }
        }
        /// <summary>
        /// Determines if the command should be displayed or not.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public override bool DisplayCommand(UIHierarchyItem item)
        {
            try
            {
                UIHierarchy     solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                UIHierarchyItem hierItem    = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                SolutionClass   solution    = hierItem.Object as SolutionClass;

                // test if this is a Multi-Dim project
                if (hierItem.Object is EnvDTE.Project)
                {
                    EnvDTE.Project p = (EnvDTE.Project)hierItem.Object;
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = p as Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt;
                    if (p == null)
                    {
                        return(false);
                    }

                    if (projExt.Kind == BIDSProjectKinds.SSAS)
                    {
                        return(true);
                        //Database db = (Database)p.Object;
                        //ScanAnalysisServicesProperties(db);
                    }
                }
                // else test if this is a tabular .bim file
                if (!(hierItem.Object is ProjectItem))
                {
                    return(false);
                }
                string sFileName = ((ProjectItem)hierItem.Object).Name.ToLower();
                return(sFileName.EndsWith(".bim"));
            }
            catch
            {
                return(false);
            }
        }
        public override void Exec()
        {
            try
            {
                UIHierarchy     solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                UIHierarchyItem hierItem    = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                //SolutionClass solution = hierItem.Object as SolutionClass;

                Microsoft.AnalysisServices.BackEnd.DataModelingSandbox sandbox = null;
                Database db          = null;
                bool     targetFound = false;
                if (hierItem.Object is EnvDTE.Project)
                {
                    EnvDTE.Project p = (EnvDTE.Project)hierItem.Object;
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)p;
                    if (projExt.Kind == BIDSProjectKinds.SSAS)
                    {
                        db          = (Database)p.Object;
                        targetFound = true;
                    }
                }
                if (hierItem.Object is ProjectItem)
                {
                    string sFileName = ((ProjectItem)hierItem.Object).Name.ToLower();
                    if (sFileName.EndsWith(".bim"))
                    {
                        sandbox     = TabularHelpers.GetTabularSandboxFromBimFile(hierItem, true);
                        targetFound = true;
                    }
                }

                if (targetFound)
                {
                    RunCustomDesignRules(db, sandbox);
                }
                else
                {
                    MessageBox.Show("No valid design rule target found");
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// Determines if the command should be displayed or not.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public override bool ShouldDisplayCommand()
        {
            try
            {
                UIHierarchy solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                if (((System.Array)solExplorer.SelectedItems).Length != 1)
                {
                    return(false);
                }

                UIHierarchyItem hierItem = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                Project         p        = GetSelectedProjectReference();

                SolutionClass solution = hierItem.Object as SolutionClass;
                if (p != null)
                {
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)p;
                    return(projExt.Kind == BIDSProjectKinds.SSRS);
                }
                else if (solution != null)
                {
                    foreach (Project pp in solution.Projects)
                    {
                        Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)p;
                        if (projExt.Kind == BIDSProjectKinds.SSRS)
                        {
                            return(true);
                        }
                    }
                }
                return(false);
            }
            catch
            {
                return(false);
            }
        }
        /// <summary>
        /// Determines if the command should be displayed or not.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public override bool DisplayCommand(UIHierarchyItem item)
        {
            try
            {
                UIHierarchy solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                if (((System.Array)solExplorer.SelectedItems).Length != 1)
                {
                    return(false);
                }

                UIHierarchyItem hierItem = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                SolutionClass   solution = hierItem.Object as SolutionClass;
                EnvDTE.Project  proj     = GetSelectedProjectReference();

                if (proj != null)
                {
                    if (!(proj.Object is Database))
                    {
                        return(false);
                    }
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)proj;
                    return(projExt.Kind == BIDSProjectKinds.SSIS);
                }
                else if (solution != null)
                {
                    foreach (EnvDTE.Project p in solution.Projects)
                    {
                        if (p.Kind != BIDSProjectKinds.SSIS)
                        {
                            return(false);
                        }
                    }
                    return(solution.Projects.Count > 0);
                }
            }
            catch { }
            return(false);
        }
        public override void Exec()
        {
            ProjectItem piCurrent = null;

            try
            {
                listPackageProperties = new List <PackageProperties>();

                UIHierarchy     solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                UIHierarchyItem hierItem    = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                SolutionClass   solution    = hierItem.Object as SolutionClass;
                EnvDTE.Project  proj        = GetSelectedProjectReference();

                if (proj != null)
                {
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)proj;
                    this.DatabaseName = "Project: " + proj.Name;

                    try
                    {
                        using (WaitCursor cursor1 = new WaitCursor())
                        {
                            int iProgress = 0;
                            ApplicationObject.StatusBar.Animate(true, vsStatusAnimation.vsStatusAnimationGeneral);
                            foreach (ProjectItem pi in proj.ProjectItems)
                            {
                                ApplicationObject.StatusBar.Progress(true, "Scanning package " + pi.Name, iProgress++, proj.ProjectItems.Count);
                                string sFileName = pi.Name.ToLower();
                                if (!sFileName.EndsWith(".dtsx"))
                                {
                                    continue;
                                }
                                piCurrent = pi;
                                this.PackagePathPrefix = pi.Name;
                                PackageProperties props = GetPackageProperties(pi);
                                if (props == null)
                                {
                                    continue;
                                }
                                listPackageProperties.Add(props);
                            }
                        }
                    }
                    finally
                    {
                        try
                        {
                            ApplicationObject.StatusBar.Animate(false, vsStatusAnimation.vsStatusAnimationGeneral);
                            ApplicationObject.StatusBar.Progress(false, "", 1, 1);
                        }
                        catch { }
                    }
                }
                else if (solution != null)
                {
                    this.DatabaseName = "Solution: " + System.IO.Path.GetFileNameWithoutExtension(solution.FullName);
                    try
                    {
                        this.DatabaseName = "Solution: " + solution.Properties.Item("Name").Value;
                    }
                    catch { }

                    try
                    {
                        using (WaitCursor cursor1 = new WaitCursor())
                        {
                            ApplicationObject.StatusBar.Animate(true, vsStatusAnimation.vsStatusAnimationGeneral);
                            foreach (EnvDTE.Project p in solution.Projects)
                            {
                                Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)p;
                                if (projExt.Kind == BIDSProjectKinds.SSIS)
                                {
                                    int iProgress = 0;
                                    foreach (ProjectItem pi in p.ProjectItems)
                                    {
                                        ApplicationObject.StatusBar.Progress(true, "Scanning project " + p.Name + " package " + pi.Name, iProgress++, p.ProjectItems.Count);
                                        string sFileName = pi.Name.ToLower();
                                        if (!sFileName.EndsWith(".dtsx"))
                                        {
                                            continue;
                                        }
                                        piCurrent = pi;
                                        this.PackagePathPrefix = p.Name + "\\" + pi.Name;
                                        PackageProperties props = GetPackageProperties(pi);
                                        if (props == null)
                                        {
                                            continue;
                                        }
                                        listPackageProperties.Add(props);
                                    }
                                }
                            }
                        }
                    }
                    finally
                    {
                        try
                        {
                            ApplicationObject.StatusBar.Animate(false, vsStatusAnimation.vsStatusAnimationGeneral);
                            ApplicationObject.StatusBar.Progress(false, "", 1, 1);
                        }
                        catch { }
                    }
                }

                ReportViewerForm frm = new ReportViewerForm();
                frm.ReportBindingSource.DataSource = this.listPackageProperties;
                frm.Report = "SSIS.SortablePackageProperties.rdlc";
                Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                reportDataSource1.Name  = "BIDSHelper_PackageProperties";
                reportDataSource1.Value = frm.ReportBindingSource;
                frm.ReportViewerControl.LocalReport.DataSources.Add(reportDataSource1);
                frm.ReportViewerControl.LocalReport.ReportEmbeddedResource = frm.Report;

                frm.Caption     = "Sortable Package Properties Report";
                frm.WindowState = FormWindowState.Maximized;
                frm.Show();
            }
            catch (DtsRuntimeException ex)
            {
                if (ex.ErrorCode == -1073659849L)
                {
                    MessageBox.Show((piCurrent == null ? "This package" : piCurrent.Name) + " has a package password. Please open the package designer, specify the password when the dialog prompts you, then rerun the Sortable Package Properties report.\r\n\r\nDetailed error was:\r\n" + ex.Message + "\r\n" + ex.StackTrace, "BIDS Helper - Password Not Specified");
                }
                else
                {
                    MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace, "BIDS Helper - Error" + (piCurrent == null ? string.Empty : " scanning " + piCurrent.Name));
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace, "BIDS Helper - Error" + (piCurrent == null ? string.Empty : " scanning " + piCurrent.Name));
            }
        }
        public override void Exec()
        {
            ProjectItem piCurrent = null;

            try
            {
                listNonDefaultProperties = new List <NonDefaultProperty>();

                UIHierarchy     solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                UIHierarchyItem hierItem    = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                SolutionClass   solution    = hierItem.Object as SolutionClass;
                EnvDTE.Project  p           = GetSelectedProjectReference();

                if (p != null)
                {
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)p;
                    if (projExt.Kind == BIDSProjectKinds.SSAS)
                    {
                        Database db = (Database)p.Object;
                        ScanAnalysisServicesProperties(db);
                    }
                    else
                    {
                        this.DatabaseName = "Project: " + p.Name;
                        this.SSASProject  = false;

                        try
                        {
                            using (WaitCursor cursor1 = new WaitCursor())
                            {
                                int iProgress = 0;
                                ApplicationObject.StatusBar.Animate(true, vsStatusAnimation.vsStatusAnimationGeneral);
                                Microsoft.SqlServer.Dts.Runtime.Application app = SSIS.PackageHelper.Application; //sets the proper TargetServerVersion
                                foreach (ProjectItem pi in p.ProjectItems)
                                {
                                    ApplicationObject.StatusBar.Progress(true, "Scanning package " + pi.Name, iProgress++, p.ProjectItems.Count);
                                    string sFileName = pi.Name.ToLower();
                                    if (!sFileName.EndsWith(".dtsx"))
                                    {
                                        continue;
                                    }
                                    piCurrent = pi;
                                    this.PackagePathPrefix = pi.Name;
                                    Package package = GetPackageFromIntegrationServicesProjectItem(pi);
                                    ScanIntegrationServicesProperties(package);
                                }
                            }
                        }
                        finally
                        {
                            try
                            {
                                ApplicationObject.StatusBar.Animate(false, vsStatusAnimation.vsStatusAnimationGeneral);
                                ApplicationObject.StatusBar.Progress(false, "", 1, 1);
                            }
                            catch { }
                        }
                    }
                }
                else if (solution != null)
                {
                    this.DatabaseName = "Solution: " + System.IO.Path.GetFileNameWithoutExtension(solution.FullName);
                    try
                    {
                        this.DatabaseName = "Solution: " + solution.Properties.Item("Name").Value;
                    }
                    catch { }

                    this.SSASProject = false;

                    try
                    {
                        using (WaitCursor cursor1 = new WaitCursor())
                        {
                            ApplicationObject.StatusBar.Animate(true, vsStatusAnimation.vsStatusAnimationGeneral);
                            foreach (EnvDTE.Project proj in solution.Projects)
                            {
                                Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)proj;
                                if (projExt.Kind == BIDSProjectKinds.SSIS)
                                {
                                    int iProgress = 0;
                                    Microsoft.SqlServer.Dts.Runtime.Application app = SSIS.PackageHelper.Application; //sets the proper TargetServerVersion;
                                    foreach (ProjectItem pi in proj.ProjectItems)
                                    {
                                        ApplicationObject.StatusBar.Progress(true, "Scanning project " + proj.Name + " package " + pi.Name, iProgress++, proj.ProjectItems.Count);
                                        string sFileName = pi.Name.ToLower();
                                        if (!sFileName.EndsWith(".dtsx"))
                                        {
                                            continue;
                                        }
                                        piCurrent = pi;
                                        this.PackagePathPrefix = proj.Name + "\\" + pi.Name;
                                        Package package = GetPackageFromIntegrationServicesProjectItem(pi);
                                        ScanIntegrationServicesProperties(package);
                                    }
                                }
                            }
                        }
                    }
                    finally
                    {
                        try
                        {
                            ApplicationObject.StatusBar.Animate(false, vsStatusAnimation.vsStatusAnimationGeneral);
                            ApplicationObject.StatusBar.Progress(false, "", 1, 1);
                        }
                        catch { }
                    }
                }
                else
                {
                    ProjectItem pi = (ProjectItem)hierItem.Object;
                    piCurrent = pi;
                    Package package = GetPackageFromIntegrationServicesProjectItem(pi);

                    this.DatabaseName      = "Package: " + package.Name;
                    this.SSASProject       = false;
                    this.PackagePathPrefix = string.Empty;

                    ScanIntegrationServicesProperties(package);
                }

                //clear the cache
                this.packageDefault = null;
                this.dictCachedDtsObjects.Clear();

                if (listNonDefaultProperties.Count == 0)
                {
                    MessageBox.Show("No properties set to non-default values were found.", "BIDS Helper - Non-Default Properties Report");
                    return;
                }

                //pop up the form to let the user exclude properties from showing on the report
                List <string> listExcludedProperties = new List <string>(this.ExcludedProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
                BIDSHelper.SSAS.NonDefaultPropertiesSelectionForm selector = new BIDSHelper.SSAS.NonDefaultPropertiesSelectionForm();
                foreach (NonDefaultProperty prop in listNonDefaultProperties)
                {
                    if (!selector.listProperties.Items.Contains(prop.PropertyName))
                    {
                        bool bChecked = !listExcludedProperties.Contains(prop.PropertyName);
                        selector.listProperties.Items.Add(prop.PropertyName, bChecked);
                    }
                }

                DialogResult selectorResult = selector.ShowDialog();
                if (selectorResult == DialogResult.OK)
                {
                    //remove the the report rows they unchecked
                    for (int i = 0; i < listNonDefaultProperties.Count; i++)
                    {
                        if (!selector.listProperties.CheckedItems.Contains(listNonDefaultProperties[i].PropertyName))
                        {
                            listNonDefaultProperties.RemoveAt(i--);
                        }
                    }

                    //save their prefs... keep previously prefs which haven't been changes (because an excluded property may not show up in the possible properties list each time you run the report)
                    foreach (object item in selector.listProperties.Items)
                    {
                        if (!selector.listProperties.CheckedItems.Contains(item)) //if excluded, then add to the excluded list
                        {
                            if (!listExcludedProperties.Contains(item.ToString()))
                            {
                                listExcludedProperties.Add(item.ToString());
                            }
                        }
                        else //if included, then remove from the excluded list
                        {
                            if (listExcludedProperties.Contains(item.ToString()))
                            {
                                listExcludedProperties.Remove(item.ToString());
                            }
                        }
                    }
                    this.ExcludedProperties = string.Join(",", listExcludedProperties.ToArray());

                    ReportViewerForm frm = new ReportViewerForm();
                    frm.ReportBindingSource.DataSource = this.listNonDefaultProperties;
                    frm.Report = "SSAS.NonDefaultProperties.rdlc";
                    Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                    reportDataSource1.Name  = "BIDSHelper_NonDefaultProperty";
                    reportDataSource1.Value = frm.ReportBindingSource;
                    frm.ReportViewerControl.LocalReport.DataSources.Add(reportDataSource1);
                    frm.ReportViewerControl.LocalReport.ReportEmbeddedResource = frm.Report;

                    frm.Caption     = "Non-Default Properties Report";
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
            }
            catch (DtsRuntimeException ex)
            {
                if (ex.ErrorCode == -1073659849L)
                {
                    MessageBox.Show((piCurrent == null ? "This package" : piCurrent.Name) + " has a package password. Please open the package designer, specify the password when the dialog prompts you, then rerun the Non-Default Properties report.\r\n\r\nDetailed error was:\r\n" + ex.Message + "\r\n" + ex.StackTrace, "BIDS Helper - Password Not Specified");
                }
                else
                {
                    MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace, "BIDS Helper - Error" + (piCurrent == null ? string.Empty : " scanning " + piCurrent.Name));
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace, "BIDS Helper - Error" + (piCurrent == null ? string.Empty : " scanning " + piCurrent.Name));
            }
        }
Exemplo n.º 10
0
        public override bool DisplayCommand(EnvDTE.UIHierarchyItem item)
        {
            try
            {
                UIHierarchy solExplorer = this.ApplicationObject.ToolWindows.SolutionExplorer;
                if (((System.Array)solExplorer.SelectedItems).Length != 1)
                {
                    return(false);
                }

                UIHierarchyItem hierItem = ((UIHierarchyItem)((System.Array)solExplorer.SelectedItems).GetValue(0));
                SolutionClass   solution = hierItem.Object as SolutionClass;
                if (hierItem.Object is Project)
                {
                    Project p = (Project)hierItem.Object;
                    if (!(p.Object is Database))
                    {
                        return(false);
                    }
                    Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt projExt = (Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectExt)p;
                    return(projExt.Kind == BIDSProjectKinds.SSAS);
                }
            }
            catch { }
            return(false);
        }