///// <summary>
        ///// Determines if the command should be displayed or not.
        ///// </summary>
        ///// <param name="item"></param>
        ///// <returns></returns>
        //public override bool DisplayCommand(UIHierarchyItem item)
        //{
        //    try
        //    {
        //        if (this.ApplicationObject.ActiveWindow == null || this.ApplicationObject.ActiveWindow.ProjectItem == null)
        //            return false;

        //        ProjectItem pi = this.ApplicationObject.ActiveWindow.ProjectItem;
        //        if (pi.Object is Cube)
        //        {
        //            return true;
        //        }
        //        return false;
        //    }
        //    catch
        //    {
        //        return false;
        //    }
        //}


        public override void Exec()
        {
            try
            {
                ProjectItem pi   = this.ApplicationObject.ActiveWindow.ProjectItem;
                Cube        cube = (Cube)pi.Object;

                List <M2MMatrixCompressionStat> listStats = BuildQueries(cube);

                BIDSHelper.SSAS.M2MMatrixCompressionForm form = new BIDSHelper.SSAS.M2MMatrixCompressionForm();
                form.m2mMatrixCompressionStatBindingSource.DataSource = listStats;
                form.ShowDialog();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
        public override void Exec()
        {
            try
            {
                ProjectItem pi = this.ApplicationObject.ActiveWindow.ProjectItem;
                Cube cube = (Cube)pi.Object;

                List<M2MMatrixCompressionStat> listStats = BuildQueries(cube);

                BIDSHelper.SSAS.M2MMatrixCompressionForm form = new BIDSHelper.SSAS.M2MMatrixCompressionForm();
                form.m2mMatrixCompressionStatBindingSource.DataSource = listStats;
                form.ShowDialog();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }