diff options
| author | Jacob Palecki <[email protected]> | 2020-09-07 15:19:39 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-07 15:19:39 -0700 |
| commit | aff3a066575f4bfa429f67a5104a1fcffc5f326e (patch) | |
| tree | 975c8cf984e97d818ebf530b68a246f4a4b1aefb /grapher/Layouts/OptionLayout.cs | |
| parent | Pass args by ref for setting (diff) | |
| download | rawaccel-aff3a066575f4bfa429f67a5104a1fcffc5f326e.tar.xz rawaccel-aff3a066575f4bfa429f67a5104a1fcffc5f326e.zip | |
Refactor type options
Diffstat (limited to 'grapher/Layouts/OptionLayout.cs')
| -rw-r--r-- | grapher/Layouts/OptionLayout.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/grapher/Layouts/OptionLayout.cs b/grapher/Layouts/OptionLayout.cs new file mode 100644 index 0000000..2f29706 --- /dev/null +++ b/grapher/Layouts/OptionLayout.cs @@ -0,0 +1,41 @@ +using grapher.Models.Options; + +namespace grapher.Layouts +{ + public class OptionLayout + { + #region Constructors + + public OptionLayout(bool show, string name) + { + Show = show; + Name = name; + } + + #endregion Constructors + + #region Properties + + private bool Show { get; } + + private string Name { get; } + + #endregion Properties + + #region Methods + + public void Layout(IOption option) + { + if (Show) + { + option.Show(Name); + } + else + { + option.Hide(); + } + } + + #endregion Methods + } +} |