Beispiel #1
0
        private void FileFormatSettings_Load(object sender, System.EventArgs e)
        {
            this.cmbCodePages.Items.Clear();
            this.cmbSplitters.Items.Clear();
            this.cmbFieldSplitters.Items.Clear();
            this.cmbDateSplitters.Items.Clear();
            this.cmbCodePages.Items.AddRange(cl.GetAllCodepages());
            this.cmbSplitters.Items.AddRange(cl.GetAllDecimalSplitters());
            this.cmbFieldSplitters.Items.AddRange(cl.GetAllFieldSplitters());
            this.cmbDateSplitters.Items.AddRange(cl.GetAllDateSplitters());
            this.listBox1.Items.Clear();
            this.listBox1.Items.AddRange(this.cl.GetSpecifiedNodeFields(FormatNode));
            string DateFormat = cl.GetDateFormatString(FormatNode.Attributes["name"].Value.ToString());

            if (DateFormat != null)
            {
                if (!this.listBox2.Items.Contains(DateFormat))
                {
                    this.listBox2.Items.Add(DateFormat);
                }
                this.listBox2.SelectedItem = DateFormat;
            }
            this.tbFormatName.Text              = FormatNode.Attributes["name"].Value.ToString();
            this.cmbCodePages.SelectedItem      = cl.GetSpecifiedNodeCodepage(FormatNode.Attributes["name"].Value.ToString());
            this.cmbSplitters.SelectedItem      = cl.GetSpecifiedNodeDecimalSplitter(FormatNode.Attributes["name"].Value.ToString());
            this.cmbFieldSplitters.SelectedItem = cl.GetSpecifiedNodeFieldsSplitter(FormatNode.Attributes["name"].Value.ToString());
            this.cmbDateSplitters.SelectedItem  = cl.GetSpecifiedNodeDateSplitter(FormatNode.Attributes["name"].Value.ToString());
            if (ViewMode)
            {
                this.cmbCodePages.Enabled                 =
                    this.cmbDateSplitters.Enabled         =
                        this.cmbFieldSplitters.Enabled    =
                            this.cmbSplitters.Enabled     =
                                this.listBox1.Enabled     =
                                    this.listBox2.Enabled = false;
            }
        }