diff --git a/.github/workflows/validate-pr-ab.yml b/.github/workflows/validate-pr-ab.yml new file mode 100644 index 0000000..83b0c2c --- /dev/null +++ b/.github/workflows/validate-pr-ab.yml @@ -0,0 +1,18 @@ +name: 'Description contains AB# with a valid work item id' +on: # rebuild any PRs for main branch changes + pull_request: + types: [opened, reopened, edited] + branches: + - master + +permissions: + contents: read + pull-requests: write + +jobs: + create-edit-comment: + name: check + runs-on: ubuntu-latest + steps: + - uses: danhellem/github-actions-pr-is-linked-to-work-item@main + \ No newline at end of file diff --git a/LogicBuilder.ComponentModel.Design.Serialization.slnx b/LogicBuilder.ComponentModel.Design.Serialization.slnx index 3864e89..3c5936a 100644 --- a/LogicBuilder.ComponentModel.Design.Serialization.slnx +++ b/LogicBuilder.ComponentModel.Design.Serialization.slnx @@ -1,6 +1,7 @@ + diff --git a/LogicBuilder.ComponentModel.Design.Serialization/SR.cs b/LogicBuilder.ComponentModel.Design.Serialization/SR.cs index a43732a..a8dafb9 100644 --- a/LogicBuilder.ComponentModel.Design.Serialization/SR.cs +++ b/LogicBuilder.ComponentModel.Design.Serialization/SR.cs @@ -1810,16 +1810,21 @@ internal sealed class SR internal const string XslTransformFileEditor_Ellipses = "XslTransformFileEditor_Ellipses"; internal const string XslTransformFileEditor_Filter = "XslTransformFileEditor_Filter"; + // Maximum length for string arguments when formatting resource messages. + private const int MaxFormattedStringLength = 0x400; + // Length to which strings are truncated before appending an ellipsis. + private const int TruncatedStringLength = 0x3fd; + internal SR() { - this.resources = new ResourceManager("LogicBuilder.ComponentModel.Design.Serialization.Resources", base.GetType().Assembly); + this.resources = new ResourceManager(typeof(Resources)); } private static LogicBuilder.ComponentModel.Design.Serialization.SR GetLoader() { if (loader == null) { - LogicBuilder.ComponentModel.Design.Serialization.SR sr = new LogicBuilder.ComponentModel.Design.Serialization.SR(); + LogicBuilder.ComponentModel.Design.Serialization.SR sr = new(); Interlocked.CompareExchange(ref loader, sr, null); } return loader; @@ -1859,9 +1864,9 @@ public static string GetString(string name, params object[] args) } for (int i = 0; i < args.Length; i++) { - if ((args[i] is string str2) && (str2.Length > 0x400)) + if ((args[i] is string str2) && (str2.Length > MaxFormattedStringLength)) { - args[i] = str2.Substring(0, 0x3fd) + "..."; + args[i] = str2.Substring(0, TruncatedStringLength) + "..."; } } return string.Format(CultureInfo.CurrentCulture, format, args);