示例#1
0
        private void AddNewFormatFieldProps()
        {
            DataRow row = this.dvFileFields.Table.NewRow();
            FormatFieldPropsEdit FormatFieldPropsEditForm = new FormatFieldPropsEdit(row, false);

            if (FormatFieldPropsEditForm.ShowDialog() == DialogResult.OK)
            {
                for (int counter = 0; counter < row.ItemArray.Length; counter++)
                {
                    if (!row.Table.Columns[counter].ReadOnly)
                    {
                        row[counter] = FormatFieldPropsEditForm.FieldProperties[counter];
                    }
                }
                this.dvFileFields.Table.Rows.Add(row);
                cl.AddField(this.strSettingsName, row["header"].ToString(), row["type"].ToString(), row["delimiter"].ToString(), System.Convert.ToInt32(row["length"]), System.Convert.ToInt32(row["align"]), row["filler"].ToString(), row["name"].ToString());
            }
        }
示例#2
0
        private bool CreateFileFieldRow(DataRow row)
        {
            FormatFieldPropsEdit FormatFieldPropsEditForm = new FormatFieldPropsEdit(row, true);

            if (FormatFieldPropsEditForm.ShowDialog() == DialogResult.OK)
            {
                for (int counter = 0; counter < row.ItemArray.Length; counter++)
                {
                    if (!row.Table.Columns[counter].ReadOnly)
                    {
                        row[counter] = FormatFieldPropsEditForm.FieldProperties[counter];
                    }
                }
                this.dvFileFields.Table.Rows.Add(row);
                return(true);
            }
            return(false);
        }
示例#3
0
        private void EditFormatFieldProps()
        {
            if (this.dvFileFields.Count < 1)
            {
                return;
            }
            BindingManagerBase   bm  = this.BindingContext[dvFileFields];
            DataRow              row = ((DataRowView)bm.Current).Row;
            FormatFieldPropsEdit FormatFieldPropsEditForm = new FormatFieldPropsEdit(row, true);

            if (FormatFieldPropsEditForm.ShowDialog() == DialogResult.OK)
            {
                for (int counter = 0; counter < row.ItemArray.Length; counter++)
                {
                    if (!row.Table.Columns[counter].ReadOnly)
                    {
                        row[counter] = FormatFieldPropsEditForm.FieldProperties[counter];
                    }
                }
                cl.EditField(this.strSettingsName, this.dataGrid2.CurrentRowIndex, FormatFieldPropsEditForm.FieldProperties["header"].ToString(), FormatFieldPropsEditForm.FieldProperties["type"].ToString(), FormatFieldPropsEditForm.FieldProperties["delimiter"].ToString(), System.Convert.ToInt32(FormatFieldPropsEditForm.FieldProperties["length"]), System.Convert.ToInt32(FormatFieldPropsEditForm.FieldProperties["align"]), FormatFieldPropsEditForm.FieldProperties["filler"].ToString(), FormatFieldPropsEditForm.FieldProperties["name"].ToString());
            }
        }