OptionalExecutablePanel.xaml.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Optional Executable Panel
  2. //
  3. // Douglas Thrift
  4. //
  5. // OptionalExecutablePanel.xaml.cs
  6. /* Copyright 2014 Douglas Thrift
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. using System.Windows.Controls;
  21. public partial class OptionalExecutablePanel : StackPanel
  22. {
  23. private Setting setting;
  24. public OptionalExecutablePanel(Setting setting)
  25. {
  26. InitializeComponent();
  27. this.setting = setting;
  28. if (setting.handler)
  29. SettingUsage.Text = "Use a specific executable for " + setting.name + ":";
  30. else
  31. {
  32. SettingCheckBox.Content = setting.name + " Executable:";
  33. SettingUsage.Text = setting.usage + ":";
  34. }
  35. }
  36. private void SettingCheckBox_Checked(object sender, System.Windows.RoutedEventArgs e)
  37. {
  38. SettingExecutablePanel.IsEnabled = true;
  39. }
  40. private void SettingCheckBox_Unchecked(object sender, System.Windows.RoutedEventArgs e)
  41. {
  42. SettingExecutablePanel.IsEnabled = false;
  43. }
  44. }