OptionalYesNoDirectoryPanel.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Optional Yes/No/Directory Panel
  2. //
  3. // Douglas Thrift
  4. //
  5. // OptionalYesNoDirectoryPanel.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.Collections.Generic;
  21. using System.Windows.Controls;
  22. public partial class OptionalYesNoDirectoryPanel : StackPanel
  23. {
  24. private Setting setting;
  25. public OptionalYesNoDirectoryPanel(Setting setting, IEnumerable<string> options)
  26. {
  27. InitializeComponent();
  28. this.setting = setting;
  29. SettingCheckBox.Content = setting.name + ":";
  30. SettingUsage.Text = setting.usage + ":";
  31. }
  32. private void SettingCheckBox_Checked(object sender, System.Windows.RoutedEventArgs e)
  33. {
  34. SettingRadioPanel.IsEnabled = true;
  35. }
  36. private void SettingCheckBox_Unchecked(object sender, System.Windows.RoutedEventArgs e)
  37. {
  38. SettingRadioPanel.IsEnabled = false;
  39. }
  40. private void SettingDirectory_Checked(object sender, System.Windows.RoutedEventArgs e)
  41. {
  42. SettingDirectoryPanel.IsEnabled = true;
  43. }
  44. private void SettingDirectory_Unchecked(object sender, System.Windows.RoutedEventArgs e)
  45. {
  46. SettingDirectoryPanel.IsEnabled = false;
  47. }
  48. }