From b4e54c9edf553cd07c35c7903e2ad7cc6c74b46b Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Sun, 20 Jul 2025 11:24:04 +1000 Subject: [PATCH] qol: simplify accessors --- Disco.BI/BI/Interop/Pdf/Utilities.cs | 2 +- Disco.ClientBootstrapper/IStatus.cs | 2 +- .../Interop/InstallInterop.cs | 12 ++++----- .../DiscoDatabaseConnectionFactory.cs | 2 +- .../Jobs/JobLists/JobTableItemModel.cs | 2 +- .../ConfigAuthorizationRoleCreateModel.cs | 2 +- .../ConfigDeviceBatchCreateModel.cs | 2 +- .../ConfigDeviceBatchShowModelMembership.cs | 2 +- .../ConfigDeviceModelComponentsModel.cs | 4 +-- .../DeviceModel/ConfigDeviceModelShowModel.cs | 2 +- .../ConfigDeviceProfileCreateModel.cs | 2 +- .../ConfigDeviceProfileDefaultsModel.cs | 4 +-- .../ConfigDeviceProfileIndexModelItem.cs | 2 +- ...figDocumentTemplateUndetectedPagesModel.cs | 2 +- .../JobQueue/ConfigJobQueueShowModel.cs | 2 +- .../UI/Device/DeviceAddOfflineModel.cs | 6 ++--- Disco.Models/UI/Device/DeviceShowModel.cs | 8 +++--- Disco.Models/UI/Job/JobCreateModel.cs | 6 ++--- Disco.Models/UI/User/UserShowModel.cs | 2 +- .../Authorization/AuthorizationLog.cs | 2 +- .../Authorization/AuthorizationToken.cs | 26 +++++++++---------- .../Authorization/ClaimNavigatorItem.cs | 2 +- .../Devices/DeviceDataStoreExtensions.cs | 2 +- .../Devices/Enrolment/EnrolmentLog.cs | 2 +- .../Devices/Enrolment/MacDeviceEnrolment.cs | 2 +- Disco.Services/Documents/DocumentsLog.cs | 2 +- .../Expressions/Extensions/ImageExt.cs | 2 +- Disco.Services/Extensions/UIHelpers.cs | 8 +++--- .../ActiveDirectory/ActiveDirectory.cs | 4 +-- Disco.Services/Logging/Models/LogLiveEvent.cs | 6 ++--- .../Logging/Persistance/LogPersistContext.cs | 2 +- Disco.Services/Logging/ReadLogContext.cs | 4 +-- .../CertificateProviderLog.cs | 2 +- .../RepairProvider/RepairProviderFeature.cs | 4 +-- .../Results/PrecompiledPartialViewResult.cs | 2 +- Disco.Services/Plugins/PluginExtensions.cs | 8 +++--- Disco.Services/Plugins/PluginWebViewPage.cs | 2 +- Disco.Services/Plugins/PluginsLog.cs | 6 ++--- Disco.Services/Plugins/WebPageHelper.cs | 2 +- Disco.Services/Tasks/ScheduledTaskStatus.cs | 2 +- Disco.Services/Tasks/ScheduledTasksLog.cs | 6 ++--- .../API/Controllers/ActivationController.cs | 2 +- .../AuthorizationRoleController.cs | 2 +- .../API/Controllers/DeviceBatchController.cs | 2 +- .../Controllers/DeviceProfileController.cs | 2 +- .../Controllers/DocumentTemplateController.cs | 6 ++--- .../DocumentTemplatePackageController.cs | 2 +- .../API/Controllers/JobQueueController.cs | 22 ++++++++-------- .../API/Controllers/JobQueueJobController.cs | 14 +++++----- .../API/Controllers/UserFlagController.cs | 12 ++++----- .../Controllers/DeviceFlagController.cs | 2 +- .../Controllers/DeviceProfileController.cs | 6 ++--- .../Config/Controllers/JobQueueController.cs | 2 +- .../Config/Controllers/PluginsController.cs | 4 +-- .../Config/Controllers/UserFlagController.cs | 8 +++--- .../Config/Models/Expressions/EditorModel.cs | 2 +- Disco.Web/Extensions/HtmlExtensions.cs | 4 +-- Disco.Web/Extensions/T4MVC/T4MVCExtensions.cs | 2 +- Disco.Web/Global.asax.cs | 2 +- Disco.Web/Models/Job/LogRepairModel.cs | 2 +- Disco.Web/Models/Job/LogWarrantyModel.cs | 2 +- 61 files changed, 132 insertions(+), 132 deletions(-) diff --git a/Disco.BI/BI/Interop/Pdf/Utilities.cs b/Disco.BI/BI/Interop/Pdf/Utilities.cs index 06274bf4..f61637b7 100644 --- a/Disco.BI/BI/Interop/Pdf/Utilities.cs +++ b/Disco.BI/BI/Interop/Pdf/Utilities.cs @@ -17,7 +17,7 @@ namespace Disco.BI.Interop.Pdf public static Stream JoinPdfs(bool InsertBlankPages, List Pdfs) { if (Pdfs.Count == 0) - throw new System.ArgumentNullException(nameof(Pdfs)); + throw new ArgumentNullException(nameof(Pdfs)); // Only One PDF - Possible Reference Bug v's Memory/Speed (Returning Param Memory Stream) if (Pdfs.Count == 1) diff --git a/Disco.ClientBootstrapper/IStatus.cs b/Disco.ClientBootstrapper/IStatus.cs index 6d680fbd..fcc630d1 100644 --- a/Disco.ClientBootstrapper/IStatus.cs +++ b/Disco.ClientBootstrapper/IStatus.cs @@ -4,6 +4,6 @@ namespace Disco.ClientBootstrapper { interface IStatus { - void UpdateStatus(string Heading, string SubHeading, string Message, Nullable ShowProgress = null, Nullable Progress = null); + void UpdateStatus(string Heading, string SubHeading, string Message, bool? ShowProgress = null, int? Progress = null); } } diff --git a/Disco.ClientBootstrapper/Interop/InstallInterop.cs b/Disco.ClientBootstrapper/Interop/InstallInterop.cs index 5f18a46b..9e37c1c9 100644 --- a/Disco.ClientBootstrapper/Interop/InstallInterop.cs +++ b/Disco.ClientBootstrapper/Interop/InstallInterop.cs @@ -198,7 +198,7 @@ namespace Disco.ClientBootstrapper.Interop // Mount WIM int wimImageIndex = 0; - using (var wim = new Interop.WIMInterop.WindowsImageContainer(InstallLocation, WIMInterop.WindowsImageContainer.CreateFileMode.OpenExisting, WIMInterop.WindowsImageContainer.CreateFileAccess.Write)) + using (var wim = new WIMInterop.WindowsImageContainer(InstallLocation, WIMInterop.WindowsImageContainer.CreateFileMode.OpenExisting, WIMInterop.WindowsImageContainer.CreateFileAccess.Write)) { if (WimImageId == null) WimImageId = "1"; @@ -241,13 +241,13 @@ namespace Disco.ClientBootstrapper.Interop Directory.CreateDirectory(wimTempMountPath); bool wimCommitChanges = true; - Interop.WIMInterop.WindowsImageContainer.NativeMethods.MessageCallback m_MessageCallback = null; + WIMInterop.WindowsImageContainer.NativeMethods.MessageCallback m_MessageCallback = null; try { // Mount WIM Program.Status.UpdateStatus(null, "Mounting WIM", string.Format("Mounting WIM Image to '{0}'", wimMountPath)); Program.SleepThread(500, false); - m_MessageCallback = new Interop.WIMInterop.WindowsImageContainer.NativeMethods.MessageCallback(WimImageEventMessagePump); + m_MessageCallback = new WIMInterop.WindowsImageContainer.NativeMethods.MessageCallback(WimImageEventMessagePump); Interop.WIMInterop.WindowsImageContainer.NativeMethods.RegisterCallback(m_MessageCallback); Interop.WIMInterop.WindowsImageContainer.NativeMethods.MountImage(wimMountPath, InstallLocation, wimImageIndex, wimTempMountPath); @@ -256,7 +256,7 @@ namespace Disco.ClientBootstrapper.Interop var wimHivePath = Path.Combine(wimMountPath, "Windows\\System32\\config\\SOFTWARE"); Program.Status.UpdateStatus(null, "Mounting Offline Registry Hive", string.Format("Mounting Offline Registry Hive at '{0}'", wimHivePath)); Program.SleepThread(500, false); - using (var wimReg = new Interop.RegistryInterop(RegistryInterop.RegistryHives.HKEY_LOCAL_MACHINE, "DiscoClientBootstrapperWimHive", wimHivePath)) + using (var wimReg = new RegistryInterop(RegistryInterop.RegistryHives.HKEY_LOCAL_MACHINE, "DiscoClientBootstrapperWimHive", wimHivePath)) { using (RegistryKey rootRegistryLocation = Registry.LocalMachine.OpenSubKey("DiscoClientBootstrapperWimHive", true)) { @@ -322,11 +322,11 @@ namespace Disco.ClientBootstrapper.Interop ) { uint status = (uint)Interop.WIMInterop.WindowsImageContainer.NativeMethods.WIMMessage.WIM_MSG_SUCCESS; - Interop.WIMInterop.DefaultImageEventArgs eventArgs = new Interop.WIMInterop.DefaultImageEventArgs(wParam, lParam, UserData); + WIMInterop.DefaultImageEventArgs eventArgs = new WIMInterop.DefaultImageEventArgs(wParam, lParam, UserData); //System.Diagnostics.Debug.WriteLine(MessageId); - switch ((Interop.WIMInterop.WindowsImageContainer.ImageEventMessage)MessageId) + switch ((WIMInterop.WindowsImageContainer.ImageEventMessage)MessageId) { case Interop.WIMInterop.WindowsImageContainer.ImageEventMessage.Progress: diff --git a/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs b/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs index 47d575e9..cfb9e1ec 100644 --- a/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs +++ b/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs @@ -59,7 +59,7 @@ namespace Disco.Data.Repository this.SqlCeConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0"); } - public System.Data.Common.DbConnection CreateConnection(string nameOrConnectionString) + public DbConnection CreateConnection(string nameOrConnectionString) { if (nameOrConnectionString == "Disco.Data.Repository.DiscoDataContext") { diff --git a/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs b/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs index ed161ef7..f400bdf5 100644 --- a/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs +++ b/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs @@ -37,7 +37,7 @@ namespace Disco.Models.Services.Jobs.JobLists public string StatusDescription { get; set; } public string StatusId { get; set; } public string DeviceHeldLocation { get; set; } - public Disco.Models.Repository.Job.UserManagementFlags? Flags { get; set; } + public Repository.Job.UserManagementFlags? Flags { get; set; } public DateTime LastActivityDate { get; set; } } } diff --git a/Disco.Models/UI/Config/AuthorizationRole/ConfigAuthorizationRoleCreateModel.cs b/Disco.Models/UI/Config/AuthorizationRole/ConfigAuthorizationRoleCreateModel.cs index aeecc3a0..2cddd5ec 100644 --- a/Disco.Models/UI/Config/AuthorizationRole/ConfigAuthorizationRoleCreateModel.cs +++ b/Disco.Models/UI/Config/AuthorizationRole/ConfigAuthorizationRoleCreateModel.cs @@ -2,6 +2,6 @@ { public interface ConfigAuthorizationRoleCreateModel : BaseUIModel { - Models.Repository.AuthorizationRole AuthorizationRole { get; set; } + Repository.AuthorizationRole AuthorizationRole { get; set; } } } diff --git a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchCreateModel.cs b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchCreateModel.cs index 14088226..da7c377c 100644 --- a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchCreateModel.cs +++ b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchCreateModel.cs @@ -2,6 +2,6 @@ { public interface ConfigDeviceBatchCreateModel : BaseUIModel { - Models.Repository.DeviceBatch DeviceBatch { get; set; } + Repository.DeviceBatch DeviceBatch { get; set; } } } diff --git a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModelMembership.cs b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModelMembership.cs index dc84820c..fdab02a3 100644 --- a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModelMembership.cs +++ b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModelMembership.cs @@ -2,7 +2,7 @@ { public interface ConfigDeviceBatchShowModelMembership : BaseUIModel { - Disco.Models.Repository.DeviceModel DeviceModel { get; set; } + Repository.DeviceModel DeviceModel { get; set; } int DeviceCount { get; set; } int DeviceDecommissionedCount { get; set; } } diff --git a/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelComponentsModel.cs b/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelComponentsModel.cs index 23c16741..806f5b1f 100644 --- a/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelComponentsModel.cs +++ b/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelComponentsModel.cs @@ -5,8 +5,8 @@ namespace Disco.Models.UI.Config.DeviceModel public interface ConfigDeviceModelComponentsModel : BaseUIModel { int? DeviceModelId { get; set; } - List DeviceComponents { get; set; } + List DeviceComponents { get; set; } - List JobSubTypes { get; set; } + List JobSubTypes { get; set; } } } diff --git a/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs b/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs index 79afdfdf..4500234b 100644 --- a/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs +++ b/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs @@ -4,7 +4,7 @@ namespace Disco.Models.UI.Config.DeviceModel { public interface ConfigDeviceModelShowModel : BaseUIModel, ConfigSharedDeviceGroupDocumentTemplateBulkGenerate { - Disco.Models.Repository.DeviceModel DeviceModel { get; set; } + Repository.DeviceModel DeviceModel { get; set; } ConfigDeviceModelComponentsModel DeviceComponentsModel { get; set; } diff --git a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileCreateModel.cs b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileCreateModel.cs index cafd5979..6716d411 100644 --- a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileCreateModel.cs +++ b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileCreateModel.cs @@ -2,6 +2,6 @@ { public interface ConfigDeviceProfileCreateModel : BaseUIModel { - Models.Repository.DeviceProfile DeviceProfile { get; set; } + Repository.DeviceProfile DeviceProfile { get; set; } } } diff --git a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileDefaultsModel.cs b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileDefaultsModel.cs index 8597b000..3cb797d6 100644 --- a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileDefaultsModel.cs +++ b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileDefaultsModel.cs @@ -4,8 +4,8 @@ namespace Disco.Models.UI.Config.DeviceProfile { public interface ConfigDeviceProfileDefaultsModel : BaseUIModel { - List DeviceProfiles { get; set; } - List DeviceProfilesAndNone { get; set; } + List DeviceProfiles { get; set; } + List DeviceProfilesAndNone { get; set; } int Default { get; set; } int DefaultAddDeviceOffline { get; set; } } diff --git a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileIndexModelItem.cs b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileIndexModelItem.cs index fce65f5e..df8b44c3 100644 --- a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileIndexModelItem.cs +++ b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileIndexModelItem.cs @@ -8,7 +8,7 @@ int? Address { get; set; } string AddressName { get; set; } string Description { get; set; } - Models.Repository.DeviceProfile.DistributionTypes DistributionType { get; set; } + Repository.DeviceProfile.DistributionTypes DistributionType { get; set; } int DeviceCount { get; set; } int DeviceDecommissionedCount { get; set; } diff --git a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateUndetectedPagesModel.cs b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateUndetectedPagesModel.cs index afe946c1..d373248a 100644 --- a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateUndetectedPagesModel.cs +++ b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateUndetectedPagesModel.cs @@ -4,6 +4,6 @@ namespace Disco.Models.UI.Config.DocumentTemplate { public interface ConfigDocumentTemplateUndetectedPagesModel : BaseUIModel { - List DocumentTemplates { get; set; } + List DocumentTemplates { get; set; } } } diff --git a/Disco.Models/UI/Config/JobQueue/ConfigJobQueueShowModel.cs b/Disco.Models/UI/Config/JobQueue/ConfigJobQueueShowModel.cs index 64e76751..13ac084b 100644 --- a/Disco.Models/UI/Config/JobQueue/ConfigJobQueueShowModel.cs +++ b/Disco.Models/UI/Config/JobQueue/ConfigJobQueueShowModel.cs @@ -13,7 +13,7 @@ namespace Disco.Models.UI.Config.JobQueue IEnumerable> Icons { get; set; } IEnumerable> ThemeColours { get; set; } - List JobTypes { get; set; } + List JobTypes { get; set; } bool CanDelete { get; set; } } diff --git a/Disco.Models/UI/Device/DeviceAddOfflineModel.cs b/Disco.Models/UI/Device/DeviceAddOfflineModel.cs index c43de63e..ea89172f 100644 --- a/Disco.Models/UI/Device/DeviceAddOfflineModel.cs +++ b/Disco.Models/UI/Device/DeviceAddOfflineModel.cs @@ -4,9 +4,9 @@ namespace Disco.Models.UI.Device { public interface DeviceAddOfflineModel : BaseUIModel { - Disco.Models.Repository.Device Device { get; set; } - List DeviceProfiles { get; set; } - List DeviceBatches { get; set; } + Repository.Device Device { get; set; } + List DeviceProfiles { get; set; } + List DeviceBatches { get; set; } int DefaultDeviceProfileId { get; set; } } } diff --git a/Disco.Models/UI/Device/DeviceShowModel.cs b/Disco.Models/UI/Device/DeviceShowModel.cs index 301cce42..eabdb6c8 100644 --- a/Disco.Models/UI/Device/DeviceShowModel.cs +++ b/Disco.Models/UI/Device/DeviceShowModel.cs @@ -10,18 +10,18 @@ namespace Disco.Models.UI.Device { Repository.Device Device { get; set; } - List DeviceProfiles { get; set; } + List DeviceProfiles { get; set; } HashSet DecommissionedDeviceProfileIds { get; set; } OrganisationAddress DeviceProfileDefaultOrganisationAddress { get; set; } - List DeviceBatches { get; set; } + List DeviceBatches { get; set; } HashSet DecommissionedDeviceBatchIds { get; set; } JobTableModel Jobs { get; set; } - List Certificates { get; set; } + List Certificates { get; set; } - List DocumentTemplates { get; set; } + List DocumentTemplates { get; set; } List DocumentTemplatePackages { get; set; } List AvailableDeviceFlags { get; set; } diff --git a/Disco.Models/UI/Job/JobCreateModel.cs b/Disco.Models/UI/Job/JobCreateModel.cs index d9480abc..373b8638 100644 --- a/Disco.Models/UI/Job/JobCreateModel.cs +++ b/Disco.Models/UI/Job/JobCreateModel.cs @@ -21,8 +21,8 @@ namespace Disco.Models.UI.Job int? QuickLogTaskTimeMinutes { get; set; } int? QuickLogTaskTimeMinutesOther { get; set; } - Disco.Models.Repository.Device Device { get; set; } - Disco.Models.Repository.User User { get; set; } - List JobTypes { get; set; } + Repository.Device Device { get; set; } + Repository.User User { get; set; } + List JobTypes { get; set; } } } diff --git a/Disco.Models/UI/User/UserShowModel.cs b/Disco.Models/UI/User/UserShowModel.cs index e2582864..5f55b181 100644 --- a/Disco.Models/UI/User/UserShowModel.cs +++ b/Disco.Models/UI/User/UserShowModel.cs @@ -8,7 +8,7 @@ namespace Disco.Models.UI.User { public interface UserShowModel : BaseUIModel { - Disco.Models.Repository.User User { get; set; } + Repository.User User { get; set; } JobTableModel Jobs { get; set; } List DocumentTemplates { get; set; } List DocumentTemplatePackages { get; set; } diff --git a/Disco.Services/Authorization/AuthorizationLog.cs b/Disco.Services/Authorization/AuthorizationLog.cs index a929b34a..12f51a63 100644 --- a/Disco.Services/Authorization/AuthorizationLog.cs +++ b/Disco.Services/Authorization/AuthorizationLog.cs @@ -34,7 +34,7 @@ namespace Disco.Services.Authorization Current.Log((int)EventTypeId, Args); } - protected override List LoadEventTypes() + protected override List LoadEventTypes() { List eventTypes = new List() { new LogEventType() { diff --git a/Disco.Services/Authorization/AuthorizationToken.cs b/Disco.Services/Authorization/AuthorizationToken.cs index 22f000ba..677a6ab6 100644 --- a/Disco.Services/Authorization/AuthorizationToken.cs +++ b/Disco.Services/Authorization/AuthorizationToken.cs @@ -68,17 +68,17 @@ namespace Disco.Services.Authorization /// /// Checks if token contains at least one of the claims requested. /// - /// Claim Keys from + /// Claim Keys from /// true if the token satisfies the claim request, otherwise false. public bool HasAny(params string[] ClaimKeys) { return HasAny((IEnumerable)ClaimKeys); } - + /// /// Checks if token contains at least one of the claims requested. /// - /// Claim Keys from + /// Claim Keys from /// true if the token satisfies the claim request, otherwise false. public bool HasAny(IEnumerable ClaimKeys) { @@ -88,7 +88,7 @@ namespace Disco.Services.Authorization /// /// Checks if token contains all the claims requested. /// - /// Claim Keys from + /// Claim Keys from /// true if the token satisfies the claim request, otherwise false. public bool HasAll(params string[] ClaimKeys) { @@ -97,7 +97,7 @@ namespace Disco.Services.Authorization /// /// Checks if token contains all the claims requested. /// - /// Claim Keys from + /// Claim Keys from /// true if the token satisfies the claim request, otherwise false. public bool HasAll(IEnumerable ClaimKeys) { @@ -107,7 +107,7 @@ namespace Disco.Services.Authorization /// /// Checks if token contains the claim requested. /// - /// Claim Key from + /// Claim Key from /// true if the token satisfies the claim request, otherwise false. public bool Has(string ClaimKey) { @@ -127,9 +127,9 @@ namespace Disco.Services.Authorization } /// - /// Validates the token contains the claim required. An is thrown if the requirements are not met. + /// Validates the token contains the claim required. An is thrown if the requirements are not met. /// - /// Claim Key from + /// Claim Key from public void Require(string ClaimKey) { if (!Has(ClaimKey)) @@ -137,19 +137,19 @@ namespace Disco.Services.Authorization } /// - /// Validates the token contains all the claims required. An is thrown if the requirements are not met. + /// Validates the token contains all the claims required. An is thrown if the requirements are not met. /// - /// Claim Keys from + /// Claim Keys from public void RequireAll(params string[] ClaimKeys) { if (!HasAll(ClaimKeys)) throw new AccessDeniedException(BuildRequireAllMessage(ClaimKeys), GetRequireResource()); } - + /// - /// Validates the token contains at least one of the claims required. An is thrown if the requirements are not met. + /// Validates the token contains at least one of the claims required. An is thrown if the requirements are not met. /// - /// Claim Keys from + /// Claim Keys from public void RequireAny(params string[] ClaimKeys) { if (!HasAny(ClaimKeys)) diff --git a/Disco.Services/Authorization/ClaimNavigatorItem.cs b/Disco.Services/Authorization/ClaimNavigatorItem.cs index 4e0383ba..3f3cec81 100644 --- a/Disco.Services/Authorization/ClaimNavigatorItem.cs +++ b/Disco.Services/Authorization/ClaimNavigatorItem.cs @@ -8,7 +8,7 @@ namespace Disco.Services.Authorization { public class ClaimNavigatorItem : IClaimNavigatorItem { - private Func accessor { get; set; } + private Func accessor { get; set; } public string Key { get; private set; } public string Name { get; private set; } diff --git a/Disco.Services/Devices/DeviceDataStoreExtensions.cs b/Disco.Services/Devices/DeviceDataStoreExtensions.cs index a14d05b7..4ca6e3f9 100644 --- a/Disco.Services/Devices/DeviceDataStoreExtensions.cs +++ b/Disco.Services/Devices/DeviceDataStoreExtensions.cs @@ -51,7 +51,7 @@ namespace Disco.Services public static string ImageFilePath(this DeviceModel deviceModel) { - var configCache = new Disco.Data.Configuration.SystemConfiguration(null); + var configCache = new Data.Configuration.SystemConfiguration(null); var deviceModelImagesDataStore = DataStore.CreateLocation(configCache, "DeviceModelImages"); diff --git a/Disco.Services/Devices/Enrolment/EnrolmentLog.cs b/Disco.Services/Devices/Enrolment/EnrolmentLog.cs index 0cd7a9c0..4fc44b3a 100644 --- a/Disco.Services/Devices/Enrolment/EnrolmentLog.cs +++ b/Disco.Services/Devices/Enrolment/EnrolmentLog.cs @@ -68,7 +68,7 @@ namespace Disco.Services.Devices.Enrolment public EnrolmentLog() { } - private static void Log(EnrolmentLog.EventTypeIds EventTypeId, params object[] Args) + private static void Log(EventTypeIds EventTypeId, params object[] Args) { EnrolmentLog.Current.Log((int)EventTypeId, Args); } diff --git a/Disco.Services/Devices/Enrolment/MacDeviceEnrolment.cs b/Disco.Services/Devices/Enrolment/MacDeviceEnrolment.cs index 7008a480..c57722f6 100644 --- a/Disco.Services/Devices/Enrolment/MacDeviceEnrolment.cs +++ b/Disco.Services/Devices/Enrolment/MacDeviceEnrolment.cs @@ -143,7 +143,7 @@ namespace Disco.Services.Devices.Enrolment EnrolmentLog.LogSessionFinished(sessionId); MacSecureEnrol = response; } - catch (System.Exception ex) + catch (Exception ex) { EnrolmentLog.LogSessionError(sessionId, ex); throw ex; diff --git a/Disco.Services/Documents/DocumentsLog.cs b/Disco.Services/Documents/DocumentsLog.cs index 62d5a8da..cbc9b77e 100644 --- a/Disco.Services/Documents/DocumentsLog.cs +++ b/Disco.Services/Documents/DocumentsLog.cs @@ -60,7 +60,7 @@ namespace Disco.Services.Documents return "Documents"; } } - private static void Log(DocumentsLog.EventTypeIds EventTypeId, params object[] Args) + private static void Log(EventTypeIds EventTypeId, params object[] Args) { DocumentsLog.Current.Log((int)EventTypeId, Args); } diff --git a/Disco.Services/Expressions/Extensions/ImageExt.cs b/Disco.Services/Expressions/Extensions/ImageExt.cs index c119ff7f..ae0ebf37 100644 --- a/Disco.Services/Expressions/Extensions/ImageExt.cs +++ b/Disco.Services/Expressions/Extensions/ImageExt.cs @@ -17,7 +17,7 @@ namespace Disco.Services.Expressions.Extensions } public static FileImageExpressionResult ImageFromDataStoreFile(string RelativeFilePath) { - var configCache = new Disco.Data.Configuration.SystemConfiguration(null); + var configCache = new Data.Configuration.SystemConfiguration(null); string DataStoreLocation = configCache.DataStoreLocation; string AbsoluteFilePath = System.IO.Path.Combine(DataStoreLocation, RelativeFilePath); return new FileImageExpressionResult(AbsoluteFilePath); diff --git a/Disco.Services/Extensions/UIHelpers.cs b/Disco.Services/Extensions/UIHelpers.cs index 5847b292..c4dea2a7 100644 --- a/Disco.Services/Extensions/UIHelpers.cs +++ b/Disco.Services/Extensions/UIHelpers.cs @@ -21,14 +21,14 @@ namespace Disco.Services.Extensions public static ReadOnlyCollection> NoticeboardThemes { get; private set; } /// - /// Returns a randomly selected Icon using . + /// Returns a randomly selected Icon using . /// public static string RandomIcon() { return RandomIcon(null); } /// - /// Returns a randomly selected Icon using . + /// Returns a randomly selected Icon using . /// /// A list of Icons which will be ignored (if all are excluded, a random one will be returned) public static string RandomIcon(IEnumerable Except) @@ -44,14 +44,14 @@ namespace Disco.Services.Extensions } /// - /// Returns a randomly selected Theme Colour using . + /// Returns a randomly selected Theme Colour using . /// public static string RandomThemeColour() { return RandomThemeColour(null); } /// - /// Returns a randomly selected Theme Colour using . + /// Returns a randomly selected Theme Colour using . /// /// A list of Theme Colours which will be ignored (if all are excluded, a random one will be returned) public static string RandomThemeColour(IEnumerable Except) diff --git a/Disco.Services/Interop/ActiveDirectory/ActiveDirectory.cs b/Disco.Services/Interop/ActiveDirectory/ActiveDirectory.cs index 7c08a670..cbea9893 100644 --- a/Disco.Services/Interop/ActiveDirectory/ActiveDirectory.cs +++ b/Disco.Services/Interop/ActiveDirectory/ActiveDirectory.cs @@ -104,12 +104,12 @@ namespace Disco.Services.Interop.ActiveDirectory var domain = Context.GetDomainFromId(Id); return domain.GetAvailableDomainController().RetrieveADMachineAccount(Id, AdditionalProperties); } - public static ADMachineAccount RetrieveADMachineAccount(string Id, System.Guid? NetbootGUID, params string[] AdditionalProperties) + public static ADMachineAccount RetrieveADMachineAccount(string Id, Guid? NetbootGUID, params string[] AdditionalProperties) { var domain = Context.GetDomainFromId(Id); return domain.GetAvailableDomainController().RetrieveADMachineAccount(Id, NetbootGUID, AdditionalProperties); } - public static ADMachineAccount RetrieveADMachineAccount(string Id, System.Guid? UUIDNetbootGUID, System.Guid? MacAddressNetbootGUID, params string[] AdditionalProperties) + public static ADMachineAccount RetrieveADMachineAccount(string Id, Guid? UUIDNetbootGUID, Guid? MacAddressNetbootGUID, params string[] AdditionalProperties) { var domain = Context.GetDomainFromId(Id); return domain.GetAvailableDomainController().RetrieveADMachineAccount(Id, UUIDNetbootGUID, MacAddressNetbootGUID, AdditionalProperties); diff --git a/Disco.Services/Logging/Models/LogLiveEvent.cs b/Disco.Services/Logging/Models/LogLiveEvent.cs index e213ab62..9134b85a 100644 --- a/Disco.Services/Logging/Models/LogLiveEvent.cs +++ b/Disco.Services/Logging/Models/LogLiveEvent.cs @@ -19,7 +19,7 @@ namespace Disco.Services.Logging.Models public string FormattedTimestamp { get; set; } public bool UseDisplay { get; set; } - public static LogLiveEvent Create(LogBase logModule, Models.LogEventType eventType, DateTime Timestamp, string jsonArguments) + public static LogLiveEvent Create(LogBase logModule, LogEventType eventType, DateTime Timestamp, string jsonArguments) { object[] Arguments = null; if (jsonArguments != null) @@ -29,9 +29,9 @@ namespace Disco.Services.Logging.Models return Create(logModule, eventType, Timestamp, Arguments); } - public static LogLiveEvent Create(LogBase logModule, Models.LogEventType eventType, DateTime Timestamp, params object[] Arguments) + public static LogLiveEvent Create(LogBase logModule, LogEventType eventType, DateTime Timestamp, params object[] Arguments) { - return new Models.LogLiveEvent() + return new LogLiveEvent() { ModuleId = logModule.ModuleId, ModuleName = logModule.ModuleName, diff --git a/Disco.Services/Logging/Persistance/LogPersistContext.cs b/Disco.Services/Logging/Persistance/LogPersistContext.cs index 304c1589..66c6682f 100644 --- a/Disco.Services/Logging/Persistance/LogPersistContext.cs +++ b/Disco.Services/Logging/Persistance/LogPersistContext.cs @@ -8,7 +8,7 @@ namespace Disco.Services.Logging.Persistance static LogPersistContext() { - Database.SetInitializer(new LogPersistContextInitializer()); + Database.SetInitializer(new LogPersistContextInitializer()); } public DbSet Modules { get; set; } diff --git a/Disco.Services/Logging/ReadLogContext.cs b/Disco.Services/Logging/ReadLogContext.cs index f5481b51..033a0cf5 100644 --- a/Disco.Services/Logging/ReadLogContext.cs +++ b/Disco.Services/Logging/ReadLogContext.cs @@ -28,9 +28,9 @@ namespace Disco.Services.Logging return true; } - public List Query(DiscoDataContext Database) + public List Query(DiscoDataContext Database) { - List results = new List(); + List results = new List(); // Validate Options Validate(); diff --git a/Disco.Services/Plugins/Features/CertificateProvider/CertificateProviderLog.cs b/Disco.Services/Plugins/Features/CertificateProvider/CertificateProviderLog.cs index f180e682..5eece643 100644 --- a/Disco.Services/Plugins/Features/CertificateProvider/CertificateProviderLog.cs +++ b/Disco.Services/Plugins/Features/CertificateProvider/CertificateProviderLog.cs @@ -67,7 +67,7 @@ namespace Disco.Services.Plugins.Features.CertificateProvider public CertificateProvidersLog() { } - private static void Log(CertificateProvidersLog.EventTypeIds EventTypeId, params object[] Args) + private static void Log(EventTypeIds EventTypeId, params object[] Args) { CertificateProvidersLog.Current.Log((int)EventTypeId, Args); } diff --git a/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs b/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs index 57baeb20..e68a82aa 100644 --- a/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs +++ b/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs @@ -12,7 +12,7 @@ namespace Disco.Services.Plugins.Features.RepairProvider public abstract class RepairProviderFeature : PluginFeature { /// - /// The repairer identifier. Used to link this provider to any . This identifier is used to automatically set the RepairerName when a job is submitted using this plugin. + /// The repairer identifier. Used to link this provider to any . This identifier is used to automatically set the RepairerName when a job is submitted using this plugin. /// public abstract string ProviderId { get; } @@ -45,7 +45,7 @@ namespace Disco.Services.Plugins.Features.RepairProvider /// /// Called when the plugin should submit the job to the external party. /// - /// A reference number/identifier from the external party which is stored in + /// A reference number/identifier from the external party which is stored in public abstract string SubmitJob(DiscoDataContext Database, Job Job, OrganisationAddress Address, User TechUser, string RepairDescription, Dictionary ProviderProperties); #endregion diff --git a/Disco.Services/Plugins/Features/UIExtension/Results/PrecompiledPartialViewResult.cs b/Disco.Services/Plugins/Features/UIExtension/Results/PrecompiledPartialViewResult.cs index 0829ebad..9333072f 100644 --- a/Disco.Services/Plugins/Features/UIExtension/Results/PrecompiledPartialViewResult.cs +++ b/Disco.Services/Plugins/Features/UIExtension/Results/PrecompiledPartialViewResult.cs @@ -19,7 +19,7 @@ namespace Disco.Services.Plugins.Features.UIExtension.Results model = Model; } - public override void ExecuteResult(System.Web.Mvc.WebViewPage page) + public override void ExecuteResult(WebViewPage page) { WebViewPage partialView = Activator.CreateInstance(viewType) as WebViewPage; if (partialView == null) diff --git a/Disco.Services/Plugins/PluginExtensions.cs b/Disco.Services/Plugins/PluginExtensions.cs index 7b409f12..18d9304b 100644 --- a/Disco.Services/Plugins/PluginExtensions.cs +++ b/Disco.Services/Plugins/PluginExtensions.cs @@ -16,15 +16,15 @@ namespace Disco.Services.Plugins #region Model Binding from Controller public static bool TryUpdateModel(this Controller controller, TModel model) where TModel : class { - return controller.TryUpdateModel(model, null, controller.ValueProvider); + return controller.TryUpdateModel(model, null, controller.ValueProvider); } public static bool TryUpdateModel(this Controller controller, TModel model, IValueProvider valueProvider) where TModel : class { - return controller.TryUpdateModel(model, null, valueProvider); + return controller.TryUpdateModel(model, null, valueProvider); } public static bool TryUpdateModel(this Controller controller, TModel model, string prefix) where TModel : class { - return controller.TryUpdateModel(model, prefix, controller.ValueProvider); + return controller.TryUpdateModel(model, prefix, controller.ValueProvider); } public static bool TryUpdateModel(this Controller controller, TModel model, string prefix, IValueProvider valueProvider) where TModel : class { @@ -250,7 +250,7 @@ namespace Disco.Services.Plugins private static MvcForm FormHelper(this WebViewPage ViewPage, string formAction, FormMethod method, IDictionary htmlAttributes) { TagBuilder builder = new TagBuilder("form"); - builder.MergeAttributes(htmlAttributes); + builder.MergeAttributes(htmlAttributes); builder.MergeAttribute("action", formAction); builder.MergeAttribute("method", HtmlHelper.GetFormMethodString(method), true); bool flag = ViewPage.ViewContext.ClientValidationEnabled && !ViewPage.ViewContext.UnobtrusiveJavaScriptEnabled; diff --git a/Disco.Services/Plugins/PluginWebViewPage.cs b/Disco.Services/Plugins/PluginWebViewPage.cs index 837fcce8..5a8dd3a2 100644 --- a/Disco.Services/Plugins/PluginWebViewPage.cs +++ b/Disco.Services/Plugins/PluginWebViewPage.cs @@ -2,7 +2,7 @@ namespace Disco.Services.Plugins { - public abstract class PluginWebViewPage : Disco.Services.Web.WebViewPage + public abstract class PluginWebViewPage : Web.WebViewPage { private Lazy> _plugin; diff --git a/Disco.Services/Plugins/PluginsLog.cs b/Disco.Services/Plugins/PluginsLog.cs index a854a4c9..b758d930 100644 --- a/Disco.Services/Plugins/PluginsLog.cs +++ b/Disco.Services/Plugins/PluginsLog.cs @@ -176,10 +176,10 @@ namespace Disco.Services.Plugins Log(WarningOrMessage, LogData); } - protected override List LoadEventTypes() + protected override List LoadEventTypes() { - return new System.Collections.Generic.List - { + return new List + { new LogEventType { Id = (int)EventTypeIds.InitializingPlugins, diff --git a/Disco.Services/Plugins/WebPageHelper.cs b/Disco.Services/Plugins/WebPageHelper.cs index 444fbb41..abce7c5e 100644 --- a/Disco.Services/Plugins/WebPageHelper.cs +++ b/Disco.Services/Plugins/WebPageHelper.cs @@ -77,7 +77,7 @@ namespace Disco.Services.Plugins public HtmlString PartialCompiled(object Model) where ViewType : WebViewPage { - using (System.IO.StringWriter writer = new StringWriter(CultureInfo.CurrentCulture)) + using (StringWriter writer = new StringWriter(CultureInfo.CurrentCulture)) { RenderPartialCompiled(writer, Model); diff --git a/Disco.Services/Tasks/ScheduledTaskStatus.cs b/Disco.Services/Tasks/ScheduledTaskStatus.cs index 4a08b4cf..555cf119 100644 --- a/Disco.Services/Tasks/ScheduledTaskStatus.cs +++ b/Disco.Services/Tasks/ScheduledTaskStatus.cs @@ -80,7 +80,7 @@ namespace Disco.Services.Tasks #endregion #region Events - public delegate void UpdatedEvent(ScheduledTaskStatus sender, KeyValuePair[] ChangedProperties); + public delegate void UpdatedEvent(ScheduledTaskStatus sender, ChangedItem[] ChangedProperties); public delegate void CancelingEvent(ScheduledTaskStatus sender); public event UpdatedEvent Updated; public event CancelingEvent Canceling; diff --git a/Disco.Services/Tasks/ScheduledTasksLog.cs b/Disco.Services/Tasks/ScheduledTasksLog.cs index e78da500..48647b7e 100644 --- a/Disco.Services/Tasks/ScheduledTasksLog.cs +++ b/Disco.Services/Tasks/ScheduledTasksLog.cs @@ -124,10 +124,10 @@ namespace Disco.Services.Tasks Log(EventTypeIds.ScheduledTasksWarning, ScheduledTaskName, SessionId, Message); } - protected override List LoadEventTypes() + protected override List LoadEventTypes() { - return new System.Collections.Generic.List - { + return new List + { new LogEventType { Id = (int)EventTypeIds.InitializingScheduledTasks, diff --git a/Disco.Web/Areas/API/Controllers/ActivationController.cs b/Disco.Web/Areas/API/Controllers/ActivationController.cs index 6310bc1f..aa1d3ea4 100644 --- a/Disco.Web/Areas/API/Controllers/ActivationController.cs +++ b/Disco.Web/Areas/API/Controllers/ActivationController.cs @@ -15,7 +15,7 @@ namespace Disco.Web.Areas.API.Controllers [HttpPost] public virtual ActionResult TestCallback(CallbackModel model) { - return this.PrecompiledPartialView(model); + return this.PrecompiledPartialView(model); } [HttpPost, ValidateAntiForgeryToken] diff --git a/Disco.Web/Areas/API/Controllers/AuthorizationRoleController.cs b/Disco.Web/Areas/API/Controllers/AuthorizationRoleController.cs index 491699b2..4f82c946 100644 --- a/Disco.Web/Areas/API/Controllers/AuthorizationRoleController.cs +++ b/Disco.Web/Areas/API/Controllers/AuthorizationRoleController.cs @@ -208,7 +208,7 @@ namespace Disco.Web.Areas.API.Controllers #region Actions - public virtual ActionResult Delete(int id, Nullable redirect = false) + public virtual ActionResult Delete(int id, bool? redirect = false) { try { diff --git a/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs b/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs index 14512be2..97adf735 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs @@ -513,7 +513,7 @@ namespace Disco.Web.Areas.API.Controllers #region Actions [DiscoAuthorize(Claims.Config.DeviceBatch.Delete)] - public virtual ActionResult Delete(int id, Nullable redirect = false) + public virtual ActionResult Delete(int id, bool? redirect = false) { try { diff --git a/Disco.Web/Areas/API/Controllers/DeviceProfileController.cs b/Disco.Web/Areas/API/Controllers/DeviceProfileController.cs index 853a2e34..73ce8541 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceProfileController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceProfileController.cs @@ -247,7 +247,7 @@ namespace Disco.Web.Areas.API.Controllers ComputerNameTemplate = ComputerNameTemplate, }; - TestComputerNameTemplateModel.TestComputerNameTemplateResultModel evaluateDevice(Disco.Models.Repository.Device device) + TestComputerNameTemplateModel.TestComputerNameTemplateResultModel evaluateDevice(Device device) { var evaluatorVariables = Expression.StandardVariables(null, Database, UserService.CurrentUser, DateTime.Now, null, device); var deviceResult = new TestComputerNameTemplateModel.TestComputerNameTemplateResultModel() diff --git a/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs b/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs index 9e142966..9ee99ca7 100644 --- a/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs +++ b/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs @@ -509,8 +509,8 @@ namespace Disco.Web.Areas.API.Controllers public virtual ActionResult ImporterUndetectedFiles() { var undetectedLocation = DataStore.CreateLocation(Database, "DocumentDropBox_Unassigned"); - var undetectedDirectory = new System.IO.DirectoryInfo(undetectedLocation); - var m = undetectedDirectory.GetFiles("*.pdf").Select(f => new Models.DocumentTemplate.ImporterUndetectedFilesModel() + var undetectedDirectory = new DirectoryInfo(undetectedLocation); + var m = undetectedDirectory.GetFiles("*.pdf").Select(f => new ImporterUndetectedFilesModel() { Id = System.IO.Path.GetFileNameWithoutExtension(f.Name), Timestamp = f.CreationTime.ToFullDateTime(), @@ -554,7 +554,7 @@ namespace Disco.Web.Areas.API.Controllers } if (searchScope != null) { - Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel[] results; + ImporterUndetectedDataIdLookupModel[] results; switch (searchScope) { case DocumentTemplate.DocumentTemplateScopes.Device: diff --git a/Disco.Web/Areas/API/Controllers/DocumentTemplatePackageController.cs b/Disco.Web/Areas/API/Controllers/DocumentTemplatePackageController.cs index 2b0728f1..8a4101e5 100644 --- a/Disco.Web/Areas/API/Controllers/DocumentTemplatePackageController.cs +++ b/Disco.Web/Areas/API/Controllers/DocumentTemplatePackageController.cs @@ -236,7 +236,7 @@ namespace Disco.Web.Areas.API.Controllers private void UpdateScope(DocumentTemplatePackage Package, string Scope) { AttachmentTypes scope; - if (!Enum.TryParse(Scope, true, out scope)) + if (!Enum.TryParse(Scope, true, out scope)) throw new ArgumentException("Invalid Scope", nameof(Scope)); if (Package.Scope != scope) diff --git a/Disco.Web/Areas/API/Controllers/JobQueueController.cs b/Disco.Web/Areas/API/Controllers/JobQueueController.cs index 85c97a84..4c366f30 100644 --- a/Disco.Web/Areas/API/Controllers/JobQueueController.cs +++ b/Disco.Web/Areas/API/Controllers/JobQueueController.cs @@ -20,7 +20,7 @@ namespace Disco.Web.Areas.API.Controllers const string pDefaultSLAExpiry = "defaultslaexpiry"; [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult Update(int id, string key, string value = null, Nullable redirect = null) + public virtual ActionResult Update(int id, string key, string value = null, bool? redirect = null) { Authorization.Require(Claims.Config.JobQueue.Configure); @@ -77,37 +77,37 @@ namespace Disco.Web.Areas.API.Controllers #region Update Shortcut Methods [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult UpdateName(int id, string QueueName = null, Nullable redirect = null) + public virtual ActionResult UpdateName(int id, string QueueName = null, bool? redirect = null) { return Update(id, pName, QueueName, redirect); } [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult UpdateDescription(int id, string Description = null, Nullable redirect = null) + public virtual ActionResult UpdateDescription(int id, string Description = null, bool? redirect = null) { return Update(id, pDescription, Description, redirect); } [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult UpdatePriority(int id, string Priority = null, Nullable redirect = null) + public virtual ActionResult UpdatePriority(int id, string Priority = null, bool? redirect = null) { return Update(id, pPriority, Priority, redirect); } [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult UpdateDefaultSLAExpiry(int id, string DefaultSLAExpiry = null, Nullable redirect = null) + public virtual ActionResult UpdateDefaultSLAExpiry(int id, string DefaultSLAExpiry = null, bool? redirect = null) { return Update(id, pDefaultSLAExpiry, DefaultSLAExpiry, redirect); } [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult UpdateIcon(int id, string Icon = null, Nullable redirect = null) + public virtual ActionResult UpdateIcon(int id, string Icon = null, bool? redirect = null) { return Update(id, pIcon, Icon, redirect); } [DiscoAuthorize(Claims.Config.JobQueue.Configure)] - public virtual ActionResult UpdateIconColour(int id, string IconColour = null, Nullable redirect = null) + public virtual ActionResult UpdateIconColour(int id, string IconColour = null, bool? redirect = null) { return Update(id, pIconColour, IconColour, redirect); } @@ -249,7 +249,7 @@ namespace Disco.Web.Areas.API.Controllers { JobQueuePriority priority; - if (!Enum.TryParse(Priority, out priority)) + if (!Enum.TryParse(Priority, out priority)) throw new ArgumentException("Invalid Priority Value", "Priority"); jobQueue.Priority = priority; @@ -312,7 +312,7 @@ namespace Disco.Web.Areas.API.Controllers } } - private void UpdateJobSubTypes(Disco.Models.Repository.JobQueue jobQueue, List JobSubTypes) + private void UpdateJobSubTypes(JobQueue jobQueue, List JobSubTypes) { Database.Configuration.LazyLoadingEnabled = true; @@ -326,7 +326,7 @@ namespace Disco.Web.Areas.API.Controllers // Add New if (JobSubTypes != null && JobSubTypes.Count > 0) { - var subTypes = new List(); + var subTypes = new List(); foreach (var stId in JobSubTypes) { var typeId = stId.Substring(0, stId.IndexOf("_")); @@ -342,7 +342,7 @@ namespace Disco.Web.Areas.API.Controllers #region Actions [DiscoAuthorize(Claims.Config.JobQueue.Delete)] - public virtual ActionResult Delete(int id, Nullable redirect = false) + public virtual ActionResult Delete(int id, bool? redirect = false) { try { diff --git a/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs b/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs index ace4f778..20440af7 100644 --- a/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs +++ b/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs @@ -16,7 +16,7 @@ namespace Disco.Web.Areas.API.Controllers const string pSla = "sla"; const string pPriority = "priority"; - public virtual ActionResult Update(int id, string key, string value = null, Nullable redirect = null) + public virtual ActionResult Update(int id, string key, string value = null, bool? redirect = null) { try { @@ -65,28 +65,28 @@ namespace Disco.Web.Areas.API.Controllers #region Update Shortcut Methods [DiscoAuthorizeAny(Claims.Job.Properties.JobQueueProperties.EditAnyComments, Claims.Job.Properties.JobQueueProperties.EditOwnComments)] - public virtual ActionResult UpdateAddedComment(int id, string AddedComment = null, Nullable redirect = null) + public virtual ActionResult UpdateAddedComment(int id, string AddedComment = null, bool? redirect = null) { return Update(id, pAddedComment, AddedComment, redirect); } [DiscoAuthorizeAny(Claims.Job.Properties.JobQueueProperties.EditAnyComments, Claims.Job.Properties.JobQueueProperties.EditOwnComments)] - public virtual ActionResult UpdateRemovedComment(int id, string RemovedComment = null, Nullable redirect = null) + public virtual ActionResult UpdateRemovedComment(int id, string RemovedComment = null, bool? redirect = null) { return Update(id, pRemovedComment, RemovedComment, redirect); } [DiscoAuthorizeAny(Claims.Job.Properties.JobQueueProperties.EditAnySLA, Claims.Job.Properties.JobQueueProperties.EditOwnSLA)] - public virtual ActionResult UpdateSla(int id, string SLA = null, Nullable redirect = null) + public virtual ActionResult UpdateSla(int id, string SLA = null, bool? redirect = null) { return Update(id, pSla, SLA, redirect); } [DiscoAuthorizeAny(Claims.Job.Properties.JobQueueProperties.EditAnyPriority, Claims.Job.Properties.JobQueueProperties.EditOwnPriority)] - public virtual ActionResult UpdatePriority(int id, string Priority = null, Nullable redirect = null) + public virtual ActionResult UpdatePriority(int id, string Priority = null, bool? redirect = null) { return Update(id, pPriority, Priority, redirect); } [DiscoAuthorizeAny(Claims.Job.Properties.JobQueueProperties.EditAnySLA, Claims.Job.Properties.JobQueueProperties.EditOwnSLA, Claims.Job.Properties.JobQueueProperties.EditAnyPriority, Claims.Job.Properties.JobQueueProperties.EditOwnPriority)] - public virtual ActionResult UpdateSlaAndPriority(int id, string Sla = null, string Priority = null, Nullable redirect = null) + public virtual ActionResult UpdateSlaAndPriority(int id, string Sla = null, string Priority = null, bool? redirect = null) { try { @@ -166,7 +166,7 @@ namespace Disco.Web.Areas.API.Controllers JobQueuePriority priority; - if (!Enum.TryParse(Priority, out priority)) + if (!Enum.TryParse(Priority, out priority)) throw new ArgumentException("Invalid Priority Value", "Priority"); jobQueueJob.OnEditPriority(priority); diff --git a/Disco.Web/Areas/API/Controllers/UserFlagController.cs b/Disco.Web/Areas/API/Controllers/UserFlagController.cs index 00f0d019..5e92b91a 100644 --- a/Disco.Web/Areas/API/Controllers/UserFlagController.cs +++ b/Disco.Web/Areas/API/Controllers/UserFlagController.cs @@ -24,7 +24,7 @@ namespace Disco.Web.Areas.API.Controllers const string pOnUnassignmentExpression = "onunassignmentexpression"; [DiscoAuthorize(Claims.Config.UserFlag.Configure)] - public virtual ActionResult Update(int id, string key, string value = null, Nullable redirect = null) + public virtual ActionResult Update(int id, string key, string value = null, bool? redirect = null) { Authorization.Require(Claims.Config.UserFlag.Configure); @@ -81,25 +81,25 @@ namespace Disco.Web.Areas.API.Controllers #region Update Shortcut Methods [DiscoAuthorize(Claims.Config.UserFlag.Configure)] - public virtual ActionResult UpdateName(int id, string FlagName = null, Nullable redirect = null) + public virtual ActionResult UpdateName(int id, string FlagName = null, bool? redirect = null) { return Update(id, pName, FlagName, redirect); } [DiscoAuthorize(Claims.Config.UserFlag.Configure)] - public virtual ActionResult UpdateDescription(int id, string Description = null, Nullable redirect = null) + public virtual ActionResult UpdateDescription(int id, string Description = null, bool? redirect = null) { return Update(id, pDescription, Description, redirect); } [DiscoAuthorize(Claims.Config.UserFlag.Configure)] - public virtual ActionResult UpdateIcon(int id, string Icon = null, Nullable redirect = null) + public virtual ActionResult UpdateIcon(int id, string Icon = null, bool? redirect = null) { return Update(id, pIcon, Icon, redirect); } [DiscoAuthorize(Claims.Config.UserFlag.Configure)] - public virtual ActionResult UpdateIconColour(int id, string IconColour = null, Nullable redirect = null) + public virtual ActionResult UpdateIconColour(int id, string IconColour = null, bool? redirect = null) { return Update(id, pIconColour, IconColour, redirect); } @@ -349,7 +349,7 @@ namespace Disco.Web.Areas.API.Controllers #region Actions [DiscoAuthorizeAll(Claims.Config.UserFlag.Configure, Claims.Config.UserFlag.Delete)] - public virtual ActionResult Delete(int id, Nullable redirect = false) + public virtual ActionResult Delete(int id, bool? redirect = false) { try { diff --git a/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs b/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs index 1595b280..2061feb4 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs @@ -56,7 +56,7 @@ namespace Disco.Web.Areas.Config.Controllers else { // List Index - var m = new Models.DeviceFlag.IndexModel() + var m = new IndexModel() { DeviceFlags = Database.DeviceFlags .Select(uf => new diff --git a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs index 44a33e49..21ace969 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs @@ -73,14 +73,14 @@ namespace Disco.Web.Areas.Config.Controllers m.CertificateAuthorityProviders = Plugins.GetPluginFeatures(typeof(CertificateAuthorityProviderFeature)); m.WirelessProfileProviders = Plugins.GetPluginFeatures(typeof(WirelessProfileProviderFeature)); - var DistributionValues = Enum.GetValues(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes)); + var DistributionValues = Enum.GetValues(typeof(DeviceProfile.DistributionTypes)); m.DeviceProfileDistributionTypes = new List(); foreach (int value in DistributionValues) { m.DeviceProfileDistributionTypes.Add(new SelectListItem() { Value = value.ToString(), - Text = Enum.GetName(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes), value), + Text = Enum.GetName(typeof(DeviceProfile.DistributionTypes), value), Selected = ((int)m.DeviceProfile.DistributionType == value) }); } @@ -163,7 +163,7 @@ namespace Disco.Web.Areas.Config.Controllers DefaultAddDeviceOffline = Database.DiscoConfiguration.DeviceProfiles.DefaultAddDeviceOfflineDeviceProfileId }; m.DeviceProfilesAndNone = m.DeviceProfiles.ToList(); - m.DeviceProfilesAndNone.Insert(0, new Disco.Models.Repository.DeviceProfile() { Id = 0, Name = "" }); + m.DeviceProfilesAndNone.Insert(0, new DeviceProfile() { Id = 0, Name = "" }); // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); diff --git a/Disco.Web/Areas/Config/Controllers/JobQueueController.cs b/Disco.Web/Areas/Config/Controllers/JobQueueController.cs index e6ad4504..8464a7d9 100644 --- a/Disco.Web/Areas/Config/Controllers/JobQueueController.cs +++ b/Disco.Web/Areas/Config/Controllers/JobQueueController.cs @@ -83,7 +83,7 @@ namespace Disco.Web.Areas.Config.Controllers // Default Queue var m = new Models.JobQueue.CreateModel() { - JobQueue = new Disco.Models.Repository.JobQueue() + JobQueue = new JobQueue() { Icon = JobQueueService.RandomUnusedIcon(), IconColour = JobQueueService.RandomUnusedThemeColour(), diff --git a/Disco.Web/Areas/Config/Controllers/PluginsController.cs b/Disco.Web/Areas/Config/Controllers/PluginsController.cs index 7de21f9f..6273165e 100644 --- a/Disco.Web/Areas/Config/Controllers/PluginsController.cs +++ b/Disco.Web/Areas/Config/Controllers/PluginsController.cs @@ -14,7 +14,7 @@ namespace Disco.Web.Areas.Config.Controllers [DiscoAuthorize(Claims.Config.Plugin.Show), HttpGet] public virtual ActionResult Index() { - Models.Plugins.IndexViewModel vm = new Models.Plugins.IndexViewModel() + IndexViewModel vm = new IndexViewModel() { PluginManifests = Plugins.GetPlugins(), PluginLibrary = PluginLibrary.LoadManifest(Database) @@ -80,7 +80,7 @@ namespace Disco.Web.Areas.Config.Controllers } else { - var model = new Models.Plugins.InstallModel() + var model = new InstallModel() { Library = library }; diff --git a/Disco.Web/Areas/Config/Controllers/UserFlagController.cs b/Disco.Web/Areas/Config/Controllers/UserFlagController.cs index 32749c62..ba20ed53 100644 --- a/Disco.Web/Areas/Config/Controllers/UserFlagController.cs +++ b/Disco.Web/Areas/Config/Controllers/UserFlagController.cs @@ -26,7 +26,7 @@ namespace Disco.Web.Areas.Config.Controllers { // Show var m = Database.UserFlags.Where(f => f.Id == id.Value).Select(f => - new Models.UserFlag.ShowModel() + new ShowModel() { UserFlag = f, CurrentAssignmentCount = f.UserFlagAssignments.Count(a => !a.RemovedDate.HasValue), @@ -57,7 +57,7 @@ namespace Disco.Web.Areas.Config.Controllers else { // List Index - var m = new Models.UserFlag.IndexModel() + var m = new IndexModel() { UserFlags = Database.UserFlags .Select(uf => new @@ -81,7 +81,7 @@ namespace Disco.Web.Areas.Config.Controllers public virtual ActionResult Create() { // Default Queue - var m = new Models.UserFlag.CreateModel() + var m = new CreateModel() { UserFlag = new UserFlag() { @@ -97,7 +97,7 @@ namespace Disco.Web.Areas.Config.Controllers } [DiscoAuthorizeAll(Claims.Config.UserFlag.Create, Claims.Config.UserFlag.Configure), HttpPost] - public virtual ActionResult Create(Models.UserFlag.CreateModel model) + public virtual ActionResult Create(CreateModel model) { if (ModelState.IsValid) { diff --git a/Disco.Web/Areas/Config/Models/Expressions/EditorModel.cs b/Disco.Web/Areas/Config/Models/Expressions/EditorModel.cs index 2612fde1..39bfdf71 100644 --- a/Disco.Web/Areas/Config/Models/Expressions/EditorModel.cs +++ b/Disco.Web/Areas/Config/Models/Expressions/EditorModel.cs @@ -3,7 +3,7 @@ public class EditorModel { public string Expression { get; set; } - public Disco.Web.Areas.API.Models.Expressions.ValidateExpressionModel ExpressionException { get; set; } + public API.Models.Expressions.ValidateExpressionModel ExpressionException { get; set; } public string TestScope { get; set; } public string TestScopeDataType { get; set; } public string TestScopeDataId { get; set; } diff --git a/Disco.Web/Extensions/HtmlExtensions.cs b/Disco.Web/Extensions/HtmlExtensions.cs index 1069a6c1..99c1740d 100644 --- a/Disco.Web/Extensions/HtmlExtensions.cs +++ b/Disco.Web/Extensions/HtmlExtensions.cs @@ -15,7 +15,7 @@ namespace Disco.Web public static HtmlHelper GetPageHelper(this System.Web.WebPages.Html.HtmlHelper html) { - return ((System.Web.Mvc.WebViewPage)WebPageContext.Current.Page).Html; + return ((WebViewPage)WebPageContext.Current.Page).Html; } #region T4MVC Disco Extensions @@ -66,7 +66,7 @@ namespace Disco.Web } public static MvcHtmlString OrganisationLogoUrl(this UrlHelper urlHelper, int Width = 256, int Height = 256) { - var config = new Disco.Data.Configuration.SystemConfiguration(null); + var config = new Data.Configuration.SystemConfiguration(null); return new MvcHtmlString(urlHelper.Action(MVC.API.System.OrganisationLogo(Width, Height, config.OrganisationLogoHash))); } #endregion diff --git a/Disco.Web/Extensions/T4MVC/T4MVCExtensions.cs b/Disco.Web/Extensions/T4MVC/T4MVCExtensions.cs index 784612c5..1dc06819 100644 --- a/Disco.Web/Extensions/T4MVC/T4MVCExtensions.cs +++ b/Disco.Web/Extensions/T4MVC/T4MVCExtensions.cs @@ -22,7 +22,7 @@ namespace Disco.Web.Controllers } [NonAction] - public virtual System.Web.Mvc.ActionResult Show(string id) + public virtual ActionResult Show(string id) { var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Show); diff --git a/Disco.Web/Global.asax.cs b/Disco.Web/Global.asax.cs index e2ef9a72..3477fa50 100644 --- a/Disco.Web/Global.asax.cs +++ b/Disco.Web/Global.asax.cs @@ -183,7 +183,7 @@ namespace Disco.Web } #endregion #region Dropbox Monitor - public static Disco.Services.Documents.AttachmentImport.ImportDirectoryMonitor DocumentDropBoxMonitor { get; set; } + public static Services.Documents.AttachmentImport.ImportDirectoryMonitor DocumentDropBoxMonitor { get; set; } #endregion #region Global Error Logging void DiscoApplication_Error(object sender, EventArgs e) diff --git a/Disco.Web/Models/Job/LogRepairModel.cs b/Disco.Web/Models/Job/LogRepairModel.cs index a316e1c5..6c2807c5 100644 --- a/Disco.Web/Models/Job/LogRepairModel.cs +++ b/Disco.Web/Models/Job/LogRepairModel.cs @@ -26,7 +26,7 @@ namespace Disco.Web.Models.Job [Required] public int JobId { get; set; } [Required(ErrorMessage = "Please specify a Repair Address")] - public Nullable OrganisationAddressId { get; set; } + public int? OrganisationAddressId { get; set; } [Required(ErrorMessage = "Please specify a Repair Provider")] public string RepairProviderId { get; set; } [Required(ErrorMessage = "A fault description is required"), DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)] diff --git a/Disco.Web/Models/Job/LogWarrantyModel.cs b/Disco.Web/Models/Job/LogWarrantyModel.cs index 242030ac..2f1403b0 100644 --- a/Disco.Web/Models/Job/LogWarrantyModel.cs +++ b/Disco.Web/Models/Job/LogWarrantyModel.cs @@ -26,7 +26,7 @@ namespace Disco.Web.Models.Job [Required] public int JobId { get; set; } [Required(ErrorMessage = "Please specify a Repair Address")] - public Nullable OrganisationAddressId { get; set; } + public int? OrganisationAddressId { get; set; } [Required(ErrorMessage = "Please specify a Warranty Provider")] public string WarrantyProviderId { get; set; } [Required(ErrorMessage = "A fault description is required"), DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]