From a06ad8f011cdd70499cd053172d5dcbe0b34aa6a Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 19 Aug 2020 19:45:22 +0200 Subject: [PATCH] Marked all service implementations as internal Core - Enabled XML docs Modules - Added DI to module VMs --- src/Artemis.Core/Artemis.Core.csproj | 6 ++- src/Artemis.Core/Constants.cs | 6 ++- src/Artemis.Core/Ninject/CoreModule.cs | 4 ++ src/Artemis.Core/Plugins/Abstract/Module.cs | 6 +-- src/Artemis.Core/Plugins/Modules/ModuleTab.cs | 43 +++++++++++++++++++ .../ProcessActivationRequirement.cs | 7 +-- src/Artemis.Core/Services/CoreService.cs | 12 ++++-- src/Artemis.Core/Services/DataModelService.cs | 4 +- src/Artemis.Core/Services/DeviceService.cs | 2 +- src/Artemis.Core/Services/ModuleService.cs | 2 +- src/Artemis.Core/Services/PluginService.cs | 4 +- .../Services/RenderElementService.cs | 2 +- src/Artemis.Core/Services/RgbService.cs | 4 +- src/Artemis.Core/Services/SettingsService.cs | 9 +++- .../Services/Storage/ProfileService.cs | 5 ++- src/Artemis.Core/Utilities/IntroAnimation.cs | 3 +- .../Artemis.UI.Shared.csproj | 8 +++- .../Ninject/SharedUIModule.cs | 2 + .../Services/DataModelVisualizationService.cs | 2 +- .../Services/Dialog/DialogService.cs | 2 +- .../Services/GradientPickerService.cs | 2 +- .../Services/ProfileEditorService.cs | 2 +- src/Artemis.UI/Artemis.UI.csproj | 2 +- .../Screens/Module/ModuleRootViewModel.cs | 21 +++++++-- .../ProfileEditor/ProfileEditorViewModel.cs | 1 + .../Artemis.Plugins.LayerBrushes.Noise.csproj | 2 +- ...Artemis.Plugins.LayerEffects.Filter.csproj | 2 +- .../Artemis.Plugins.Modules.General.csproj | 2 +- .../GeneralModule.cs | 13 +++--- 29 files changed, 134 insertions(+), 46 deletions(-) create mode 100644 src/Artemis.Core/Plugins/Modules/ModuleTab.cs rename src/Artemis.Core/Plugins/{ModuleActivationRequirements => Modules}/ProcessActivationRequirement.cs (86%) diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index 7ab16b561..c3f3f14da 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -16,6 +16,7 @@ x64 + bin\AnyCPU\Debug\Artemis.Core.xml 2.0-{chash:6} @@ -27,6 +28,9 @@ git true + + bin\AnyCPU\Release\Artemis.Core.xml + false @@ -46,7 +50,7 @@ - + diff --git a/src/Artemis.Core/Constants.cs b/src/Artemis.Core/Constants.cs index 2a8ab7398..acdbddc91 100644 --- a/src/Artemis.Core/Constants.cs +++ b/src/Artemis.Core/Constants.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using System.IO; -using System.Windows.Interop; using Artemis.Core.Plugins.Models; namespace Artemis.Core { + /// + /// A few useful constant values + /// public static class Constants { /// @@ -68,7 +70,7 @@ namespace Artemis.Core { typeof(float), typeof(double), - typeof(decimal) + typeof(decimal) }; } } \ No newline at end of file diff --git a/src/Artemis.Core/Ninject/CoreModule.cs b/src/Artemis.Core/Ninject/CoreModule.cs index 2d5169aad..9583369cc 100644 --- a/src/Artemis.Core/Ninject/CoreModule.cs +++ b/src/Artemis.Core/Ninject/CoreModule.cs @@ -24,6 +24,7 @@ namespace Artemis.Core.Ninject Kernel.Bind(x => { x.FromThisAssembly() + .IncludingNonPublicTypes() .SelectAllClasses() .InheritedFrom() .BindAllInterfaces() @@ -34,6 +35,7 @@ namespace Artemis.Core.Ninject Kernel.Bind(x => { x.FromThisAssembly() + .IncludingNonPublicTypes() .SelectAllClasses() .InheritedFrom() .BindAllInterfaces() @@ -68,6 +70,7 @@ namespace Artemis.Core.Ninject Kernel.Bind(x => { x.FromAssemblyContaining() + .IncludingNonPublicTypes() .SelectAllClasses() .InheritedFrom() .BindAllInterfaces() @@ -78,6 +81,7 @@ namespace Artemis.Core.Ninject Kernel.Bind(x => { x.FromAssemblyContaining() + .IncludingNonPublicTypes() .SelectAllClasses() .InheritedFrom() .BindAllInterfaces() diff --git a/src/Artemis.Core/Plugins/Abstract/Module.cs b/src/Artemis.Core/Plugins/Abstract/Module.cs index f008f4b7c..dd4754745 100644 --- a/src/Artemis.Core/Plugins/Abstract/Module.cs +++ b/src/Artemis.Core/Plugins/Abstract/Module.cs @@ -5,7 +5,7 @@ using Artemis.Core.Models.Surface; using Artemis.Core.Plugins.Abstract.DataModels; using Artemis.Core.Plugins.Abstract.DataModels.Attributes; using Artemis.Core.Plugins.Abstract.ViewModels; -using Artemis.Core.Plugins.ModuleActivationRequirements; +using Artemis.Core.Plugins.Modules; using Artemis.Storage.Entities.Module; using SkiaSharp; @@ -134,10 +134,10 @@ namespace Artemis.Core.Plugins.Abstract public abstract void Render(double deltaTime, ArtemisSurface surface, SKCanvas canvas, SKImageInfo canvasInfo); /// - /// Called when the module's view model is being show, return view models here to create tabs for them + /// Called when the module's view model is being show, return a list of module tabs here if you want them to show up in the UI /// /// - public abstract IEnumerable GetViewModels(); + public abstract IEnumerable GetModuleTabs(); /// /// Called when the are met diff --git a/src/Artemis.Core/Plugins/Modules/ModuleTab.cs b/src/Artemis.Core/Plugins/Modules/ModuleTab.cs new file mode 100644 index 000000000..328a6045f --- /dev/null +++ b/src/Artemis.Core/Plugins/Modules/ModuleTab.cs @@ -0,0 +1,43 @@ +using System; +using Artemis.Core.Plugins.Abstract; +using Artemis.Core.Plugins.Abstract.ViewModels; + +namespace Artemis.Core.Plugins.Modules +{ + /// + public class ModuleTab : ModuleTab where T : ModuleViewModel + { + /// + /// Initializes a new instance of the class + /// + /// The title of the tab + public ModuleTab(string title) + { + Title = title; + } + + /// + public override Type Type => typeof(T); + } + + /// + /// Describes a UI tab for a specific module + /// + public abstract class ModuleTab + { + /// + /// The module this tab belongs to + /// + internal Module Module { get; set; } + + /// + /// The title of the tab + /// + public string Title { get; protected set; } + + /// + /// The type of view model the tab contains + /// + public abstract Type Type { get; } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Plugins/ModuleActivationRequirements/ProcessActivationRequirement.cs b/src/Artemis.Core/Plugins/Modules/ProcessActivationRequirement.cs similarity index 86% rename from src/Artemis.Core/Plugins/ModuleActivationRequirements/ProcessActivationRequirement.cs rename to src/Artemis.Core/Plugins/Modules/ProcessActivationRequirement.cs index 87cd32dbf..b4c924300 100644 --- a/src/Artemis.Core/Plugins/ModuleActivationRequirements/ProcessActivationRequirement.cs +++ b/src/Artemis.Core/Plugins/Modules/ProcessActivationRequirement.cs @@ -1,12 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.IO; using System.Linq; -using System.Text; using Artemis.Core.Extensions; -namespace Artemis.Core.Plugins.ModuleActivationRequirements +namespace Artemis.Core.Plugins.Modules { public class ProcessActivationRequirement : IModuleActivationRequirement { diff --git a/src/Artemis.Core/Services/CoreService.cs b/src/Artemis.Core/Services/CoreService.cs index b645d7227..d69df8d80 100644 --- a/src/Artemis.Core/Services/CoreService.cs +++ b/src/Artemis.Core/Services/CoreService.cs @@ -27,7 +27,7 @@ namespace Artemis.Core.Services /// /// Provides Artemis's core update loop /// - public class CoreService : ICoreService + internal class CoreService : ICoreService { private readonly Stopwatch _frameStopWatch; private readonly ILogger _logger; @@ -41,7 +41,7 @@ namespace Artemis.Core.Services private IntroAnimation _introAnimation; // ReSharper disable once UnusedParameter.Local - Storage migration service is injected early to ensure it runs before anything else - internal CoreService(ILogger logger, StorageMigrationService _, ISettingsService settingsService, IPluginService pluginService, + public CoreService(ILogger logger, StorageMigrationService _, ISettingsService settingsService, IPluginService pluginService, IRgbService rgbService, ISurfaceService surfaceService, IProfileService profileService, IModuleService moduleService) { _logger = logger; @@ -173,7 +173,10 @@ namespace Artemis.Core.Services List modules; lock (_modules) { - modules = _modules.Where(m => m.IsActivated).OrderByDescending(m => m.PriorityCategory).ThenByDescending(m => m.Priority).ToList(); + modules = _modules.Where(m => m.IsActivated || m.InternalExpandsMainDataModel) + .OrderByDescending(m => m.PriorityCategory) + .ThenByDescending(m => m.Priority) + .ToList(); } // Update all active modules @@ -194,7 +197,8 @@ namespace Artemis.Core.Services canvas.Clear(new SKColor(0, 0, 0)); if (!ModuleRenderingDisabled) { - foreach (var module in modules) + // While non-activated modules may be updated above if they expand the main data model, they may never render + foreach (var module in modules.Where(m => m.IsActivated)) module.Render(args.DeltaTime, _surfaceService.ActiveSurface, canvas, _rgbService.BitmapBrush.Bitmap.Info); } diff --git a/src/Artemis.Core/Services/DataModelService.cs b/src/Artemis.Core/Services/DataModelService.cs index 60720b227..a8086c18d 100644 --- a/src/Artemis.Core/Services/DataModelService.cs +++ b/src/Artemis.Core/Services/DataModelService.cs @@ -20,14 +20,14 @@ namespace Artemis.Core.Services /// /// Provides access to the main data model /// - public class DataModelService : IDataModelService + internal class DataModelService : IDataModelService { private readonly List _dataModelExpansions; private readonly IPluginService _pluginService; private readonly ILogger _logger; private readonly List _registeredConditionOperators; - internal DataModelService(IPluginService pluginService, ILogger logger) + public DataModelService(IPluginService pluginService, ILogger logger) { _pluginService = pluginService; _logger = logger; diff --git a/src/Artemis.Core/Services/DeviceService.cs b/src/Artemis.Core/Services/DeviceService.cs index fab36dec0..3929d5851 100644 --- a/src/Artemis.Core/Services/DeviceService.cs +++ b/src/Artemis.Core/Services/DeviceService.cs @@ -6,7 +6,7 @@ using SkiaSharp; namespace Artemis.Core.Services { - public class DeviceService : IDeviceService + internal class DeviceService : IDeviceService { private readonly ICoreService _coreService; diff --git a/src/Artemis.Core/Services/ModuleService.cs b/src/Artemis.Core/Services/ModuleService.cs index 76a9a39df..0e9166fd2 100644 --- a/src/Artemis.Core/Services/ModuleService.cs +++ b/src/Artemis.Core/Services/ModuleService.cs @@ -10,7 +10,7 @@ using Serilog; namespace Artemis.Core.Services { - public class ModuleService : IModuleService + internal class ModuleService : IModuleService { private readonly ILogger _logger; private readonly IModuleRepository _moduleRepository; diff --git a/src/Artemis.Core/Services/PluginService.cs b/src/Artemis.Core/Services/PluginService.cs index db09b13f2..1bc59c87a 100644 --- a/src/Artemis.Core/Services/PluginService.cs +++ b/src/Artemis.Core/Services/PluginService.cs @@ -26,7 +26,7 @@ namespace Artemis.Core.Services /// /// Provides access to plugin loading and unloading /// - public class PluginService : IPluginService + internal class PluginService : IPluginService { private readonly IKernel _kernel; private readonly ILogger _logger; @@ -34,7 +34,7 @@ namespace Artemis.Core.Services private readonly List _plugins; private IKernel _childKernel; - internal PluginService(IKernel kernel, ILogger logger, IPluginRepository pluginRepository) + public PluginService(IKernel kernel, ILogger logger, IPluginRepository pluginRepository) { _kernel = kernel; _logger = logger; diff --git a/src/Artemis.Core/Services/RenderElementService.cs b/src/Artemis.Core/Services/RenderElementService.cs index ef4d68dfa..263e7a04c 100644 --- a/src/Artemis.Core/Services/RenderElementService.cs +++ b/src/Artemis.Core/Services/RenderElementService.cs @@ -15,7 +15,7 @@ using Serilog; namespace Artemis.Core.Services { - public class RenderElementService : IRenderElementService + internal class RenderElementService : IRenderElementService { private readonly IKernel _kernel; private readonly ILogger _logger; diff --git a/src/Artemis.Core/Services/RgbService.cs b/src/Artemis.Core/Services/RgbService.cs index 3c8505d0e..667eceb33 100644 --- a/src/Artemis.Core/Services/RgbService.cs +++ b/src/Artemis.Core/Services/RgbService.cs @@ -14,7 +14,7 @@ namespace Artemis.Core.Services /// /// Provides wrapped access the RGB.NET /// - public class RgbService : IRgbService, IDisposable + internal class RgbService : IRgbService, IDisposable { private readonly List _loadedDevices; private readonly ILogger _logger; @@ -23,7 +23,7 @@ namespace Artemis.Core.Services private readonly PluginSetting _targetFrameRateSetting; private ListLedGroup _surfaceLedGroup; - internal RgbService(ILogger logger, ISettingsService settingsService) + public RgbService(ILogger logger, ISettingsService settingsService) { _logger = logger; _renderScaleSetting = settingsService.GetSetting("Core.RenderScale", 0.5); diff --git a/src/Artemis.Core/Services/SettingsService.cs b/src/Artemis.Core/Services/SettingsService.cs index 86dcf6100..b74351c91 100644 --- a/src/Artemis.Core/Services/SettingsService.cs +++ b/src/Artemis.Core/Services/SettingsService.cs @@ -5,7 +5,7 @@ using Artemis.Storage.Repositories.Interfaces; namespace Artemis.Core.Services { /// - public class SettingsService : ISettingsService + internal class SettingsService : ISettingsService { private readonly PluginSettings _pluginSettings; @@ -26,6 +26,13 @@ namespace Artemis.Core.Services /// public interface ISettingsService : IProtectedArtemisService { + /// + /// Gets the setting with the provided name. If the setting does not exist yet, it is created. + /// + /// The type of the setting, can be any serializable type + /// The name of the setting + /// The default value to use if the setting does not exist yet + /// PluginSetting GetSetting(string name, T defaultValue = default); } } \ No newline at end of file diff --git a/src/Artemis.Core/Services/Storage/ProfileService.cs b/src/Artemis.Core/Services/Storage/ProfileService.cs index e79e8f450..1edae26ef 100644 --- a/src/Artemis.Core/Services/Storage/ProfileService.cs +++ b/src/Artemis.Core/Services/Storage/ProfileService.cs @@ -17,7 +17,7 @@ using Serilog; namespace Artemis.Core.Services.Storage { - public class ProfileService : IProfileService + internal class ProfileService : IProfileService { private readonly ILogger _logger; private readonly IPluginService _pluginService; @@ -59,7 +59,8 @@ namespace Artemis.Core.Services.Storage public void ActivateLastProfile(ProfileModule profileModule) { var activeProfile = GetLastActiveProfile(profileModule); - ActivateProfile(activeProfile); + if (activeProfile != null) + ActivateProfile(activeProfile); } public Profile ActivateProfile(ProfileDescriptor profileDescriptor) diff --git a/src/Artemis.Core/Utilities/IntroAnimation.cs b/src/Artemis.Core/Utilities/IntroAnimation.cs index 879e6d9a4..76dae9def 100644 --- a/src/Artemis.Core/Utilities/IntroAnimation.cs +++ b/src/Artemis.Core/Utilities/IntroAnimation.cs @@ -6,6 +6,7 @@ using Artemis.Core.Extensions; using Artemis.Core.Models.Profile; using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract.ViewModels; +using Artemis.Core.Plugins.Modules; using Artemis.Core.Services.Storage.Interfaces; using Artemis.Storage.Entities.Profile; using Newtonsoft.Json; @@ -91,7 +92,7 @@ namespace Artemis.Core.Utilities throw new NotImplementedException(); } - public override IEnumerable GetViewModels() + public override IEnumerable GetModuleTabs() { throw new NotImplementedException(); } diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj index 5abaccfd3..b4ef8e4c5 100644 --- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj @@ -29,6 +29,12 @@ true 2.0.0 + + bin\AnyCPU\Debug\Artemis.UI.Shared.xml + + + bin\AnyCPU\Release\Artemis.UI.Shared.xml + @@ -39,7 +45,7 @@ - + diff --git a/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs b/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs index 4621065a0..6688d869c 100644 --- a/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs +++ b/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs @@ -19,6 +19,7 @@ namespace Artemis.UI.Shared.Ninject Kernel.Bind(x => { x.FromAssemblyContaining() + .IncludingNonPublicTypes() .SelectAllInterfaces() .InheritedFrom() .BindToFactory(); @@ -28,6 +29,7 @@ namespace Artemis.UI.Shared.Ninject Kernel.Bind(x => { x.FromAssemblyContaining() + .IncludingNonPublicTypes() .SelectAllClasses() .InheritedFrom() .BindAllInterfaces() diff --git a/src/Artemis.UI.Shared/Services/DataModelVisualizationService.cs b/src/Artemis.UI.Shared/Services/DataModelVisualizationService.cs index 482720f00..87d82bc6e 100644 --- a/src/Artemis.UI.Shared/Services/DataModelVisualizationService.cs +++ b/src/Artemis.UI.Shared/Services/DataModelVisualizationService.cs @@ -18,7 +18,7 @@ using Stylet; namespace Artemis.UI.Shared.Services { - public class DataModelVisualizationService : IDataModelVisualizationService + internal class DataModelVisualizationService : IDataModelVisualizationService { private readonly IDataModelService _dataModelService; private readonly IKernel _kernel; diff --git a/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs b/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs index 709642114..12ad0dda0 100644 --- a/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs +++ b/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs @@ -12,7 +12,7 @@ using Stylet; namespace Artemis.UI.Shared.Services.Dialog { - public class DialogService : IDialogService + internal class DialogService : IDialogService { private readonly IKernel _kernel; private readonly IViewManager _viewManager; diff --git a/src/Artemis.UI.Shared/Services/GradientPickerService.cs b/src/Artemis.UI.Shared/Services/GradientPickerService.cs index e25489e41..17ca070b4 100644 --- a/src/Artemis.UI.Shared/Services/GradientPickerService.cs +++ b/src/Artemis.UI.Shared/Services/GradientPickerService.cs @@ -6,7 +6,7 @@ using Artemis.UI.Shared.Services.Interfaces; namespace Artemis.UI.Shared.Services { - public class GradientPickerService : IGradientPickerService + internal class GradientPickerService : IGradientPickerService { private readonly IDialogService _dialogService; diff --git a/src/Artemis.UI.Shared/Services/ProfileEditorService.cs b/src/Artemis.UI.Shared/Services/ProfileEditorService.cs index ecbd0a28d..2a38b64ec 100644 --- a/src/Artemis.UI.Shared/Services/ProfileEditorService.cs +++ b/src/Artemis.UI.Shared/Services/ProfileEditorService.cs @@ -15,7 +15,7 @@ using Serilog; namespace Artemis.UI.Shared.Services { - public class ProfileEditorService : IProfileEditorService + internal class ProfileEditorService : IProfileEditorService { private readonly ILogger _logger; private readonly IProfileService _profileService; diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index 67ac10f68..ff5e11035 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -136,7 +136,7 @@ - + diff --git a/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs b/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs index c0f230cf4..907e0c2e9 100644 --- a/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs @@ -1,7 +1,10 @@ using System.Linq; using System.Threading.Tasks; using Artemis.Core.Plugins.Abstract; +using Artemis.Core.Plugins.Abstract.ViewModels; using Artemis.UI.Ninject.Factories; +using Ninject; +using Ninject.Parameters; using Stylet; namespace Artemis.UI.Screens.Module @@ -9,13 +12,15 @@ namespace Artemis.UI.Screens.Module public class ModuleRootViewModel : Conductor.Collection.OneActive { private readonly IProfileEditorVmFactory _profileEditorVmFactory; + private readonly IKernel _kernel; - public ModuleRootViewModel(Core.Plugins.Abstract.Module module, IProfileEditorVmFactory profileEditorVmFactory) + public ModuleRootViewModel(Core.Plugins.Abstract.Module module, IProfileEditorVmFactory profileEditorVmFactory, IKernel kernel) { DisplayName = module?.DisplayName; Module = module; _profileEditorVmFactory = profileEditorVmFactory; + _kernel = kernel; Task.Run(AddTabsAsync); } @@ -34,8 +39,18 @@ namespace Artemis.UI.Screens.Module Items.Add(profileEditor); } - var moduleViewModels = Module.GetViewModels(); - Items.AddRange(moduleViewModels); + var moduleTabs = Module.GetModuleTabs(); + if (moduleTabs != null) + { + foreach (var moduleTab in moduleTabs.Where(m => m != null)) + { + var module = new ConstructorArgument("module", Module); + var displayName = new ConstructorArgument("displayName", DisplayName); + + var viewModel = (ModuleViewModel) _kernel.Get(moduleTab.Type, module, displayName); + Items.Add(viewModel); + } + } ActiveItem = Items.FirstOrDefault(); } diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs index 42e8cfad0..9a4a0624b 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs @@ -233,6 +233,7 @@ namespace Artemis.UI.Screens.ProfileEditor LoadWorkspaceSettings(); Module.IsProfileUpdatingDisabled = true; Module.ActiveProfileChanged += ModuleOnActiveProfileChanged; + Execute.PostToUIThread(LoadProfiles); base.OnInitialActivate(); } diff --git a/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj b/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj index 840db3461..91acfd21b 100644 --- a/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj +++ b/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/Artemis.Plugins.LayerEffects.Filter.csproj b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/Artemis.Plugins.LayerEffects.Filter.csproj index 5daba2276..7f7eb1ddc 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/Artemis.Plugins.LayerEffects.Filter.csproj +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/Artemis.Plugins.LayerEffects.Filter.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Plugins/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj b/src/Plugins/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj index f2d8420b8..1f6012739 100644 --- a/src/Plugins/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj +++ b/src/Plugins/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs b/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs index 9eda911f1..5fe8c4113 100644 --- a/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs +++ b/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract.ViewModels; +using Artemis.Core.Plugins.Modules; using Artemis.Plugins.Modules.General.DataModel; using Artemis.Plugins.Modules.General.DataModel.Windows; using Artemis.Plugins.Modules.General.Utilities; @@ -18,10 +19,10 @@ namespace Artemis.Plugins.Modules.General DisplayIcon = "AllInclusive"; ExpandsDataModel = true; - DataModel.TestTimeList.Add(new TimeDataModel { CurrentTime = DateTime.Now.AddDays(1), CurrentTimeUTC = DateTime.UtcNow.AddDays(1) }); - DataModel.TestTimeList.Add(new TimeDataModel { CurrentTime = DateTime.Now.AddDays(2), CurrentTimeUTC = DateTime.UtcNow.AddDays(2) }); - DataModel.TestTimeList.Add(new TimeDataModel { CurrentTime = DateTime.Now.AddDays(3), CurrentTimeUTC = DateTime.UtcNow.AddDays(3) }); - DataModel.TestTimeList.Add(new TimeDataModel { CurrentTime = DateTime.Now.AddDays(4), CurrentTimeUTC = DateTime.UtcNow.AddDays(4) }); + DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTime.Now.AddDays(1), CurrentTimeUTC = DateTime.UtcNow.AddDays(1)}); + DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTime.Now.AddDays(2), CurrentTimeUTC = DateTime.UtcNow.AddDays(2)}); + DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTime.Now.AddDays(3), CurrentTimeUTC = DateTime.UtcNow.AddDays(3)}); + DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTime.Now.AddDays(4), CurrentTimeUTC = DateTime.UtcNow.AddDays(4)}); } public override void DisablePlugin() @@ -45,9 +46,9 @@ namespace Artemis.Plugins.Modules.General base.Update(deltaTime); } - public override IEnumerable GetViewModels() + public override IEnumerable GetModuleTabs() { - return new List { new GeneralViewModel(this) }; + return new List {new ModuleTab("General")}; } #region Open windows