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
1 change: 0 additions & 1 deletion snippets/csharp/System.Windows/Rect/Overview/MyApp.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:SDKSample"
Expand Down
16 changes: 10 additions & 6 deletions snippets/csharp/System.Windows/Rect/Overview/MyApp.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
using System;
using System.Windows;
using System.Windows.Navigation;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.IO;

namespace SDKSample
{
public partial class MyApp : Application
{
[STAThread]
public static void Main()
{
MyApp app = new MyApp();
app.InitializeComponent();
app.Run();
}

public MyApp()
{
Expand All @@ -30,9 +33,10 @@ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionE
StreamWriter wr = new StreamWriter("error.txt");
wr.Write(args.ExceptionObject.ToString());
wr.Close();
}catch( Exception e)
}
catch(Exception)
{
throw e;
throw;
}
MessageBox.Show("Unhandled exception: " + args.ExceptionObject.ToString());
}
Expand Down
2 changes: 0 additions & 2 deletions snippets/csharp/System.Windows/Rect/Overview/MyApp1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Microsoft.Samples.RectExamples.MyApp"
Startup="myAppStartup">


</Application>
11 changes: 3 additions & 8 deletions snippets/csharp/System.Windows/Rect/Overview/MyApp1.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using SDKSample;
using System;
using System.Windows;
using System.Data;
using System.Xml;
using System.Configuration;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;

namespace Microsoft.Samples.RectExamples
{
Expand Down Expand Up @@ -33,4 +28,4 @@ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionE
MessageBox.Show("Unhandled exception: " + args.ExceptionObject.ToString());
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <SnippetRectExampleWholePage>
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
Expand All @@ -23,7 +22,7 @@ public RectExample()
// 150 wide. The left side of the rectangle is 10 pixels from the left of the
// Canvas and the top side of the rectangle is 100 pixels from the top of the Canvas.
// Note: You could alternatively use the Rect Constructor to create this:
// Rect my Rect1 = new Rect(10,100,150,100");
// Rect myRect1 = new Rect(10, 100, 150, 100);
Rect myRect1 = new Rect();
myRect1.X = 10;
myRect1.Y = 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace Microsoft.Samples.RectExamples
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0-windows</TargetFrameworks>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

Expand Down
Loading