qol: use type keywords and more interpolated strings
This commit is contained in:
@@ -236,7 +236,7 @@ namespace Disco.Services.Documents
|
||||
|
||||
private static int chooseMaskPattern(BitArray bits, ErrorCorrectionLevel ecLevel, ZXing.QrCode.Internal.Version version, ByteMatrix matrix)
|
||||
{
|
||||
int minPenalty = Int32.MaxValue; // Lower penalty is better.
|
||||
int minPenalty = int.MaxValue; // Lower penalty is better.
|
||||
int bestMaskPattern = -1;
|
||||
// We try all mask patterns to choose the best one.
|
||||
for (int maskPattern = 0; maskPattern < QRCode.NUM_MASK_PATTERNS; maskPattern++)
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Disco.Services
|
||||
AttachmentDataStoreExtensions.RepositoryFilename);
|
||||
|
||||
if (!publishJobResult.Success)
|
||||
throw new Exception(string.Format("Disco ICT Online Services failed with the following message: ", publishJobResult.ErrorMessage));
|
||||
throw new Exception($"Disco ICT Online Services failed with the following message: {publishJobResult.ErrorMessage}");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(FaultDescription))
|
||||
FaultDescription = publishJobResult.PublishMessage;
|
||||
@@ -433,7 +433,7 @@ namespace Disco.Services
|
||||
AttachmentDataStoreExtensions.RepositoryFilename);
|
||||
|
||||
if (!publishJobResult.Success)
|
||||
throw new Exception(string.Format("Disco ICT Online Services failed with the following message: ", publishJobResult.ErrorMessage));
|
||||
throw new Exception($"Disco ICT Online Services failed with the following message: {publishJobResult.ErrorMessage}");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(RepairDescription))
|
||||
RepairDescription = publishJobResult.PublishMessage;
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
JobId = jqj.JobId,
|
||||
TechUserId = jqj.AddedUserId,
|
||||
Timestamp = jqj.AddedDate,
|
||||
Comments = string.Format("# Added to Queue\r\n**{0}**\r\nPriority: **{1}**\r\n{2}", Environment.NewLine, queue.Name, jqj.Priority.ToString(), string.IsNullOrWhiteSpace(jqj.AddedComment) ? "<no comment>" : jqj.AddedComment)
|
||||
Comments = $"# Added to Queue\r\n**{queue.Name}**\r\nPriority: **{jqj.Priority.ToString()}**\r\n{(string.IsNullOrWhiteSpace(jqj.AddedComment) ? "<no comment>" : jqj.AddedComment)}"
|
||||
});
|
||||
Database.JobLogs.Add(new JobLog()
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Disco.Services.Logging
|
||||
private static object _LogModulesLock = new object();
|
||||
|
||||
private static LogContext _Current;
|
||||
private static object _CurrentLock = new Object();
|
||||
private static object _CurrentLock = new object();
|
||||
public static LogContext Current
|
||||
{
|
||||
get
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Disco.Services.Plugins
|
||||
int num = (obj2 != null) ? (((int)obj2) + 1) : 1000;
|
||||
ViewPage.ViewContext.HttpContext.Items["DiscoPluginLastFormNum"] = num;
|
||||
|
||||
builder.GenerateId(string.Format(CultureInfo.InvariantCulture, "form{0}", new object[] { num }));
|
||||
builder.GenerateId($"form{num}");
|
||||
}
|
||||
ViewPage.ViewContext.Writer.Write(builder.ToString(TagRenderMode.StartTag));
|
||||
MvcForm form = new MvcForm(ViewPage.ViewContext);
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace Disco.Services.Plugins
|
||||
_PluginAssemblyManifests = _PluginManifests.Values.ToDictionary(p => p.PluginAssembly, p => p);
|
||||
}
|
||||
|
||||
public static PluginManifest UpdatePlugin(DiscoDataContext Database, PluginManifest ExistingManifest, String UpdatePluginPackageFilePath, PluginLibraryIncompatibility PluginLibraryIncompatibility = null)
|
||||
public static PluginManifest UpdatePlugin(DiscoDataContext Database, PluginManifest ExistingManifest, string UpdatePluginPackageFilePath, PluginLibraryIncompatibility PluginLibraryIncompatibility = null)
|
||||
{
|
||||
PluginManifest updatedManifest;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Disco.Services.Plugins
|
||||
int num = (lastFormNumber != null) ? (((int)lastFormNumber) + 1) : 1000;
|
||||
ViewPage.ViewContext.HttpContext.Items["DiscoPluginLastFormNum"] = num;
|
||||
|
||||
builder.GenerateId(string.Format(CultureInfo.InvariantCulture, "form{0}", new object[] { num }));
|
||||
builder.GenerateId($"form{num}");
|
||||
}
|
||||
ViewPage.ViewContext.Writer.Write(builder.ToString(TagRenderMode.StartTag));
|
||||
MvcForm form = new MvcForm(ViewPage.ViewContext);
|
||||
|
||||
Reference in New Issue
Block a user