diff --git a/src/Skybrud.Umbraco.GridData/Extensions/TypedGridExtensionMethods.cs b/src/Skybrud.Umbraco.GridData/Extensions/TypedGridExtensionMethods.cs index 6980a01..3f1626f 100644 --- a/src/Skybrud.Umbraco.GridData/Extensions/TypedGridExtensionMethods.cs +++ b/src/Skybrud.Umbraco.GridData/Extensions/TypedGridExtensionMethods.cs @@ -22,7 +22,7 @@ public static class TypedGridExtensionMethods { /// /// Returns a instance representing the value of the property with the specified - /// . If the property doesn't exist or it's value doesn't match a + /// . If the property doesn't exist, or it's value doesn't match a /// instance, a instance representing an empty grid /// model is returned instead. /// @@ -34,7 +34,7 @@ public static GridDataModel GetGridModel(this IPublishedContent? content, string /// /// Returns a instance representing the value of the property with the specified - /// . If the property doesn't exist or it's value doesn't match a + /// . If the property doesn't exist, or it's value doesn't match a /// instance, is returned instead. /// /// The parent content item. diff --git a/src/Skybrud.Umbraco.GridData/Manifests/GridManifestFilter.cs b/src/Skybrud.Umbraco.GridData/Manifests/GridManifestFilter.cs index 9a00ce9..471068b 100644 --- a/src/Skybrud.Umbraco.GridData/Manifests/GridManifestFilter.cs +++ b/src/Skybrud.Umbraco.GridData/Manifests/GridManifestFilter.cs @@ -10,6 +10,7 @@ public class GridManifestFilter : IManifestFilter { public void Filter(List manifests) { manifests.Add(new PackageManifest { AllowPackageTelemetry = true, + PackageId = GridPackage.Alias, PackageName = GridPackage.Name, Version = GridPackage.InformationalVersion }); diff --git a/src/Skybrud.Umbraco.GridData/Models/GridArea.cs b/src/Skybrud.Umbraco.GridData/Models/GridArea.cs index 3354687..ee91f27 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridArea.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridArea.cs @@ -105,7 +105,7 @@ public GridArea(JObject json, GridRow row, IGridFactory factory) : base(json) { Grid = json.GetInt32("grid"); AllowAll = json.GetBoolean("allowAll"); Allowed = json.GetStringArray("allowed"); - Controls = json.GetArray("controls", x => factory.CreateGridControl(x, this)) ?? Array.Empty(); + Controls = json.GetArray("controls", x => factory.CreateGridControl(x, this)) ?? []; // Update "PreviousControl" and "NextControl" properties for (int i = 1; i < Controls.Count; i++) { diff --git a/src/Skybrud.Umbraco.GridData/Models/GridControl.cs b/src/Skybrud.Umbraco.GridData/Models/GridControl.cs index 248db4c..8a179bc 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridControl.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridControl.cs @@ -94,7 +94,7 @@ internal GridControl(GridControl control) : base(control.JObject) { #region Member methods /// - /// Returns the value of the control casted to the type of . + /// Returns the value of the control cast to the type of . /// /// The type of the value to be returned. public T? GetValue() where T : IGridControlValue { @@ -111,7 +111,7 @@ public void WriteSearchableText(GridContext context, TextWriter writer) { } /// - /// Returns the value of the control as a searchable text - eg. to be used in Examine. + /// Returns the value of the control as a searchable text - e.g. to be used in Examine. /// /// The current grid context. /// An instance of with the value as a searchable text. diff --git a/src/Skybrud.Umbraco.GridData/Models/GridDataModel.cs b/src/Skybrud.Umbraco.GridData/Models/GridDataModel.cs index 037a3f2..88c7b8c 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridDataModel.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridDataModel.cs @@ -81,9 +81,9 @@ public bool IsValid { Name = json.GetString("name")!; if (factory is null) { - Sections = Array.Empty(); + Sections = []; } else { - Sections = json.GetArray("sections", x => factory.CreateGridSection(x, this)) ?? Array.Empty(); + Sections = json.GetArray("sections", x => factory.CreateGridSection(x, this)) ?? []; } } @@ -138,7 +138,7 @@ public void WriteSearchableText(GridContext context, TextWriter writer) { } /// - /// Returns a textual representation of the grid model - eg. to be used in Examine. + /// Returns a textual representation of the grid model - e.g. to be used in Examine. /// /// The current grid context. /// An instance of representing the value of the element. diff --git a/src/Skybrud.Umbraco.GridData/Models/GridDictionary.cs b/src/Skybrud.Umbraco.GridData/Models/GridDictionary.cs index cf5f9f8..32816bd 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridDictionary.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridDictionary.cs @@ -25,13 +25,13 @@ public class GridDictionary : GridJsonObject, IEnumerable { /// Gets the keys of the underlying dictionary. /// [JsonIgnore] - public string[] Keys => _dictionary.Keys.ToArray(); + public string[] Keys => [.. _dictionary.Keys]; /// /// Gets the keys of the underlying dictionary. /// [JsonIgnore] - public string[] Values => _dictionary.Keys.ToArray(); + public string[] Values => [.. _dictionary.Keys]; /// /// Gets the amount of items in the dictionary. diff --git a/src/Skybrud.Umbraco.GridData/Models/GridEditor.cs b/src/Skybrud.Umbraco.GridData/Models/GridEditor.cs index 15cd129..8d714de 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridEditor.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridEditor.cs @@ -94,7 +94,7 @@ public GridEditor(GridEditor editor) : base(editor.JObject) { #region Member methods /// - /// Returns the config of the editor casted to the type of . + /// Returns the config of the editor cast to the type of . /// /// The type of the config to be returned. public T? GetConfig() where T : IGridEditorConfig { diff --git a/src/Skybrud.Umbraco.GridData/Models/GridElement.cs b/src/Skybrud.Umbraco.GridData/Models/GridElement.cs index 3c219ca..54d3b0f 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridElement.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridElement.cs @@ -62,7 +62,7 @@ protected GridElement(JObject json) : base(json) { public abstract void WriteSearchableText(GridContext context, TextWriter writer); /// - /// Gets a textual representation of the element - eg. to be used in Examine. + /// Gets a textual representation of the element - e.g. to be used in Examine. /// /// The current grid context. /// An instance of representing the value of the element. diff --git a/src/Skybrud.Umbraco.GridData/Models/GridRow.cs b/src/Skybrud.Umbraco.GridData/Models/GridRow.cs index fd4a984..448398f 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridRow.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridRow.cs @@ -94,7 +94,7 @@ public GridRow(JObject json, GridSection section, IGridFactory factory) : base(j Label = json.GetString("label"); Name = json.GetString("name")!; - Areas = json.GetArray("areas", x => factory.CreateGridArea(x, this)) ?? Array.Empty(); + Areas = json.GetArray("areas", x => factory.CreateGridArea(x, this)) ?? []; // Update "PreviousArea" and "NextArea" properties for (int i = 1; i < Areas.Count; i++) { diff --git a/src/Skybrud.Umbraco.GridData/Models/GridSection.cs b/src/Skybrud.Umbraco.GridData/Models/GridSection.cs index 8f89e79..9c5621e 100644 --- a/src/Skybrud.Umbraco.GridData/Models/GridSection.cs +++ b/src/Skybrud.Umbraco.GridData/Models/GridSection.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -66,7 +65,7 @@ public GridSection(JObject json, GridDataModel grid, IGridFactory factory) : bas Model = grid; Grid = json.GetInt32("grid"); Name = grid.Name; - Rows = json.GetArray("rows", x => factory.CreateGridRow(x, this)) ?? Array.Empty(); + Rows = json.GetArray("rows", x => factory.CreateGridRow(x, this)) ?? []; // Update "PreviousRow" and "NextRow" properties for (int i = 1; i < Rows.Count; i++) { @@ -90,7 +89,7 @@ public void WriteSearchableText(GridContext context, TextWriter writer) { } /// - /// Returns a textual representation of the section - eg. to be used in Examine. + /// Returns a textual representation of the section - e.g. to be used in Examine. /// /// The current grid context. /// An instance of representing the value of the element. diff --git a/src/Skybrud.Umbraco.GridData/Models/Values/GridControlEmbedValue.cs b/src/Skybrud.Umbraco.GridData/Models/Values/GridControlEmbedValue.cs index 68339d0..8a34acf 100644 --- a/src/Skybrud.Umbraco.GridData/Models/Values/GridControlEmbedValue.cs +++ b/src/Skybrud.Umbraco.GridData/Models/Values/GridControlEmbedValue.cs @@ -98,7 +98,7 @@ public override string ToString() { } /// - /// Gets a HTML representing the value of the control. + /// Gets an HTML representing the value of the control. /// /// An instance of . public string ToHtmlString() { diff --git a/src/Skybrud.Umbraco.GridData/Models/Values/GridControlMediaFocalPoint.cs b/src/Skybrud.Umbraco.GridData/Models/Values/GridControlMediaFocalPoint.cs index 75e8e8c..c85c188 100644 --- a/src/Skybrud.Umbraco.GridData/Models/Values/GridControlMediaFocalPoint.cs +++ b/src/Skybrud.Umbraco.GridData/Models/Values/GridControlMediaFocalPoint.cs @@ -31,7 +31,7 @@ public class GridControlMediaFocalPoint : GridJsonObject { /// /// Initializes a new instance based on the specified . /// - /// An instance of representing the the focal point. + /// An instance of representing the focal point. protected GridControlMediaFocalPoint(JObject json) : base(json) { Left = json.GetFloat("left"); Top = json.GetFloat("top"); diff --git a/src/Skybrud.Umbraco.GridData/Models/Values/GridControlValueBase.cs b/src/Skybrud.Umbraco.GridData/Models/Values/GridControlValueBase.cs index 5d1b49e..0c641f4 100644 --- a/src/Skybrud.Umbraco.GridData/Models/Values/GridControlValueBase.cs +++ b/src/Skybrud.Umbraco.GridData/Models/Values/GridControlValueBase.cs @@ -25,7 +25,7 @@ public abstract class GridControlValueBase : IGridControlValue { public GridControl Control { get; } /// - /// Gets whether the control is valid (eg. whether it has a value). + /// Gets whether the control is valid (e.g. whether it has a value). /// [JsonIgnore] public virtual bool IsValid => true; diff --git a/src/Skybrud.Umbraco.GridData/Models/Values/IGridControlValue.cs b/src/Skybrud.Umbraco.GridData/Models/Values/IGridControlValue.cs index 9c41617..e08eecc 100644 --- a/src/Skybrud.Umbraco.GridData/Models/Values/IGridControlValue.cs +++ b/src/Skybrud.Umbraco.GridData/Models/Values/IGridControlValue.cs @@ -28,7 +28,7 @@ public interface IGridControlValue { void WriteSearchableText(GridContext context, TextWriter writer); /// - /// Gets the value of the control as a searchable text - eg. to be used in Examine. + /// Gets the value of the control as a searchable text - e.g. to be used in Examine. /// /// The current grid context. /// An instance of with the value as a searchable text.