HandlerSettingsBox.xaml.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SSH Handler Settings
  2. //
  3. // Douglas Thrift
  4. //
  5. // HandlerSettingsBox.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 HandlerSettingsBox : GroupBox
  22. {
  23. private Handler handler;
  24. public HandlerSettingsBox(Handler handler)
  25. {
  26. InitializeComponent();
  27. this.handler = handler;
  28. HandlerRadioButton.Content = handler.Setting.name;
  29. foreach (Setting setting in handler.Settings)
  30. switch (setting.type)
  31. {
  32. case SettingType.OptionalExecutable:
  33. SettingsPanel.Children.Add(new OptionalExecutablePanel(setting));
  34. break;
  35. case SettingType.OptionalYesNoExecutable:
  36. SettingsPanel.Children.Add(new OptionalYesNoExecutablePanel(setting));
  37. break;
  38. case SettingType.OptionalYesNoDirectory:
  39. SettingsPanel.Children.Add(new OptionalYesNoDirectoryPanel(setting));
  40. break;
  41. }
  42. }
  43. }