diff options
Diffstat (limited to 'Rx/NET/Samples/HOL/CS/Excercise3')
20 files changed, 710 insertions, 0 deletions
diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Start/Excercise3.csproj b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Excercise3.csproj new file mode 100644 index 0000000..3cd88be --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Excercise3.csproj @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{E33DD010-6514-4C5E-89B5-C2BE05F71139}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Excercise3</RootNamespace> + <AssemblyName>Excercise3</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Reactive, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Start/Excercise3.sln b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Excercise3.sln new file mode 100644 index 0000000..220835d --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Excercise3.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excercise3", "Excercise3.csproj", "{E33DD010-6514-4C5E-89B5-C2BE05F71139}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.ActiveCfg = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.Build.0 = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.ActiveCfg = Release|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Start/Program.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Program.cs new file mode 100644 index 0000000..6f060db --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Program.cs @@ -0,0 +1,15 @@ +using System; +using System.Reactive.Linq; +using System.Windows.Forms; + +namespace Excercise3 +{ + class Program + { + static void Main() + { + var frm = new Form(); + Application.Run(frm); + } + } +} diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Start/Properties/AssemblyInfo.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f6fd521 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Start/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Excercise3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Excercise3")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ebd40c6-5262-421f-83f4-2978bf532d01")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Excercise3.csproj b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Excercise3.csproj new file mode 100644 index 0000000..527459d --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Excercise3.csproj @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{9C33BFED-D534-4012-83DF-B4A102DCFE92}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Excercise3</RootNamespace> + <AssemblyName>Excercise3</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Reactive, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Excercise3.sln b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Excercise3.sln new file mode 100644 index 0000000..220835d --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Excercise3.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excercise3", "Excercise3.csproj", "{E33DD010-6514-4C5E-89B5-C2BE05F71139}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.ActiveCfg = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.Build.0 = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.ActiveCfg = Release|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Program.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Program.cs new file mode 100644 index 0000000..3347375 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Reactive.Linq; +using System.Windows.Forms; + +namespace Excercise3 +{ + class Program + { + static void Main() + { + var lbl = new Label(); + var frm = new Form() + { + Controls = { lbl } + }; + + frm.MouseMove += (sender, args) => + { + lbl.Text = args.Location.ToString(); // This has become a position-tracking label. + }; + + Application.Run(frm); + } + } +} diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Properties/AssemblyInfo.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f6fd521 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step03/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Excercise3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Excercise3")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ebd40c6-5262-421f-83f4-2978bf532d01")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Excercise3.csproj b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Excercise3.csproj new file mode 100644 index 0000000..c7813b5 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Excercise3.csproj @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{4595D6BB-AFAB-45D1-897E-1FDA4DE03BDE}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Excercise3</RootNamespace> + <AssemblyName>Excercise3</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Reactive, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Excercise3.sln b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Excercise3.sln new file mode 100644 index 0000000..220835d --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Excercise3.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excercise3", "Excercise3.csproj", "{E33DD010-6514-4C5E-89B5-C2BE05F71139}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.ActiveCfg = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.Build.0 = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.ActiveCfg = Release|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Program.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Program.cs new file mode 100644 index 0000000..092f7da --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Program.cs @@ -0,0 +1,28 @@ +using System; +using System.Reactive.Linq; +using System.Windows.Forms; + +namespace Excercise3 +{ + class Program + { + static void Main() + { + var lbl = new Label(); + var frm = new Form() + { + Controls = { lbl } + }; + + var moves = Observable.FromEventPattern<MouseEventArgs>(frm, "MouseMove"); + + using (moves.Subscribe(evt => + { + lbl.Text = evt.EventArgs.Location.ToString(); + })) + { + Application.Run(frm); + } + } + } +} diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Properties/AssemblyInfo.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f6fd521 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step04/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Excercise3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Excercise3")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ebd40c6-5262-421f-83f4-2978bf532d01")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Excercise3.csproj b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Excercise3.csproj new file mode 100644 index 0000000..e951c78 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Excercise3.csproj @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{D3E4FB9F-DEAB-4F03-8330-732F7D8241B8}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Excercise3</RootNamespace> + <AssemblyName>Excercise3</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Reactive, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Excercise3.sln b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Excercise3.sln new file mode 100644 index 0000000..220835d --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Excercise3.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excercise3", "Excercise3.csproj", "{E33DD010-6514-4C5E-89B5-C2BE05F71139}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.ActiveCfg = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.Build.0 = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.ActiveCfg = Release|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Program.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Program.cs new file mode 100644 index 0000000..f1919a3 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Reactive.Linq; +using System.Windows.Forms; + +namespace Excercise3 +{ + class Program + { + static void Main() + { + var lbl = new Label(); + var txt = new TextBox(); + + var frm = new Form() + { + Controls = { lbl} + }; + + frm.Controls.Add(txt); + + Application.Run(frm); + } + } +} diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Properties/AssemblyInfo.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f6fd521 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step05/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Excercise3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Excercise3")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ebd40c6-5262-421f-83f4-2978bf532d01")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Excercise3.csproj b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Excercise3.csproj new file mode 100644 index 0000000..2d5cd5e --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Excercise3.csproj @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{E77F5B43-AB6D-40F5-BE4A-8C2E1883241F}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Excercise3</RootNamespace> + <AssemblyName>Excercise3</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Reactive, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Excercise3.sln b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Excercise3.sln new file mode 100644 index 0000000..220835d --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Excercise3.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excercise3", "Excercise3.csproj", "{E33DD010-6514-4C5E-89B5-C2BE05F71139}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.ActiveCfg = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Debug|x86.Build.0 = Debug|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.ActiveCfg = Release|x86 + {E33DD010-6514-4C5E-89B5-C2BE05F71139}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Program.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Program.cs new file mode 100644 index 0000000..f019d31 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Program.cs @@ -0,0 +1,38 @@ +using System; +using System.Reactive.Linq; +using System.Windows.Forms; +using System.Reactive.Disposables; + +namespace Excercise3 +{ + class Program + { + static void Main() + { + var txt = new TextBox(); + + var frm = new Form() + { + Controls = { txt } + }; + + var moves = Observable.FromEventPattern<MouseEventArgs>(frm, "MouseMove"); + var input = Observable.FromEventPattern(txt, "TextChanged"); + + var moveSubscription = moves.Subscribe(evt => + { + Console.WriteLine("Mouse at: " + evt.EventArgs.Location); + }); + + var inputSubscription = input.Subscribe(evt => + { + Console.WriteLine("User wrote: " + ((TextBox)evt.Sender).Text); + }); + + using (new CompositeDisposable(moveSubscription, inputSubscription)) + { + Application.Run(frm); + } + } + } +} diff --git a/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Properties/AssemblyInfo.cs b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f6fd521 --- /dev/null +++ b/Rx/NET/Samples/HOL/CS/Excercise3/Step06/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Excercise3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Excercise3")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ebd40c6-5262-421f-83f4-2978bf532d01")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] |