Пример #1
0
        protected override void loadData()
        {
            base.loadData();
            McCurdyUMD1 mcCurdyUmd = umd as McCurdyUMD1;

            if (mcCurdyUmd == null)
            {
                return;
            }

            portDropDown.SelectByValue(mcCurdyUmd.Port);
            addressNumericField.Value = mcCurdyUmd.Address;

            columnCount = convertColumnCountEnumToInt(mcCurdyUmd.ColumnCount);
            useSeparatorBarCheckBox.Checked = mcCurdyUmd.UseSeparators;

            for (int i = 0; i < MAX_COLUMN_COUNT; i++)
            {
                columnDynamicTextSourceDropDowns[i].SelectByValue(mcCurdyUmd.GetDynamicTextSource(i));
                columnAlignmentDropDowns[i].SelectByValue(mcCurdyUmd.TextAlignment[i]);
                if (i < MAX_COLUMN_COUNT - 1)
                {
                    columnWidthNumericFields[i].Value = mcCurdyUmd.ColumnWidths[i];
                }
            }

            updateColumnWidths();
        }
Пример #2
0
        protected override void writeFields()
        {
            base.writeFields();
            McCurdyUMD1 mcCurdyUmd1 = (McCurdyUMD1)EditedModel;

            if (mcCurdyUmd1 == null)
            {
                return;
            }
            mcCurdyUmd1.Port          = portDropDown.SelectedValue as SerialPort;
            mcCurdyUmd1.Address       = (int)addressNumericField.Value;
            mcCurdyUmd1.ColumnCount   = convertIntToColumnCountEnum(columnCount);
            mcCurdyUmd1.UseSeparators = useSeparatorBarCheckBox.Checked;
            TextAlignment[] alignments = new TextAlignment[MAX_COLUMN_COUNT];
            int[]           widths     = new int[MAX_COLUMN_COUNT - 1];
            for (int i = 0; i < 3; i++)
            {
                mcCurdyUmd1.SetDynamicTextSource(i, columnDynamicTextSourceDropDowns[i].SelectedValue as DynamicText);
                alignments[i] = (TextAlignment)columnAlignmentDropDowns[i].SelectedValue;
                if (i < MAX_COLUMN_COUNT - 1)
                {
                    widths[i] = (int)columnWidthNumericFields[i].Value;
                }
            }
            mcCurdyUmd1.TextAlignment = alignments;
            mcCurdyUmd1.ColumnWidths  = widths;
        }
Пример #3
0
        protected override void validateFields()
        {
            base.validateFields();
            McCurdyUMD1 mcCurdyUmd1 = (McCurdyUMD1)EditedModel;

            if (mcCurdyUmd1 == null)
            {
                return;
            }
        }
Пример #4
0
        protected override void validateFields()
        {
            base.validateFields();
            McCurdyUMD1 mcCurdyUmd = umd as McCurdyUMD1;

            if (mcCurdyUmd == null)
            {
                return;
            }
            // TODO: Validation
        }