Skip to content

Commit 17fcbe4

Browse files
CopilotQilongTang
andcommitted
Replace string concatenation with interpolation in DynamoModel.cs
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
1 parent 0830006 commit 17fcbe4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/DynamoCore/Models/DynamoModel.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ protected DynamoModel(IStartConfiguration config)
865865
if (!string.IsNullOrEmpty(templatePath) && File.Exists(templatePath))
866866
{
867867
PreferenceSettings.PythonTemplateFilePath = templatePath;
868-
Logger.Log(Resources.PythonTemplateDefinedByHost + " : " + PreferenceSettings.PythonTemplateFilePath);
868+
Logger.Log($"{Resources.PythonTemplateDefinedByHost} : {PreferenceSettings.PythonTemplateFilePath}");
869869
}
870870

871871
// Otherwise fallback to the default
@@ -885,7 +885,7 @@ protected DynamoModel(IStartConfiguration config)
885885
else
886886
{
887887
// A custom python template path already exists in the DynamoSettings.xml
888-
Logger.Log(Resources.PythonTemplateUserFile + " : " + PreferenceSettings.PythonTemplateFilePath);
888+
Logger.Log($"{Resources.PythonTemplateUserFile} : {PreferenceSettings.PythonTemplateFilePath}");
889889
}
890890
pathManager.Preferences = PreferenceSettings;
891891
PreferenceSettings.RequestUserDataFolder += pathManager.GetUserDataFolder;
@@ -1040,7 +1040,7 @@ protected DynamoModel(IStartConfiguration config)
10401040
{
10411041
if (trustedLoc.StartsWith(programDataPath))
10421042
{
1043-
Logger.Log(("An unsafe path has been detected in Trusted Locations: " + trustedLoc));
1043+
Logger.Log($"An unsafe path has been detected in Trusted Locations: {trustedLoc}");
10441044
}
10451045
}
10461046
}
@@ -1192,7 +1192,7 @@ private void SetDefaultPythonTemplate()
11921192
if (!string.IsNullOrEmpty(pathManager.PythonTemplateFilePath) && File.Exists(pathManager.PythonTemplateFilePath))
11931193
{
11941194
PreferenceSettings.PythonTemplateFilePath = pathManager.PythonTemplateFilePath;
1195-
Logger.Log(Resources.PythonTemplateAppData + " : " + PreferenceSettings.PythonTemplateFilePath);
1195+
Logger.Log($"{Resources.PythonTemplateAppData} : {PreferenceSettings.PythonTemplateFilePath}");
11961196
}
11971197

11981198
// Otherwise the OOTB hard-coded template is applied
@@ -1291,7 +1291,7 @@ internal static void RaiseIExtensionStorageAccessWorkspaceOpened(HomeWorkspaceMo
12911291
}
12921292
catch (Exception ex)
12931293
{
1294-
logger.Log(ex.Message + " : " + ex.StackTrace);
1294+
logger.Log($"{ex.Message} : {ex.StackTrace}");
12951295
return;
12961296
}
12971297
}
@@ -1309,7 +1309,7 @@ internal static void RaiseIExtensionStorageAccessWorkspaceSaving(HomeWorkspaceMo
13091309
}
13101310
catch (Exception ex)
13111311
{
1312-
logger.Log(ex.Message + " : " + ex.StackTrace);
1312+
logger.Log($"{ex.Message} : {ex.StackTrace}");
13131313
return;
13141314
}
13151315

@@ -2707,7 +2707,7 @@ protected void SaveBackupFiles(object state)
27072707
var savePath = pathManager.GetBackupFilePath(workspace);
27082708
OnRequestWorkspaceBackUpSave(savePath, true);
27092709
backupFilesDict[workspace.Guid] = savePath;
2710-
Logger.Log(Resources.BackupSavedMsg + ": " + savePath);
2710+
Logger.Log($"{Resources.BackupSavedMsg}: {savePath}");
27112711
}
27122712
PreferenceSettings.BackupFiles.AddRange(backupFilesDict.Values);
27132713
});
@@ -3469,7 +3469,7 @@ where function.IsVisibleInLibrary
34693469
where !displayString.Contains("GetType")
34703470
select string.IsNullOrEmpty(function.Namespace)
34713471
? ""
3472-
: function.Namespace + "." + function.Signature + "\n"));
3472+
: $"{function.Namespace}.{function.Signature}\n"));
34733473

34743474
var sb = string.Join("\n", descriptions);
34753475

0 commit comments

Comments
 (0)