Exemplo n.º 1
0
        private void button8_Click(object sender, System.EventArgs e)
        {
            iniFile = new Sempra.IniFile(textBox3.Text);
            StringCollection list = iniFile.ReadValue("List");

            listBox1.Items.Clear();
            for (int i = 0; i < list.Count; i++)
            {
                listBox1.Items.Add(list[i]);
            }
        }
Exemplo n.º 2
0
        private void button7_Click(object sender, System.EventArgs e)
        {
            iniFile = new Sempra.IniFile(textBox3.Text);
            StringCollection list = new StringCollection();

            foreach (string s in listBox1.Items)
            {
                list.Add(s);
            }

            iniFile.WriteValue("List", list);
        }
Exemplo n.º 3
0
 private void WriteUserSettings()
 {
     try
     {
         Sempra.IniFile iniFile = new Sempra.IniFile(Sempra.Ops.GetUserIniFileName(settingsDir));
         iniFile.WriteValue(FORM_NAME, "Top", this.Top);
         iniFile.WriteValue(FORM_NAME, "Left", this.Left);
     }
     catch (Exception error)
     {
         XtraMessageBox.Show("An error occurred while saving the user settings file." + Environment.NewLine +
                             "Error CNF-400 in " + FORM_NAME + ".WriteUserSettings(): " + error.Message,
                             FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 4
0
 private void WriteUserSettings()
 {
     try
     {
         Sempra.IniFile iniFile = new Sempra.IniFile(Sempra.Ops.GetUserIniFileName(settingsDir));
         iniFile.WriteValue(FORM_NAME, "Top", this.Top);
         iniFile.WriteValue(FORM_NAME, "Left", this.Left);
     }
     catch (Exception error)
     {
         XtraMessageBox.Show("An error occurred while saving the user settings file." + Environment.NewLine +
                "Error CNF-400 in " + FORM_NAME + ".WriteUserSettings(): " + error.Message,
              FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 5
0
        private void ReadUserSettings()
        {
            try
            {
                //Now read user settings, ReadAppSettings() must be called first
                Sempra.IniFile iniFile = new Sempra.IniFile(Sempra.Ops.GetUserIniFileName(settingsDir));

                this.StartPosition = FormStartPosition.Manual;
                this.Top = iniFile.ReadValue(FORM_NAME, "Top", 200);
                this.Left = iniFile.ReadValue(FORM_NAME, "Left", 300);
                this.Width = 384;
                this.Height = 240;
            }
            catch (Exception error)
            {
                XtraMessageBox.Show("An error occurred while reading the user settings file." + Environment.NewLine +
                       "Error CNF-399 in " + FORM_NAME + ".ReadUserSettings(): " + error.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 6
0
        private void ReadUserSettings()
        {
            try
            {
                //Now read user settings, ReadAppSettings() must be called first
                Sempra.IniFile iniFile = new Sempra.IniFile(Sempra.Ops.GetUserIniFileName(settingsDir));

                this.StartPosition = FormStartPosition.Manual;
                this.Top           = iniFile.ReadValue(FORM_NAME, "Top", 200);
                this.Left          = iniFile.ReadValue(FORM_NAME, "Left", 300);
                this.Width         = 384;
                this.Height        = 240;
            }
            catch (Exception error)
            {
                XtraMessageBox.Show("An error occurred while reading the user settings file." + Environment.NewLine +
                                    "Error CNF-399 in " + FORM_NAME + ".ReadUserSettings(): " + error.Message,
                                    FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 7
0
		private void button2_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			textBox2.Text = iniFile.ReadValue( "Text", "test", "default" );
		}
Exemplo n.º 8
0
		private void button8_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			StringCollection list = iniFile.ReadValue( "List" );

			listBox1.Items.Clear();
			for( int i = 0; i < list.Count; i++ )
				listBox1.Items.Add( list[i] );
		}
Exemplo n.º 9
0
		private void button7_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			StringCollection list = new StringCollection();

			foreach( string s in listBox1.Items )
				list.Add( s );

			iniFile.WriteValue( "List", list );		
		}
Exemplo n.º 10
0
		private void button6_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			numericUpDown2.Value = iniFile.ReadValue( "Int", "test", 42 );		
		}
Exemplo n.º 11
0
		private void button5_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			iniFile.WriteValue( "Int", "test", (int)numericUpDown1.Value );		
		}
Exemplo n.º 12
0
		private void button4_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			checkBox2.Checked = iniFile.ReadValue( "Bool", "test", true );
		}
Exemplo n.º 13
0
 private void button2_Click(object sender, System.EventArgs e)
 {
     iniFile       = new Sempra.IniFile(textBox3.Text);
     textBox2.Text = iniFile.ReadValue("Text", "test", "default");
 }
Exemplo n.º 14
0
		private void button1_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			iniFile.WriteValue( "Text", "test", textBox1.Text );
		}
Exemplo n.º 15
0
 private void button3_Click(object sender, System.EventArgs e)
 {
     iniFile = new Sempra.IniFile(textBox3.Text);
     iniFile.WriteValue("Bool", "test", checkBox1.Checked);
 }
Exemplo n.º 16
0
 private void button4_Click(object sender, System.EventArgs e)
 {
     iniFile           = new Sempra.IniFile(textBox3.Text);
     checkBox2.Checked = iniFile.ReadValue("Bool", "test", true);
 }
Exemplo n.º 17
0
 private void button6_Click(object sender, System.EventArgs e)
 {
     iniFile = new Sempra.IniFile(textBox3.Text);
     numericUpDown2.Value = iniFile.ReadValue("Int", "test", 42);
 }
Exemplo n.º 18
0
 private void button5_Click(object sender, System.EventArgs e)
 {
     iniFile = new Sempra.IniFile(textBox3.Text);
     iniFile.WriteValue("Int", "test", (int)numericUpDown1.Value);
 }
Exemplo n.º 19
0
		private void button3_Click(object sender, System.EventArgs e)
		{
			iniFile = new Sempra.IniFile(textBox3.Text);
			iniFile.WriteValue( "Bool", "test", checkBox1.Checked );
		}
Exemplo n.º 20
0
 private void button1_Click(object sender, System.EventArgs e)
 {
     iniFile = new Sempra.IniFile(textBox3.Text);
     iniFile.WriteValue("Text", "test", textBox1.Text);
 }