diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index 14920829730..ee9f6a9089f 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -3,49 +3,55 @@ description: GitOps.PullRequestIssueManagement primitive resource: repository configuration: - resourceManagementConfiguration: - eventResponderTasks: - - description: Close PRs that modify files whose "source of truth" is not in this repo. - if: - - payloadType: Pull_Request - - isAction: - action: Opened - - or: - - includesModifiedFiles: - files: - - xml/Microsoft.Extensions*/* - excludedFiles: - # These files use this repo as source-of-truth. - - xml/Microsoft.Extensions.FileSystemGlobbing/* - - xml/Microsoft.Extensions.FileSystemGlobbing.Abstractions/* - - xml/Microsoft.Extensions.FileSystemGlobbing.Internal*/* - - includesModifiedFiles: - files: - - xml/System.Composition - - includesModifiedFiles: - files: - - xml/System.Formats.Cbor - - includesModifiedFiles: - files: - - xml/System.Formats.Nrbf - - includesModifiedFiles: - files: - - xml/System.Net.ServerSentEvents - - includesModifiedFiles: - files: - - xml/System.Numerics.Tensors - - includesModifiedFiles: - files: - - xml/System.Speech - - includesModifiedFile: - file: xml/System.Runtime.Serialization/ISerializationCodeDomSurrogateProvider.xml - - includesModifiedFile: - file: xml/System.Runtime.Serialization/ImportOptions.xml - - includesModifiedFile: - file: xml/System.Runtime.Serialization/XsdDataContractExporter.xml - then: - - addReply: - reply: >- - Hello @${issueAuthor}, - - This PR will be closed because it edits files whose 'source of truth' is not in the repo. + resourceManagementConfiguration: + eventResponderTasks: + - description: Close PRs that modify files whose "source of truth" is not in this repo. + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - or: + - includesModifiedFiles: + files: + - xml/Microsoft.Extensions*/* + excludedFiles: + # These files use this repo as source-of-truth. + - xml/Microsoft.Extensions.FileSystemGlobbing/* + - xml/Microsoft.Extensions.FileSystemGlobbing.Abstractions/* + - xml/Microsoft.Extensions.FileSystemGlobbing.Internal*/* + - includesModifiedFiles: + files: + - xml/System.Composition/* + - includesModifiedFiles: + files: + - xml/System.Formats.Cbor/* + - includesModifiedFiles: + files: + - xml/System.Formats.Nrbf/* + - includesModifiedFiles: + files: + - xml/System.Net.ServerSentEvents/* + - includesModifiedFiles: + files: + - xml/System.Numerics.Tensors/* + - includesModifiedFiles: + files: + - xml/System.Speech/* + - includesModifiedFile: + file: xml/System.Runtime.Serialization/ISerializationCodeDomSurrogateProvider.xml + - includesModifiedFile: + file: xml/System.Runtime.Serialization/ImportOptions.xml + - includesModifiedFile: + file: xml/System.Runtime.Serialization/XsdDataContractExporter.xml + then: + - addReply: + reply: >- + @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. + - if: + - or: + - activitySenderHasPermission: + permission: None + - activitySenderHasPermission: + permission: Read + then: + - closePullRequest diff --git a/.github/workflows/live-protection.yml b/.github/workflows/live-protection.yml new file mode 100644 index 00000000000..3f097ac42e5 --- /dev/null +++ b/.github/workflows/live-protection.yml @@ -0,0 +1,27 @@ +on: [pull_request] + +permissions: + contents: read + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + env: + SHOULD_COMMENT: ${{ github.base_ref == 'refs/heads/live' && !(github.head_ref == 'refs/heads/main') }} + with: + script: | + if (process.env.SHOULD_COMMENT == 'true') { + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'It looks like this pull request may have been opened on the `live` branch by mistake. In general, PRs should target the `main` branch.' + }) + } diff --git a/xml/System.Windows.Forms/Control.xml b/xml/System.Windows.Forms/Control.xml index ffff62953e5..89f0c9a77c8 100644 --- a/xml/System.Windows.Forms/Control.xml +++ b/xml/System.Windows.Forms/Control.xml @@ -8235,7 +8235,12 @@ MyControl.Font = New Font(MyControl.Font, _ > [!NOTE] > In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread. - The delegate can be an instance of , in which case the sender parameter will contain this control, and the event parameter will contain . The delegate can also be an instance of , or any other delegate that takes a void parameter list. A call to an or delegate will be faster than a call to another type of delegate. + The delegate can be an instance of , in which case the parameters will depend on the `args` value: +- If no parameters are passed, the sender parameter will contain this control and the event parameter will contain . +- When a single parameter is passed, the sender parameter will contain the first args element and the event parameter will contain . +- If more than one parameter is passed, the sender parameter will contain the first element from `args`, and the parameter will contain the second element. + + A call to an or delegate will be faster than a call to another type of delegate. > [!NOTE] > An exception might be thrown if the thread that should process the message is no longer active.