コード例 #1
0
        private void RegistryKeyTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            RegistryKey key = Registry.LocalMachine.OpenSubKey(SubKeyTextBox.Text);

            if (key != null)
            {
                string keyValue = (string)key.GetValue(RegistryKeyTextBox.Text);

                if (keyValue == null)
                {
                    state["RegistryKey"] = false;
                    state["Value"]       = false;
                    ValueTextBox.Clear();
                    RegistryKeyErrorLabel.Content = "Registry Key Does not exitst";
                }
                else
                {
                    state["RegistryKey"]          = true;
                    state["Value"]                = true;
                    RegistryKeyErrorLabel.Content = "";
                    ValueTextBox.Text             = keyValue.ToString();
                }

                key.Close();
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: radtek/Thingy
 private void SetValueButton_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(KeyTextBox.Text))
     {
         settings[KeyTextBox.Text] = ValueTextBox.Text;
         KeyTextBox.Clear();
         ValueTextBox.Clear();
         RefreshDictionaryView(settings, SettingsListBox);
     }
 }
コード例 #3
0
 public void DisableConditionModules()
 {
     OperatorsComboBox.Items.Clear();
     ValueTextBox.Clear();
     DateValueMaskedTextBox.Clear();
     OperatorsComboBox.Enabled      = false;
     ValueTextBox.Enabled           = false;
     DateValueMaskedTextBox.Enabled = false;
     AddConditionButton.Enabled     = false;
     ColumnsComboBox.SelectedIndex  = -1;
 }
コード例 #4
0
 private void AddConditionButton_Click(object sender, EventArgs e)
 {
     if (IsParsing(GetValue()))
     {
         Condition condition = new Condition(GetColumn(), GetOperator(), GetValue());
         ConditionsListBox.Items.Add(condition.ToString());
         conditions.Add(condition);
         ConditionsListBox.SelectedIndex = 0;
         DisableConditionModules();
     }
     else
     {
         ValueTextBox.Clear();
         DateValueMaskedTextBox.Clear();
         MessageBox.Show("Not Parsed!");
     }
 }
コード例 #5
0
ファイル: ValueEditor.cs プロジェクト: TianChun525/RSImage
 //重置和刷新ListView操作
 public void Reset()
 {
     if (BandCount > 0)
     {
         BandValues.Clear();
         ValuesListView.Clear();
         BandTextBox.Clear();
         ValueTextBox.Clear();
         for (int i = 0; i < BandCount; i++)
         {
             BandValues.Add(ResetNum);
         }
         for (int i = 0; i < BandCount; i++)
         {
             ValuesListView.Items.Add("Band" + (i + 1).ToString() + " " + BandValues[i].ToString("0.000000"));
         }
     }
 }
コード例 #6
0
 private void OperatorsComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (OperatorsComboBox.SelectedItem != null)
     {
         AddConditionButton.Enabled = true;
         string op = OperatorsComboBox.SelectedItem.ToString();
         if (op == "IS NULL" || op == "IS NOT NULL")
         {
             DateValueMaskedTextBox.Clear();
             ValueTextBox.Clear();
             DateValueMaskedTextBox.Enabled = false;
             ValueTextBox.Enabled           = false;
         }
         else
         {
             SwitchTextBoxes(IsDate(GetColumnType()));
         }
     }
 }
コード例 #7
0
 public void SwitchTextBoxes(bool isDate)
 {
     if (isDate)
     {
         DateValueMaskedTextBox.Clear();
         ValueTextBox.Clear();
         DateValueMaskedTextBox.Enabled = true;
         DateValueMaskedTextBox.Visible = true;
         ValueTextBox.Enabled           = false;
         ValueTextBox.Visible           = false;
     }
     else
     {
         DateValueMaskedTextBox.Clear();
         ValueTextBox.Clear();
         DateValueMaskedTextBox.Enabled = false;
         DateValueMaskedTextBox.Visible = false;
         ValueTextBox.Enabled           = true;
         ValueTextBox.Visible           = true;
     }
 }