예제 #1
0
        protected virtual void CloseGadget()
        {
            strataPanelList.Clear();
            strataGridList.Clear();
            strataExpanderList.Clear();

            object el = this.FindName("headerPanel");

            if (el != null)
            {
                Controls.GadgetHeaderPanel headerPanel = el as Controls.GadgetHeaderPanel;
                headerPanel.GadgetCloseButtonClicked          -= new GadgetCloseButtonHandler(CloseGadget);
                headerPanel.GadgetOutputCollapseButtonClicked -= new GadgetOutputCollapseButtonHandler(CollapseOutput);
                headerPanel.GadgetOutputExpandButtonClicked   -= new GadgetOutputExpandButtonHandler(ExpandOutput);
                headerPanel.GadgetConfigButtonClicked         -= new GadgetConfigButtonHandler(ShowHideConfigPanel);
                headerPanel.GadgetDescriptionButtonClicked    -= new GadgetDescriptionButtonHandler(ShowHideDescriptionPanel);
                headerPanel.GadgetFilterButtonClicked         -= new GadgetFilterButtonHandler(ShowCustomFilterDialog);
            }

            if (GadgetClosing != null)
            {
                GadgetClosing(this);
            }

            GadgetClosing = null;
            GadgetCheckForCancellation = null;
            GadgetProcessingFinished   = null;
            GadgetStatusUpdate         = null;
            GadgetRefreshed            = null;
        }
예제 #2
0
        /// <summary>
        /// Constructs the gadget
        /// </summary>
        protected virtual void Construct()
        {
            strataGridList     = new List <Grid>();
            strataPanelList    = new List <StackPanel>();
            strataExpanderList = new List <Expander>();
            strataCount        = 0;

            GadgetOptions = new GadgetParameters();
            GadgetOptions.InputVariableList = new Dictionary <string, string>();
            GadgetOptions.ShouldIncludeFullSummaryStatistics = false;
            GadgetOptions.ShouldIncludeMissing       = false;
            GadgetOptions.ShouldSortHighToLow        = false;
            GadgetOptions.ShouldUseAllPossibleValues = false;
            GadgetOptions.StrataVariableNames        = new List <string>();
            GadgetOptions.PSUVariableName            = string.Empty;
            GadgetOptions.CustomFilter = string.Empty;

            if (this.DashboardHelper != null)
            {
                this.dataFilters = new Epi.WPF.Dashboard.DataFilters(this.DashboardHelper);
            }

            object el = this.FindName("headerPanel");

            if (el != null)
            {
                Controls.GadgetHeaderPanel headerPanel = el as Controls.GadgetHeaderPanel;
                headerPanel.GadgetCloseButtonClicked          += new GadgetCloseButtonHandler(CloseGadget);
                headerPanel.GadgetOutputCollapseButtonClicked += new GadgetOutputCollapseButtonHandler(CollapseOutput);
                headerPanel.GadgetOutputExpandButtonClicked   += new GadgetOutputExpandButtonHandler(ExpandOutput);
                headerPanel.GadgetConfigButtonClicked         += new GadgetConfigButtonHandler(ShowHideConfigPanel);
                headerPanel.GadgetDescriptionButtonClicked    += new GadgetDescriptionButtonHandler(ShowHideDescriptionPanel);
                headerPanel.GadgetFilterButtonClicked         += new GadgetFilterButtonHandler(ShowCustomFilterDialog);
            }

            el = this.FindName("messagePanel");
            if (el != null)
            {
                Controls.GadgetMessagePanel messagePanel = el as Controls.GadgetMessagePanel;
                messagePanel.MessagePanelType = Controls.MessagePanelType.StatusPanel;
                messagePanel.Text             = string.Empty;
                messagePanel.Visibility       = System.Windows.Visibility.Collapsed;
            }

            el = this.FindName("descriptionPanel");
            if (el != null)
            {
                Controls.GadgetDescriptionPanel descriptionPanel = el as Controls.GadgetDescriptionPanel;
                if (!string.IsNullOrEmpty(CustomOutputDescription) && !CustomOutputHeading.Equals("(none)"))
                {
                    descriptionPanel.Text      = CustomOutputDescription;
                    descriptionPanel.PanelMode = Controls.GadgetDescriptionPanel.DescriptionPanelMode.DisplayMode;
                }
                else
                {
                    descriptionPanel.PanelMode = Controls.GadgetDescriptionPanel.DescriptionPanelMode.Collapsed;
                }
            }
        }
예제 #3
0
        protected void TurnOffBorders()
        {
            object borderElement = FindName("borderAll");

            if (borderElement != null)
            {
                Border border = borderElement as Border;
                border.Style = null;
            }

            object headerPanelElement = FindName("headerPanel");

            if (headerPanelElement != null)
            {
                Controls.GadgetHeaderPanel header = headerPanelElement as Controls.GadgetHeaderPanel;
                header.Visibility = System.Windows.Visibility.Hidden;
            }

            object shadowRectangleElement = FindName("rectangleShadow");

            if (shadowRectangleElement != null)
            {
                ShadowRectangle rectangle = shadowRectangleElement as ShadowRectangle;
                rectangle.Visibility = System.Windows.Visibility.Hidden;
            }

            object infoPanel = FindName("infoPanel");

            if (infoPanel != null)
            {
                GadgetInfoPanel panel = infoPanel as GadgetInfoPanel;
                if (panel.Visibility == System.Windows.Visibility.Visible)
                {
                    panel.Visibility = System.Windows.Visibility.Hidden;
                }
            }
        }
예제 #4
0
        protected void TurnOnBorders()
        {
            object borderElement = FindName("borderAll");

            if (borderElement != null)
            {
                Border border = borderElement as Border;
                border.Style = this.Resources["mainGadgetBorder"] as Style;
            }

            object headerPanelElement = FindName("headerPanel");

            if (headerPanelElement != null)
            {
                Controls.GadgetHeaderPanel header = headerPanelElement as Controls.GadgetHeaderPanel;
                header.Visibility = System.Windows.Visibility.Visible;
            }

            object shadowRectangleElement = FindName("rectangleShadow");

            if (shadowRectangleElement != null)
            {
                ShadowRectangle rectangle = shadowRectangleElement as ShadowRectangle;
                rectangle.Visibility = System.Windows.Visibility.Visible;
            }

            object infoPanel = FindName("infoPanel");

            if (infoPanel != null)
            {
                GadgetInfoPanel panel = infoPanel as GadgetInfoPanel;
                if (!string.IsNullOrEmpty(panel.Text))
                {
                    panel.Visibility = System.Windows.Visibility.Visible;
                }
            }
        }