Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/validate-pr-ab.yml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions LogicBuilder.ComponentModel.Design.Serialization.slnx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".github/workflows/ci.yml" />
<File Path=".github/workflows/validate-pr-ab.yml" />
<File Path="Directory.Build.props" />
</Folder>
<Project Path="LogicBuilder.ComponentModel.Design.Serialization.Tests/LogicBuilder.ComponentModel.Design.Serialization.Tests.csproj" Id="a8c7ff01-a569-45c6-adeb-15a6311901fe" />
Expand Down
13 changes: 9 additions & 4 deletions LogicBuilder.ComponentModel.Design.Serialization/SR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<LogicBuilder.ComponentModel.Design.Serialization.SR>(ref loader, sr, null);
}
return loader;
Expand Down Expand Up @@ -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);
Expand Down