From 6a9c56df5848d55582173a653f3e71abb96d5d40 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 13:13:37 -0400 Subject: [PATCH] Add locking to the file saving. Update casing on English lang files. --- .../Models/ArchetypeGlobalSettings.cs | 18 ++++++++++-------- app/langs/en-gb.js | 4 ++-- app/langs/en-us.js | 4 ++-- app/langs/en.js | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs index b45594d..58de79c 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; @@ -51,16 +50,19 @@ namespace Archetype.Models public void Save() { - //write to JSON - var configFileModel = new ArchetypeConfigFileModel + lock (_padLock) { - Id = _instance.Id, - CheckForUpdates = _instance.CheckForUpdates - }; + //write to JSON + var configFileModel = new ArchetypeConfigFileModel + { + Id = _instance.Id, + CheckForUpdates = _instance.CheckForUpdates + }; - var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); + var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); - File.WriteAllText(_mappedPathToConfig, serializedJson); + File.WriteAllText(_mappedPathToConfig, serializedJson); + } } private static void _loadSettingsFromConfigFile() diff --git a/app/langs/en-gb.js b/app/langs/en-gb.js index 85889b5..d141e13 100644 --- a/app/langs/en-gb.js +++ b/app/langs/en-gb.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/langs/en-us.js b/app/langs/en-us.js index bdde762..65401c4 100644 --- a/app/langs/en-us.js +++ b/app/langs/en-us.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/langs/en.js b/app/langs/en.js index bdde762..65401c4 100644 --- a/app/langs/en.js +++ b/app/langs/en.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType",