Skip to content

Commit dbafffa

Browse files
author
Wouter de Kort
committed
Initial commit
0 parents  commit dbafffa

File tree

472 files changed

+240573
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

472 files changed

+240573
-0
lines changed

Chapter1.WPF/App.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<configuration>
4+
<startup>
5+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
6+
</startup>
7+
</configuration>

Chapter1.WPF/App.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application x:Class="Chapter1.WPF.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
StartupUri="MainWindow.xaml">
5+
<Application.Resources>
6+
7+
</Application.Resources>
8+
</Application>

Chapter1.WPF/App.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.Windows;
2+
3+
namespace Chapter1.WPF
4+
{
5+
/// <summary>
6+
/// Interaction logic for App.xaml
7+
/// </summary>
8+
public partial class App : Application
9+
{
10+
}
11+
}

Chapter1.WPF/Chapter1.WPF.csproj

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{F687EF0E-E268-4A6F-9653-FADA8283A288}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Chapter1.WPF</RootNamespace>
11+
<AssemblyName>Chapter1.WPF</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15+
<WarningLevel>4</WarningLevel>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Net.Http" />
41+
<Reference Include="System.Xml" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Core" />
44+
<Reference Include="System.Xml.Linq" />
45+
<Reference Include="System.Data.DataSetExtensions" />
46+
<Reference Include="System.Xaml">
47+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
48+
</Reference>
49+
<Reference Include="WindowsBase" />
50+
<Reference Include="PresentationCore" />
51+
<Reference Include="PresentationFramework" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<ApplicationDefinition Include="App.xaml">
55+
<Generator>MSBuild:Compile</Generator>
56+
<SubType>Designer</SubType>
57+
</ApplicationDefinition>
58+
<Page Include="MainWindow.xaml">
59+
<Generator>MSBuild:Compile</Generator>
60+
<SubType>Designer</SubType>
61+
</Page>
62+
<Compile Include="App.xaml.cs">
63+
<DependentUpon>App.xaml</DependentUpon>
64+
<SubType>Code</SubType>
65+
</Compile>
66+
<Compile Include="MainWindow.xaml.cs">
67+
<DependentUpon>MainWindow.xaml</DependentUpon>
68+
<SubType>Code</SubType>
69+
</Compile>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="Properties\AssemblyInfo.cs">
73+
<SubType>Code</SubType>
74+
</Compile>
75+
<Compile Include="Properties\Resources.Designer.cs">
76+
<AutoGen>True</AutoGen>
77+
<DesignTime>True</DesignTime>
78+
<DependentUpon>Resources.resx</DependentUpon>
79+
</Compile>
80+
<Compile Include="Properties\Settings.Designer.cs">
81+
<AutoGen>True</AutoGen>
82+
<DependentUpon>Settings.settings</DependentUpon>
83+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
84+
</Compile>
85+
<EmbeddedResource Include="Properties\Resources.resx">
86+
<Generator>ResXFileCodeGenerator</Generator>
87+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
88+
</EmbeddedResource>
89+
<None Include="Properties\Settings.settings">
90+
<Generator>SettingsSingleFileGenerator</Generator>
91+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
92+
</None>
93+
<AppDesigner Include="Properties\" />
94+
</ItemGroup>
95+
<ItemGroup>
96+
<None Include="App.config" />
97+
</ItemGroup>
98+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
99+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
100+
Other similar extension points exist, see Microsoft.Common.targets.
101+
<Target Name="BeforeBuild">
102+
</Target>
103+
<Target Name="AfterBuild">
104+
</Target>
105+
-->
106+
</Project>

Chapter1.WPF/MainWindow.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Window x:Class="Chapter1.WPF.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
Title="MainWindow" Height="350" Width="525">
5+
<StackPanel>
6+
<Button Click="Button_Click" Content="Continue on UI Thread" />
7+
<Label Name="Output" Content="Output" />
8+
<Button Click="Button_Click_1" Content="Continue on ThreadPool thread" />
9+
</StackPanel>
10+
</Window>

Chapter1.WPF/MainWindow.xaml.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System.IO;
2+
using System.Net.Http;
3+
using System.Text;
4+
using System.Windows;
5+
6+
namespace Chapter1.WPF
7+
{
8+
/// <summary>
9+
/// Interaction logic for MainWindow.xaml
10+
/// </summary>
11+
public partial class MainWindow : Window
12+
{
13+
public MainWindow()
14+
{
15+
InitializeComponent();
16+
}
17+
18+
private async void Button_Click(object sender, RoutedEventArgs e)
19+
{
20+
var httpClient = new HttpClient();
21+
22+
string content = await httpClient
23+
.GetStringAsync("http://www.microsoft.com")
24+
.ConfigureAwait(false);
25+
26+
Output.Content = content;
27+
}
28+
29+
private async void Button_Click_1(object sender, RoutedEventArgs e)
30+
{
31+
var httpClient = new HttpClient();
32+
33+
string content = await httpClient
34+
.GetStringAsync("http://www.microsoft.com")
35+
.ConfigureAwait(false);
36+
37+
using (var sourceStream = new FileStream("temp.html",
38+
FileMode.Create, FileAccess.Write, FileShare.None,
39+
4096, true))
40+
{
41+
byte[] encodedText = Encoding.Unicode.GetBytes(content);
42+
await sourceStream.WriteAsync(encodedText, 0, encodedText.Length)
43+
.ConfigureAwait(false);
44+
}
45+
;
46+
}
47+
}
48+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
using System.Windows;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
9+
[assembly: AssemblyTitle("Chapter1.WPF")]
10+
[assembly: AssemblyDescription("")]
11+
[assembly: AssemblyConfiguration("")]
12+
[assembly: AssemblyCompany("")]
13+
[assembly: AssemblyProduct("Chapter1.WPF")]
14+
[assembly: AssemblyCopyright("Copyright © 2013")]
15+
[assembly: AssemblyTrademark("")]
16+
[assembly: AssemblyCulture("")]
17+
18+
// Setting ComVisible to false makes the types in this assembly not visible
19+
// to COM components. If you need to access a type in this assembly from
20+
// COM, set the ComVisible attribute to true on that type.
21+
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
55+
[assembly: AssemblyVersion("1.0.0.0")]
56+
[assembly: AssemblyFileVersion("1.0.0.0")]

Chapter1.WPF/Properties/Resources.Designer.cs

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)