From ee88fc31d9b1b8f4782c7103d91de2d1b11c211b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 13 Feb 2018 19:41:19 +0200 Subject: Implemented StudioModuleBase. --- .../Tango.MachineStudio.Common/StudioModuleBase.cs | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs new file mode 100644 index 000000000..a773adf8b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Integration.Observables; + +namespace Tango.MachineStudio.Common +{ + /// + /// Represents a base class for studio modules. + /// + /// + public abstract class StudioModuleBase : IStudioModule + { + private bool _isInitialized; + private bool _isLoaded; + + /// + /// Occurs when the user has navigated into or out of this module. + /// + public event EventHandler IsLoadedChanged; + + /// + /// Gets the module name. + /// + public abstract string Name { get; } + + /// + /// Gets the module description. + /// + public abstract string Description { get; } + + /// + /// Gets the module cover image. + /// + public abstract BitmapSource Image { get; } + + /// + /// Gets the module entry point view. + /// + public abstract FrameworkElement MainView { get; } + + /// + /// Gets the permission required to see and load this module. + /// + public abstract Permissions Permission { get; } + + /// + /// Gets a value indicating whether this module has been initialized. + /// + public bool IsInitialized + { + get + { + return _isInitialized; + } + protected set + { + _isInitialized = value; + } + } + + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded + { + get + { + return _isLoaded; + } + set + { + _isLoaded = value; + IsLoadedChanged?.Invoke(this, value); + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public abstract void Dispose(); + + /// + /// Perform any operations required to initialize this module. + /// + public abstract void Initialize(); + } +} -- cgit v1.3.1