From fd43d8577831aa090651c622672d3d2a23538096 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Sun, 20 Jul 2025 15:58:42 +1000 Subject: [PATCH] qol: simplify and `Tuple.Create()` --- Disco.ClientBootstrapper/FormStatus.cs | 6 +- .../Interop/WIMInterop.cs | 44 +++---- .../Devices/DeviceModelExtensions.cs | 4 +- .../Enrolment/LogMacAddressImportingTask.cs | 2 +- .../Documents/QRCodeBinaryEncoder.cs | 2 +- Disco.Services/Expressions/Expression.cs | 6 +- .../FileMontageImageExpressionResult.cs | 2 +- Disco.Services/Jobs/JobExtensions.cs | 2 +- Disco.Services/Logging/ReadLogContext.cs | 8 +- Disco.Services/Plugins/PluginManifest.cs | 6 +- Disco.Services/Users/Cache.cs | 2 +- Disco.Web/Extensions/HtmlExtensions.cs | 10 +- .../Models/InitialConfig/CompleteModel.cs | 4 +- Disco.Web/Views/Job/JobParts/Queues.cshtml | 2 +- .../Views/Job/JobParts/Queues.generated.cs | 110 +++++++++--------- Disco.Web/Views/Shared/_JobTableRender.cshtml | 2 +- .../Views/Shared/_JobTableRender.generated.cs | 64 +++++----- 17 files changed, 138 insertions(+), 138 deletions(-) diff --git a/Disco.ClientBootstrapper/FormStatus.cs b/Disco.ClientBootstrapper/FormStatus.cs index d5a71245..95b1d8fd 100644 --- a/Disco.ClientBootstrapper/FormStatus.cs +++ b/Disco.ClientBootstrapper/FormStatus.cs @@ -6,7 +6,7 @@ namespace Disco.ClientBootstrapper public partial class FormStatus : Form, IStatus { - private delegate void dUpdateStatus(string Heading, string SubHeading, string Message, Nullable ShowProgress, Nullable Progress); + private delegate void dUpdateStatus(string Heading, string SubHeading, string Message, bool? ShowProgress, int? Progress); private dUpdateStatus mUpdateStatus; public FormStatus() @@ -28,7 +28,7 @@ namespace Disco.ClientBootstrapper Program.ExitApplication(); } - public void UpdateStatus(string Heading, string SubHeading, string Message, Nullable ShowProgress = null, Nullable Progress = null) + public void UpdateStatus(string Heading, string SubHeading, string Message, bool? ShowProgress = null, int? Progress = null) { try { @@ -36,7 +36,7 @@ namespace Disco.ClientBootstrapper } catch (Exception) { } } - private void UpdateStatusDo(string Heading, string SubHeading, string Message, Nullable ShowProgress, Nullable Progress) + private void UpdateStatusDo(string Heading, string SubHeading, string Message, bool? ShowProgress, int? Progress) { if (Heading != null) if (this.labelHeading.Text != Heading) diff --git a/Disco.ClientBootstrapper/Interop/WIMInterop.cs b/Disco.ClientBootstrapper/Interop/WIMInterop.cs index 4b5d62f2..0212e13c 100644 --- a/Disco.ClientBootstrapper/Interop/WIMInterop.cs +++ b/Disco.ClientBootstrapper/Interop/WIMInterop.cs @@ -139,7 +139,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop CreateFileAccessPrivate fileAccess = GetMappedFileAccess(access); if (fileAccess == CreateFileAccessPrivate.Read && (!File.Exists(imageFilePath) || (CreateFileMode.OpenExisting != mode))) { - throw new System.UnauthorizedAccessException("Read access can be specified only with OpenExisting mode or OpenAlways mode when the .wim file does not exist."); + throw new UnauthorizedAccessException("Read access can be specified only with OpenExisting mode or OpenAlways mode when the .wim file does not exist."); } // @@ -150,9 +150,9 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop m_ImageContainerHandle = NativeMethods.CreateFile(imageFilePath, (uint)fileAccess, (uint)mode); m_WindowsImageFilePath = imageFilePath; } - catch (System.DllNotFoundException ex) + catch (DllNotFoundException ex) { - throw new System.DllNotFoundException(string.Format( + throw new DllNotFoundException(string.Format( "Unable to load WIM libraries. Make sure the correct DLLs are present (Wimgapi.dll and Xmlrw.dll)."), ex.InnerException); } @@ -171,7 +171,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to open the .wim file {imageFilePath}."); + throw new InvalidOperationException($"Unable to open the .wim file {imageFilePath}."); } // @@ -684,7 +684,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Everything failed; throw an exception // - throw new System.InvalidOperationException($"Unable to open/create .wim file {imageFile}. Error = {rc}"); + throw new InvalidOperationException($"Unable to open/create .wim file {imageFile}. Error = {rc}"); } return windowsImageHandle; @@ -719,7 +719,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to close image handle. Error = {rc}"); + throw new InvalidOperationException($"Unable to close image handle. Error = {rc}"); } } @@ -754,7 +754,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to set temporary path. Error = {rc}"); + throw new InvalidOperationException($"Unable to set temporary path. Error = {rc}"); } } @@ -791,7 +791,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to load image. Error = {rc}"); + throw new InvalidOperationException($"Unable to load image. Error = {rc}"); } return hWim; @@ -829,7 +829,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Failed to capture image from {path}. Error = {rc}"); + throw new InvalidOperationException($"Failed to capture image from {path}. Error = {rc}"); } return hImage; } @@ -869,7 +869,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to get image count. Error = {rc}"); + throw new InvalidOperationException($"Unable to get image count. Error = {rc}"); } return count; @@ -966,19 +966,19 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop temporaryPath); rc = Marshal.GetLastWin32Error(); } - catch (System.StackOverflowException) + catch (StackOverflowException) { // //Throw an exception // - throw new System.InvalidOperationException($"Unable to mount image {windowsImageFileName} to {mountPath}."); + throw new InvalidOperationException($"Unable to mount image {windowsImageFileName} to {mountPath}."); } if (status == false) { // //Throw an exception // - throw new System.InvalidOperationException($"Unable to mount image {windowsImageFileName} to {mountPath}. Error = {rc}"); + throw new InvalidOperationException($"Unable to mount image {windowsImageFileName} to {mountPath}. Error = {rc}"); } } @@ -1015,7 +1015,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to apply image to {applicationPath}. Error = {rc}"); + throw new InvalidOperationException($"Unable to apply image to {applicationPath}. Error = {rc}"); } } @@ -1055,7 +1055,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to get image information. Error = {rc}"); + throw new InvalidOperationException($"Unable to get image information. Error = {rc}"); } string s = Marshal.PtrToStringUni(info); @@ -1103,7 +1103,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to set image information. Error = {rc}"); + throw new InvalidOperationException($"Unable to set image information. Error = {rc}"); } } @@ -1139,12 +1139,12 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop status = WimUnmountImage(mountPath, wimdowsImageFileName, (uint)imageIndex, commitChanges); rc = Marshal.GetLastWin32Error(); } - catch (System.StackOverflowException ex) + catch (StackOverflowException ex) { // //Throw an exception // - throw new System.StackOverflowException($"Unable to unmount image {wimdowsImageFileName} from {mountPath}.", + throw new StackOverflowException($"Unable to unmount image {wimdowsImageFileName} from {mountPath}.", ex.InnerException); } if (status == false) @@ -1152,7 +1152,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException($"Unable to unmount image {wimdowsImageFileName} from {mountPath}. Error = {rc}"); + throw new InvalidOperationException($"Unable to unmount image {wimdowsImageFileName} from {mountPath}. Error = {rc}"); } } @@ -1208,7 +1208,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Throw an exception // - throw new System.InvalidOperationException("Unable to register message callback."); + throw new InvalidOperationException("Unable to register message callback."); } } @@ -1240,7 +1240,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // // Throw an exception // - throw new System.InvalidOperationException("Unable to unregister message callback."); + throw new InvalidOperationException("Unable to unregister message callback."); } } @@ -1344,7 +1344,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop } //[CLSCompliant(false)] - [FlagsAttribute] + [Flags] private enum CreateFileAccessPrivate : uint diff --git a/Disco.Services/Devices/DeviceModelExtensions.cs b/Disco.Services/Devices/DeviceModelExtensions.cs index 88aa67bc..61d27226 100644 --- a/Disco.Services/Devices/DeviceModelExtensions.cs +++ b/Disco.Services/Devices/DeviceModelExtensions.cs @@ -112,7 +112,7 @@ namespace Disco.Services // Obtain the Device Model with the in-scope DataContext // - Overhead acknowledged, but reasonable given the infrequency of occurrence deviceModel = DeviceModelsSet.FirstOrDefault(dm => dm.Manufacturer == Manufacturer && dm.Model == Model); - return new Tuple(deviceModel, true); + return Tuple.Create(deviceModel, true); } } } @@ -122,7 +122,7 @@ namespace Disco.Services deviceModel.ModelType = ModelType; } - return new Tuple(deviceModel, false); + return Tuple.Create(deviceModel, false); } } diff --git a/Disco.Services/Devices/Enrolment/LogMacAddressImportingTask.cs b/Disco.Services/Devices/Enrolment/LogMacAddressImportingTask.cs index 492e6fe8..894d885a 100644 --- a/Disco.Services/Devices/Enrolment/LogMacAddressImportingTask.cs +++ b/Disco.Services/Devices/Enrolment/LogMacAddressImportingTask.cs @@ -86,7 +86,7 @@ namespace Disco.Services.Devices.Enrolment Dictionary> addresses = new Dictionary>(); foreach (var result in results.OrderBy(r => r.Timestamp)) - addresses[((string)result.Arguments[1]).ToLower()] = new Tuple((string)result.Arguments[4], (string)result.Arguments[5]); + addresses[((string)result.Arguments[1]).ToLower()] = Tuple.Create((string)result.Arguments[4], (string)result.Arguments[5]); Status.UpdateStatus(75, $"Importing {addresses.Count} details"); diff --git a/Disco.Services/Documents/QRCodeBinaryEncoder.cs b/Disco.Services/Documents/QRCodeBinaryEncoder.cs index 9d7cd081..30191c62 100644 --- a/Disco.Services/Documents/QRCodeBinaryEncoder.cs +++ b/Disco.Services/Documents/QRCodeBinaryEncoder.cs @@ -145,7 +145,7 @@ namespace Disco.Services.Documents byte[] dataBytes = new byte[numDataBytesInBlock]; bits.toBytes(8 * dataBytesOffset, dataBytes, 0, numDataBytesInBlock); byte[] ecBytes = generateECBytes(dataBytes, numEcBytesInBlock); - blocks.Add(new Tuple(dataBytes, ecBytes)); + blocks.Add(Tuple.Create(dataBytes, ecBytes)); maxNumDataBytes = Math.Max(maxNumDataBytes, numDataBytesInBlock); maxNumEcBytes = Math.Max(maxNumEcBytes, ecBytes.Length); diff --git a/Disco.Services/Expressions/Expression.cs b/Disco.Services/Expressions/Expression.cs index c0112f21..34d93bb8 100644 --- a/Disco.Services/Expressions/Expression.cs +++ b/Disco.Services/Expressions/Expression.cs @@ -75,14 +75,14 @@ namespace Disco.Services.Expressions public Tuple Evaluate(object ExpressionContext, IDictionary Variables) { if (Count == 0) - return new Tuple(string.Empty, false, null); + return Tuple.Create(string.Empty, false, (object)null); if (!IsDynamic) { if (Count != 1) throw new InvalidOperationException("Non-dynamic expressions should only have one part"); if (this[0] is TextExpressionPart textPart) - return new Tuple(textPart.RawSource, false, null); + return Tuple.Create(textPart.RawSource, false, (object)null); else throw new InvalidOperationException("Non-dynamic expressions should have a single TextExpressionPart component"); } @@ -115,7 +115,7 @@ namespace Disco.Services.Expressions } } } - return new Tuple(resultValue.ToString(), resultError, resultObject); + return Tuple.Create(resultValue.ToString(), resultError, resultObject); } public static Expression TokenizeSingleDynamic(string Name, string ExpressionSource, int Ordinal) { diff --git a/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs b/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs index a6172e07..ad07684d 100644 --- a/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs +++ b/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs @@ -208,7 +208,7 @@ namespace Disco.Services.Expressions.Extensions.ImageResultImplementations } } - return new Tuple(bestColumnCount, bestRowCount, bestItemRatio); + return Tuple.Create(bestColumnCount, bestRowCount, bestItemRatio); } diff --git a/Disco.Services/Jobs/JobExtensions.cs b/Disco.Services/Jobs/JobExtensions.cs index df18d168..a6dd0bb4 100644 --- a/Disco.Services/Jobs/JobExtensions.cs +++ b/Disco.Services/Jobs/JobExtensions.cs @@ -204,7 +204,7 @@ namespace Disco.Services public static Tuple Status(this Job j) { var statusId = j.CalculateStatusId(); - return new Tuple(statusId, JobStatusDescription(statusId, j)); + return Tuple.Create(statusId, JobStatusDescription(statusId, j)); } public static List AvailableDocumentTemplates(this Job j, DiscoDataContext Database, User User, DateTime TimeStamp) diff --git a/Disco.Services/Logging/ReadLogContext.cs b/Disco.Services/Logging/ReadLogContext.cs index 7992771a..02e7c03f 100644 --- a/Disco.Services/Logging/ReadLogContext.cs +++ b/Disco.Services/Logging/ReadLogContext.cs @@ -74,7 +74,7 @@ namespace Disco.Services.Logging private List> RelevantLogFiles(DiscoDataContext Database) { - List> relevantFiles = new List>(); + var relevantFiles = new List>(); var logDirectoryBase = LogContext.LogFileBasePath(Database); var logDirectoryBaseInfo = new DirectoryInfo(logDirectoryBase); var endDate = End.HasValue ? End.Value : DateTime.Now; @@ -92,7 +92,7 @@ namespace Disco.Services.Logging { var fileName = LogContext.LogFilePath(Database, queryDate, false); if (File.Exists(fileName)) - relevantFiles.Add(new Tuple(fileName, LogFileDate(fileName).Value)); + relevantFiles.Add(Tuple.Create(fileName, LogFileDate(fileName).Value)); queryDate = queryDate.AddDays(1); } @@ -118,7 +118,7 @@ namespace Disco.Services.Logging { foreach (var logFile in logFiles) { - relevantFiles.Add(new Tuple(logFile, LogFileDate(logFile).Value)); + relevantFiles.Add(Tuple.Create(logFile, LogFileDate(logFile).Value)); } } else @@ -130,7 +130,7 @@ namespace Disco.Services.Logging { if (fileNameDate.Value < endDate) { - relevantFiles.Add(new Tuple(logFile, fileNameDate.Value)); + relevantFiles.Add(Tuple.Create(logFile, fileNameDate.Value)); } else { diff --git a/Disco.Services/Plugins/PluginManifest.cs b/Disco.Services/Plugins/PluginManifest.cs index 3c239bdc..88737398 100644 --- a/Disco.Services/Plugins/PluginManifest.cs +++ b/Disco.Services/Plugins/PluginManifest.cs @@ -519,7 +519,7 @@ namespace Disco.Services.Plugins var fileDateCheck = File.GetLastWriteTime(resourcePath); if (fileDateCheck == resourceHash.Item2) #endif - return new Tuple(resourcePath, resourceHash.Item1); + return Tuple.Create(resourcePath, resourceHash.Item1); } if (!File.Exists(resourcePath)) @@ -532,12 +532,12 @@ namespace Disco.Services.Plugins using (SHA256 sha = SHA256.Create()) { byte[] hash = sha.ComputeHash(fileBytes); - resourceHash = new Tuple(HttpServerUtility.UrlTokenEncode(hash), fileDate); + resourceHash = Tuple.Create(HttpServerUtility.UrlTokenEncode(hash), fileDate); } } WebResourceHashes[resourceKey] = resourceHash; - return new Tuple(resourcePath, resourceHash.Item1); + return Tuple.Create(resourcePath, resourceHash.Item1); } public string WebResourceUrl(string Resource) { diff --git a/Disco.Services/Users/Cache.cs b/Disco.Services/Users/Cache.cs index a796e3d9..28df72a8 100644 --- a/Disco.Services/Users/Cache.cs +++ b/Disco.Services/Users/Cache.cs @@ -157,7 +157,7 @@ namespace Disco.Services.Users { var cache = _Cache; - var record = new Tuple(Record.Item1, Record.Item2, DateTime.Now.AddTicks(CacheTimeoutTicks)); + var record = Tuple.Create(Record.Item1, Record.Item2, DateTime.Now.AddTicks(CacheTimeoutTicks)); if (cache.ContainsKey(UserId)) { if (cache.TryGetValue(UserId, out var oldRecord)) diff --git a/Disco.Web/Extensions/HtmlExtensions.cs b/Disco.Web/Extensions/HtmlExtensions.cs index 18ccf8e1..01cad158 100644 --- a/Disco.Web/Extensions/HtmlExtensions.cs +++ b/Disco.Web/Extensions/HtmlExtensions.cs @@ -81,23 +81,23 @@ namespace Disco.Web var breadCrumbs = new List>(); if (title1 != null) { - breadCrumbs.Add(new Tuple(title1, link1)); + breadCrumbs.Add(Tuple.Create(title1, link1)); } if (title2 != null) { - breadCrumbs.Add(new Tuple(title2, link2)); + breadCrumbs.Add(Tuple.Create(title2, link2)); } if (title3 != null) { - breadCrumbs.Add(new Tuple(title3, link3)); + breadCrumbs.Add(Tuple.Create(title3, link3)); } if (title4 != null) { - breadCrumbs.Add(new Tuple(title4, link4)); + breadCrumbs.Add(Tuple.Create(title4, link4)); } if (title5 != null) { - breadCrumbs.Add(new Tuple(title5, link5)); + breadCrumbs.Add(Tuple.Create(title5, link5)); } return breadCrumbs; diff --git a/Disco.Web/Models/InitialConfig/CompleteModel.cs b/Disco.Web/Models/InitialConfig/CompleteModel.cs index fce2c3ff..40ba6372 100644 --- a/Disco.Web/Models/InitialConfig/CompleteModel.cs +++ b/Disco.Web/Models/InitialConfig/CompleteModel.cs @@ -24,11 +24,11 @@ namespace Disco.Web.Models.InitialConfig try { // Try and Resolve 'disco' - DiscoDnsTestResult = new Tuple(Dns.GetHostEntry("disco"), null); + DiscoDnsTestResult = Tuple.Create(Dns.GetHostEntry("disco"), (Exception)null); } catch (Exception ex) { - DiscoDnsTestResult = new Tuple(null, ex); + DiscoDnsTestResult = Tuple.Create((IPHostEntry)null, ex); } #endregion diff --git a/Disco.Web/Views/Job/JobParts/Queues.cshtml b/Disco.Web/Views/Job/JobParts/Queues.cshtml index 790efcf6..8e985c07 100644 --- a/Disco.Web/Views/Job/JobParts/Queues.cshtml +++ b/Disco.Web/Views/Job/JobParts/Queues.cshtml @@ -11,7 +11,7 @@ var hasJobQueueShow = Authorization.Has(Claims.Config.JobQueue.Show); var queues = JobQueueService.GetQueues(); - var queueHistory = Model.Job.JobQueues.Select(jq => new Tuple(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).ToList(); + var queueHistory = Model.Job.JobQueues.Select(jq => Tuple.Create(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).ToList(); } @if (queueHistory.Count > 0) { diff --git a/Disco.Web/Views/Job/JobParts/Queues.generated.cs b/Disco.Web/Views/Job/JobParts/Queues.generated.cs index 3920647a..d83393f5 100644 --- a/Disco.Web/Views/Job/JobParts/Queues.generated.cs +++ b/Disco.Web/Views/Job/JobParts/Queues.generated.cs @@ -62,7 +62,7 @@ namespace Disco.Web.Views.Job.JobParts var hasJobQueueShow = Authorization.Has(Claims.Config.JobQueue.Show); var queues = JobQueueService.GetQueues(); - var queueHistory = Model.Job.JobQueues.Select(jq => new Tuple(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).ToList(); + var queueHistory = Model.Job.JobQueues.Select(jq => Tuple.Create(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).ToList(); #line default @@ -138,14 +138,14 @@ WriteLiteral(" data-jobqueuejobaddeddate=\""); #line hidden WriteLiteral("\""); -WriteAttribute("class", Tuple.Create(" class=\"", 1371), Tuple.Create("\"", 1434) +WriteAttribute("class", Tuple.Create(" class=\"", 1346), Tuple.Create("\"", 1409) #line 28 "..\..\Views\Job\JobParts\Queues.cshtml" - , Tuple.Create(Tuple.Create("", 1379), Tuple.Create(!jq.Item1.RemovedDate.HasValue ? "added" : "removed" + , Tuple.Create(Tuple.Create("", 1354), Tuple.Create(!jq.Item1.RemovedDate.HasValue ? "added" : "removed" #line default #line hidden -, 1379), false) +, 1354), false) ); WriteLiteral(">\r\n \r\n (jq.Item2.JobQueue.Icon +, Tuple.Create(Tuple.Create("", 1484), Tuple.Create(jq.Item2.JobQueue.Icon #line default #line hidden -, 1509), false) -, Tuple.Create(Tuple.Create(" ", 1534), Tuple.Create("fa-fw", 1535), true) -, Tuple.Create(Tuple.Create(" ", 1540), Tuple.Create("fa-lg", 1541), true) -, Tuple.Create(Tuple.Create(" ", 1546), Tuple.Create("d-", 1547), true) +, 1484), false) +, Tuple.Create(Tuple.Create(" ", 1509), Tuple.Create("fa-fw", 1510), true) +, Tuple.Create(Tuple.Create(" ", 1515), Tuple.Create("fa-lg", 1516), true) +, Tuple.Create(Tuple.Create(" ", 1521), Tuple.Create("d-", 1522), true) #line 30 "..\..\Views\Job\JobParts\Queues.cshtml" -, Tuple.Create(Tuple.Create("", 1549), Tuple.Create(jq.Item2.JobQueue.IconColour +, Tuple.Create(Tuple.Create("", 1524), Tuple.Create(jq.Item2.JobQueue.IconColour #line default #line hidden -, 1549), false) +, 1524), false) ); WriteLiteral(">\r\n"); @@ -236,28 +236,28 @@ WriteLiteral(" "); #line hidden WriteLiteral(" (jq.Item2.JobQueue.Priority.ToString().ToLower() +, Tuple.Create(Tuple.Create("", 2040), Tuple.Create(jq.Item2.JobQueue.Priority.ToString().ToLower() #line default #line hidden -, 2065), false) +, 2040), false) ); -WriteAttribute("title", Tuple.Create(" title=\"", 2116), Tuple.Create("\"", 2179) +WriteAttribute("title", Tuple.Create(" title=\"", 2091), Tuple.Create("\"", 2154) #line 41 "..\..\Views\Job\JobParts\Queues.cshtml" - , Tuple.Create(Tuple.Create("", 2124), Tuple.Create(jq.Item2.JobQueue.Priority.ToString() + , Tuple.Create(Tuple.Create("", 2099), Tuple.Create(jq.Item2.JobQueue.Priority.ToString() #line default #line hidden -, 2124), false) -, Tuple.Create(Tuple.Create(" ", 2164), Tuple.Create("Queue", 2165), true) -, Tuple.Create(Tuple.Create(" ", 2170), Tuple.Create("Priority", 2171), true) +, 2099), false) +, Tuple.Create(Tuple.Create(" ", 2139), Tuple.Create("Queue", 2140), true) +, Tuple.Create(Tuple.Create(" ", 2145), Tuple.Create("Priority", 2146), true) ); WriteLiteral(">\r\n"); @@ -381,15 +381,15 @@ WriteLiteral(">"); #line hidden WriteLiteral("\r\n \r\n (!jq.Item1.RemovedDate.HasValue ? " na" : null +, Tuple.Create(Tuple.Create("", 3029), Tuple.Create(!jq.Item1.RemovedDate.HasValue ? " na" : null #line default #line hidden -, 3054), false) +, 3029), false) ); WriteLiteral(">\r\n"); @@ -507,17 +507,17 @@ WriteLiteral(" (jq.Item1.CanCloseJobNormallyAfterRemoved() ? "canCloseNormally" : null +, Tuple.Create(Tuple.Create(" ", 4105), Tuple.Create(jq.Item1.CanCloseJobNormallyAfterRemoved() ? "canCloseNormally" : null #line default #line hidden -, 4131), false) +, 4106), false) ); WriteLiteral(">Remove\r\n"); @@ -546,29 +546,29 @@ WriteLiteral(">In Progress\r\n"); #line hidden WriteLiteral(" \r\n (overdue ? "overdue" : null +, Tuple.Create(Tuple.Create(" ", 4412), Tuple.Create(overdue ? "overdue" : null #line default #line hidden -, 4438), false) +, 4413), false) #line 87 "..\..\Views\Job\JobParts\Queues.cshtml" -, Tuple.Create(Tuple.Create(" ", 4467), Tuple.Create(jq.Item1.CanEditSla() ? "canEditSLA" : null +, Tuple.Create(Tuple.Create(" ", 4442), Tuple.Create(jq.Item1.CanEditSla() ? "canEditSLA" : null #line default #line hidden -, 4468), false) +, 4443), false) #line 87 "..\..\Views\Job\JobParts\Queues.cshtml" - , Tuple.Create(Tuple.Create(" ", 4514), Tuple.Create(jq.Item1.CanEditPriority() ? "canEditPriority" : null + , Tuple.Create(Tuple.Create(" ", 4489), Tuple.Create(jq.Item1.CanEditPriority() ? "canEditPriority" : null #line default #line hidden -, 4515), false) +, 4490), false) ); WriteLiteral(" data-priority=\""); @@ -626,28 +626,28 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (jq.Item1.Priority.ToString().ToLower() +, Tuple.Create(Tuple.Create("", 4942), Tuple.Create(jq.Item1.Priority.ToString().ToLower() #line default #line hidden -, 4967), false) +, 4942), false) ); -WriteAttribute("title", Tuple.Create(" title=\"", 5009), Tuple.Create("\"", 5061) +WriteAttribute("title", Tuple.Create(" title=\"", 4984), Tuple.Create("\"", 5036) #line 92 "..\..\Views\Job\JobParts\Queues.cshtml" - , Tuple.Create(Tuple.Create("", 5017), Tuple.Create(jq.Item1.Priority.ToString() + , Tuple.Create(Tuple.Create("", 4992), Tuple.Create(jq.Item1.Priority.ToString() #line default #line hidden -, 5017), false) -, Tuple.Create(Tuple.Create(" ", 5048), Tuple.Create("Job", 5049), true) -, Tuple.Create(Tuple.Create(" ", 5052), Tuple.Create("Priority", 5053), true) +, 4992), false) +, Tuple.Create(Tuple.Create(" ", 5023), Tuple.Create("Job", 5024), true) +, Tuple.Create(Tuple.Create(" ", 5027), Tuple.Create("Priority", 5028), true) ); WriteLiteral(">\r\n"); @@ -1038,14 +1038,14 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (priorityItem +, Tuple.Create(Tuple.Create("", 8827), Tuple.Create(priorityItem #line default #line hidden -, 8852), false) +, 8827), false) ); WriteLiteral(">"); diff --git a/Disco.Web/Views/Shared/_JobTableRender.cshtml b/Disco.Web/Views/Shared/_JobTableRender.cshtml index 3735b401..f0c5159c 100644 --- a/Disco.Web/Views/Shared/_JobTableRender.cshtml +++ b/Disco.Web/Views/Shared/_JobTableRender.cshtml @@ -71,7 +71,7 @@ @if (statusItem.ActiveJobQueues != null) {
- @foreach (var jqToken in ((JobTableStatusItemModel)item).ActiveJobQueues.Select(jqj => new Tuple(jqj, Disco.Services.Jobs.JobQueues.JobQueueService.GetQueue(jqj.QueueId)))) + @foreach (var jqToken in ((JobTableStatusItemModel)item).ActiveJobQueues.Select(jqj => Tuple.Create(jqj, Disco.Services.Jobs.JobQueues.JobQueueService.GetQueue(jqj.QueueId)))) { } diff --git a/Disco.Web/Views/Shared/_JobTableRender.generated.cs b/Disco.Web/Views/Shared/_JobTableRender.generated.cs index 36e9be19..dccd83ce 100644 --- a/Disco.Web/Views/Shared/_JobTableRender.generated.cs +++ b/Disco.Web/Views/Shared/_JobTableRender.generated.cs @@ -497,7 +497,7 @@ WriteLiteral(">\r\n"); #line hidden #line 74 "..\..\Views\Shared\_JobTableRender.cshtml" - foreach (var jqToken in ((JobTableStatusItemModel)item).ActiveJobQueues.Select(jqj => new Tuple(jqj, Disco.Services.Jobs.JobQueues.JobQueueService.GetQueue(jqj.QueueId)))) + foreach (var jqToken in ((JobTableStatusItemModel)item).ActiveJobQueues.Select(jqj => Tuple.Create(jqj, Disco.Services.Jobs.JobQueues.JobQueueService.GetQueue(jqj.QueueId)))) { @@ -505,44 +505,44 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (jqToken.Item2.JobQueue.Icon +, Tuple.Create(Tuple.Create("", 3817), Tuple.Create(jqToken.Item2.JobQueue.Icon #line default #line hidden -, 3889), false) -, Tuple.Create(Tuple.Create(" ", 3919), Tuple.Create("fa-fw", 3920), true) -, Tuple.Create(Tuple.Create(" ", 3925), Tuple.Create("d-", 3926), true) +, 3817), false) +, Tuple.Create(Tuple.Create(" ", 3847), Tuple.Create("fa-fw", 3848), true) +, Tuple.Create(Tuple.Create(" ", 3853), Tuple.Create("d-", 3854), true) #line 76 "..\..\Views\Shared\_JobTableRender.cshtml" - , Tuple.Create(Tuple.Create("", 3928), Tuple.Create(jqToken.Item2.JobQueue.IconColour + , Tuple.Create(Tuple.Create("", 3856), Tuple.Create(jqToken.Item2.JobQueue.IconColour #line default #line hidden -, 3928), false) +, 3856), false) ); -WriteAttribute("title", Tuple.Create(" title=\"", 3965), Tuple.Create("\"", 4031) +WriteAttribute("title", Tuple.Create(" title=\"", 3893), Tuple.Create("\"", 3959) #line 76 "..\..\Views\Shared\_JobTableRender.cshtml" - , Tuple.Create(Tuple.Create("", 3973), Tuple.Create(jqToken.Item2.JobQueue.Name + , Tuple.Create(Tuple.Create("", 3901), Tuple.Create(jqToken.Item2.JobQueue.Name #line default #line hidden -, 3973), false) -, Tuple.Create(Tuple.Create(" ", 4003), Tuple.Create("[", 4004), true) +, 3901), false) +, Tuple.Create(Tuple.Create(" ", 3931), Tuple.Create("[", 3932), true) #line 76 "..\..\Views\Shared\_JobTableRender.cshtml" - , Tuple.Create(Tuple.Create("", 4005), Tuple.Create(jqToken.Item1.Priority + , Tuple.Create(Tuple.Create("", 3933), Tuple.Create(jqToken.Item1.Priority #line default #line hidden -, 4005), false) -, Tuple.Create(Tuple.Create("", 4030), Tuple.Create("]", 4030), true) +, 3933), false) +, Tuple.Create(Tuple.Create("", 3958), Tuple.Create("]", 3958), true) ); WriteLiteral(">\r\n"); @@ -565,17 +565,17 @@ WriteLiteral("
"); #line hidden WriteLiteral(" (item.StatusId +, Tuple.Create(Tuple.Create(" ", 4111), Tuple.Create(item.StatusId #line default #line hidden -, 4184), false) +, 4112), false) ); WriteLiteral("> "); @@ -701,14 +701,14 @@ WriteLiteral(" class=\"type\""); WriteLiteral(">(item.JobTypeDescription +, Tuple.Create(Tuple.Create("", 4831), Tuple.Create(item.JobTypeDescription #line default #line hidden -, 4903), false) +, 4831), false) ); WriteLiteral(">"); @@ -776,14 +776,14 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral("(item.DeviceModelDescription +, Tuple.Create(Tuple.Create("", 5403), Tuple.Create(item.DeviceModelDescription #line default #line hidden -, 5475), false) +, 5403), false) ); WriteLiteral(">"); @@ -924,14 +924,14 @@ WriteLiteral(" class=\"technician\""); WriteLiteral(">(item.OpenedTechUserDisplayName +, Tuple.Create(Tuple.Create("", 6407), Tuple.Create(item.OpenedTechUserDisplayName #line default #line hidden -, 6479), false) +, 6407), false) ); WriteLiteral(">");