Skip to content

Commit 8058d83

Browse files
Merge pull request #10884 from dotnet/main
Merge main into live
2 parents 1116eb0 + 6e160c1 commit 8058d83

File tree

8 files changed

+24
-35
lines changed

8 files changed

+24
-35
lines changed

.github/workflows/live-protection.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1+
name: Base branch checker
12
on: [pull_request]
23

34
permissions:
45
contents: read
56

67
jobs:
7-
comment:
8+
live_protection_job:
9+
name: Check base branch
810
runs-on: ubuntu-latest
11+
912
steps:
1013
- name: Harden Runner
11-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
14+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
1215
with:
1316
egress-policy: audit
1417

1518
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
1619
env:
17-
SHOULD_COMMENT: ${{ github.base_ref == 'refs/heads/live' && !(github.head_ref == 'refs/heads/main') }}
20+
LIVE_BASE: ${{ github.base_ref == 'live' && github.head_ref != 'main' }}
1821
with:
1922
script: |
20-
if (process.env.SHOULD_COMMENT == 'true') {
21-
github.issues.createComment({
22-
issue_number: context.issue.number,
23-
owner: context.repo.owner,
24-
repo: context.repo.repo,
25-
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.'
26-
})
23+
if (process.env.LIVE_BASE == 'true') {
24+
core.setFailed('PR targets live branch')
2725
}

snippets/csharp/System.Windows/Rect/Overview/MyApp.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
32
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
43
xmlns:my="clr-namespace:SDKSample"

snippets/csharp/System.Windows/Rect/Overview/MyApp.xaml.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
using System;
22
using System.Windows;
3-
using System.Windows.Navigation;
4-
using System.Windows.Controls;
5-
using System.Windows.Media;
6-
using System.Windows.Media.Animation;
73
using System.IO;
84

95
namespace SDKSample
106
{
117
public partial class MyApp : Application
128
{
9+
[STAThread]
10+
public static void Main()
11+
{
12+
MyApp app = new MyApp();
13+
app.InitializeComponent();
14+
app.Run();
15+
}
1316

1417
public MyApp()
1518
{
@@ -30,9 +33,10 @@ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionE
3033
StreamWriter wr = new StreamWriter("error.txt");
3134
wr.Write(args.ExceptionObject.ToString());
3235
wr.Close();
33-
}catch( Exception e)
36+
}
37+
catch(Exception)
3438
{
35-
throw e;
39+
throw;
3640
}
3741
MessageBox.Show("Unhandled exception: " + args.ExceptionObject.ToString());
3842
}

snippets/csharp/System.Windows/Rect/Overview/MyApp1.xaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
x:Class="Microsoft.Samples.RectExamples.MyApp"
55
Startup="myAppStartup">
6-
7-
86
</Application>

snippets/csharp/System.Windows/Rect/Overview/MyApp1.xaml.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
using System;
1+
using SDKSample;
2+
using System;
23
using System.Windows;
3-
using System.Data;
4-
using System.Xml;
5-
using System.Configuration;
6-
using System.Windows.Media;
7-
using System.Windows.Media.Animation;
8-
using System.Windows.Navigation;
94

105
namespace Microsoft.Samples.RectExamples
116
{
@@ -33,4 +28,4 @@ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionE
3328
MessageBox.Show("Unhandled exception: " + args.ExceptionObject.ToString());
3429
}
3530
}
36-
}
31+
}

snippets/csharp/System.Windows/Rect/Overview/RectExample.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// <SnippetRectExampleWholePage>
2-
using System;
32
using System.Windows;
43
using System.Windows.Controls;
54
using System.Windows.Media;
@@ -23,7 +22,7 @@ public RectExample()
2322
// 150 wide. The left side of the rectangle is 10 pixels from the left of the
2423
// Canvas and the top side of the rectangle is 100 pixels from the top of the Canvas.
2524
// Note: You could alternatively use the Rect Constructor to create this:
26-
// Rect my Rect1 = new Rect(10,100,150,100");
25+
// Rect myRect1 = new Rect(10, 100, 150, 100);
2726
Rect myRect1 = new Rect();
2827
myRect1.X = 10;
2928
myRect1.Y = 100;

snippets/csharp/System.Windows/Rect/Overview/RectExample1.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
using System;
22
using System.Windows;
33
using System.Windows.Controls;
4-
using System.Windows.Documents;
5-
using System.Windows.Navigation;
64
using System.Windows.Shapes;
7-
using System.Windows.Data;
85
using System.Windows.Media;
9-
using System.Windows.Media.Animation;
106

117
namespace Microsoft.Samples.RectExamples
128
{

snippets/csharp/System.Windows/Rect/Overview/Snippets.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net6.0-windows</TargetFrameworks>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net6.0-windows</TargetFramework>
66
<UseWPF>true</UseWPF>
77
</PropertyGroup>
88

0 commit comments

Comments
 (0)