/// <summary>
        /// Copy Constructor
        /// </summary>
        public FrequencyParameters(FrequencyParameters parameters)
            : base()
        {
            GadgetTitle = parameters.GadgetTitle;
            GadgetDescription = parameters.GadgetDescription;

            WeightVariableName = parameters.WeightVariableName;
            StrataVariableNames = parameters.StrataVariableNames;
            CrosstabVariableName = parameters.CrosstabVariableName;
            UseFieldPrompts = parameters.UseFieldPrompts;
            DrawBorders = parameters.DrawBorders;
            DrawHeaderRow = parameters.DrawHeaderRow;
            DrawTotalRow = parameters.DrawTotalRow;
            RowsToDisplay = parameters.RowsToDisplay;
            Precision = parameters.Precision;
            PercentBarMode = parameters.PercentBarMode;
            PercentBarWidth = parameters.PercentBarWidth;
            ShowAllListValues = parameters.ShowAllListValues;
            SortHighToLow = parameters.SortHighToLow;
            IncludeMissing = parameters.IncludeMissing;
            ShowFrequencyCol = parameters.ShowFrequencyCol;
            ShowPercentCol = parameters.ShowPercentCol;
            ShowCumPercentCol = parameters.ShowCumPercentCol;
            Show95CILowerCol = parameters.Show95CILowerCol;
            Show95CIUpperCol = parameters.Show95CIUpperCol;
            ShowPercentBarsCol = parameters.ShowPercentBarsCol;
            IncludeFullSummaryStatistics = parameters.IncludeFullSummaryStatistics;
        }
Exemple #2
0
        /// <summary>
        /// Copy Constructor
        /// </summary>
        public FrequencyParameters(FrequencyParameters parameters)
            : base()
        {
            GadgetTitle       = parameters.GadgetTitle;
            GadgetDescription = parameters.GadgetDescription;

            WeightVariableName           = parameters.WeightVariableName;
            StrataVariableNames          = parameters.StrataVariableNames;
            CrosstabVariableName         = parameters.CrosstabVariableName;
            UseFieldPrompts              = parameters.UseFieldPrompts;
            DrawBorders                  = parameters.DrawBorders;
            DrawHeaderRow                = parameters.DrawHeaderRow;
            DrawTotalRow                 = parameters.DrawTotalRow;
            RowsToDisplay                = parameters.RowsToDisplay;
            Precision                    = parameters.Precision;
            PercentBarMode               = parameters.PercentBarMode;
            PercentBarWidth              = parameters.PercentBarWidth;
            ShowAllListValues            = parameters.ShowAllListValues;
            SortHighToLow                = parameters.SortHighToLow;
            IncludeMissing               = parameters.IncludeMissing;
            ShowFrequencyCol             = parameters.ShowFrequencyCol;
            ShowPercentCol               = parameters.ShowPercentCol;
            ShowCumPercentCol            = parameters.ShowCumPercentCol;
            Show95CILowerCol             = parameters.Show95CILowerCol;
            Show95CIUpperCol             = parameters.Show95CIUpperCol;
            ShowPercentBarsCol           = parameters.ShowPercentBarsCol;
            IncludeFullSummaryStatistics = parameters.IncludeFullSummaryStatistics;
        }
        public FrequencyProperties(
            DashboardHelper dashboardHelper,
            IGadget gadget,
            FrequencyParameters parameters,
            List<Grid> strataGridList
            )
        {
            InitializeComponent();
            this.DashboardHelper = dashboardHelper;
            this.Gadget = gadget;
            this.Parameters = parameters;
            this.StrataGridList = strataGridList;

            List<string> fields = new List<string>();
            List<string> weightFields = new List<string>();
            List<string> strataItems = new List<string>();

            //Variable fields
            fields.Add(String.Empty);
            ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.DateTime | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus")) fields.Add(fieldName);
                }
                else
                {
                    fields.Add(fieldName);
                }
            }
            cbxField.ItemsSource = fields;
            lbxField.ItemsSource = fields;
            //Weight Fields
            weightFields.Add(String.Empty);
            columnDataType = ColumnDataType.Numeric | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus")) weightFields.Add(fieldName);
                }
                else
                {
                    weightFields.Add(fieldName);
                }
            }
            weightFields.Sort();
            cbxFieldWeight.ItemsSource = weightFields;

            //Strata Fields
            strataItems.Add(String.Empty);
            columnDataType = ColumnDataType.Numeric | ColumnDataType.Boolean | ColumnDataType.Text | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus" || fieldName == "FKEY" || fieldName == "GlobalRecordId")) strataItems.Add(fieldName);
                }
                else
                {
                    strataItems.Add(fieldName);
                }
            }
            lbxFieldStrata.ItemsSource = strataItems;

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(cbxField.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("VariableCategory");
            view.GroupDescriptions.Add(groupDescription);

            RowFilterControl = new RowFilterControl(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, (gadget as FrequencyControl).DataFilters, true);
            RowFilterControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            panelFilters.Children.Add(RowFilterControl);

            txtRows.PreviewKeyDown += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);
            txtBarWidth.PreviewKeyDown += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);

            #region Translation

            lblConfigExpandedTitle.Content = DashboardSharedStrings.GADGET_CONFIG_TITLE_FREQUENCY;
            //expanderAdvancedOptions.Header = DashboardSharedStrings.GADGET_ADVANCED_OPTIONS;
            //expanderDisplayOptions.Header = DashboardSharedStrings.GADGET_DISPLAY_OPTIONS;
            tblockMainVariable.Text = DashboardSharedStrings.GADGET_FREQUENCY_VARIABLE;
            tblockStrataVariable.Text = DashboardSharedStrings.GADGET_STRATA_VARIABLE;
            tblockWeightVariable.Text = DashboardSharedStrings.GADGET_WEIGHT_VARIABLE;

            //checkboxAllValues.Content = DashboardSharedStrings.GADGET_ALL_LIST_VALUES;
            //checkboxCommentLegalLabels.Content = DashboardSharedStrings.GADGET_LIST_LABELS;
            checkboxIncludeMissing.Content = DashboardSharedStrings.GADGET_INCLUDE_MISSING;

            checkboxSortHighLow.Content = DashboardSharedStrings.GADGET_SORT_HI_LOW;
            checkboxUsePrompts.Content = DashboardSharedStrings.GADGET_USE_FIELD_PROMPT;
            //tblockOutputColumns.Text = DashboardSharedStrings.GADGET_OUTPUT_COLUMNS_DISPLAY;
            //tblockPrecision.Text = DashboardSharedStrings.GADGET_DECIMALS_TO_DISPLAY;

            tblockRows.Text = DashboardSharedStrings.GADGET_MAX_ROWS_TO_DISPLAY;
            tblockBarWidth.Text = DashboardSharedStrings.GADGET_MAX_PERCENT_BAR_WIDTH;

            //btnRun.Content = DashboardSharedStrings.GADGET_RUN_BUTTON;
            #endregion // Translation
        }