Example #1
0
        public virtual void SetGadgetToFinishedState()
        {
            object el = FindName("descriptionPanel");

            if (el != null && el is Controls.GadgetDescriptionPanel)
            {
                Controls.GadgetDescriptionPanel descriptionPanel = el as Controls.GadgetDescriptionPanel;

                if (!string.IsNullOrEmpty(descriptionPanel.Text))
                {
                    descriptionPanel.PanelMode = Controls.GadgetDescriptionPanel.DescriptionPanelMode.DisplayMode;
                }
                else
                {
                    descriptionPanel.PanelMode = Controls.GadgetDescriptionPanel.DescriptionPanelMode.Collapsed;
                }
            }

            IsProcessing = false;

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

            this.Dispatcher.BeginInvoke(new SimpleCallback(CheckForCustomFilters));
        }
Example #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;
                }
            }
        }