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
98 changes: 52 additions & 46 deletions .github/policies/disallow-edits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 27 additions & 0 deletions .github/workflows/live-protection.yml
Original file line number Diff line number Diff line change
@@ -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.'
})
}
7 changes: 6 additions & 1 deletion xml/System.Windows.Forms/Control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8235,7 +8235,12 @@ MyControl.Font = New Font(MyControl.Font, _
> [!NOTE]
> In addition to the <xref:System.Windows.Forms.Control.InvokeRequired%2A> property, there are four methods on a control that are thread safe: <xref:System.Windows.Forms.Control.Invoke%2A>, <xref:System.Windows.Forms.Control.BeginInvoke%2A>, <xref:System.Windows.Forms.Control.EndInvoke%2A>, and <xref:System.Windows.Forms.Control.CreateGraphics%2A> if the handle for the control has already been created. Calling <xref:System.Windows.Forms.Control.CreateGraphics%2A> 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 <xref:System.EventHandler>, in which case the sender parameter will contain this control, and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>. The delegate can also be an instance of <xref:System.Windows.Forms.MethodInvoker>, or any other delegate that takes a void parameter list. A call to an <xref:System.EventHandler> or <xref:System.Windows.Forms.MethodInvoker> delegate will be faster than a call to another type of delegate.
The delegate can be an instance of <xref:System.EventHandler>, 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 <xref:System.EventArgs.Empty?displayProperty=nameWithType>.
- When a single parameter is passed, the sender parameter will contain the first args element and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>.
- If more than one parameter is passed, the sender parameter will contain the first element from `args`, and the <xref:System.EventArgs> parameter will contain the second element.

A call to an <xref:System.EventHandler> or <xref:System.Windows.Forms.MethodInvoker> 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.
Expand Down