Просмотр исходного кода

Add a nuget version of the portable class library test to Rx.NET\Samples\Portable

Donna Malayeri 12 лет назад
Родитель
Сommit
bbbb344316

+ 1 - 0
.gitignore

@@ -165,3 +165,4 @@ Rx.NET/Source/Rx.sln.ide/
 Ix.NET/Source/Interactive Extensions.sln.ide/
 Rx.NET/tools/HomoIcon/HomoIcon.sln.ide/
 Rx.NET/Test/Rx/packages/
+Rx.NET/Samples/Portable/Portable.sln.ide/

+ 14 - 2
Rx.NET/Samples/Portable/Portable.sln

@@ -1,12 +1,14 @@
 
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortableClassLibrary", "PortableClassLibrary\PortableClassLibrary.csproj", "{24A63BF3-D9ED-4F4D-B576-E7A73AE00420}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net40ConsoleApplication", "Net40ConsoleApplication\Net40ConsoleApplication.csproj", "{CCCD13E5-63B9-43C7-93B7-71E6709CFDEC}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightApplication", "SilverlightApplication\SilverlightApplication.csproj", "{50100DB6-3657-444B-B308-42A9FD1B283E}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortableClassLibrary_NuGet", "PortableClassLibrary_NuGet\PortableClassLibrary_NuGet.csproj", "{291DBA6E-5B96-4D97-8150-36B47053D978}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -47,6 +49,16 @@ Global
 		{50100DB6-3657-444B-B308-42A9FD1B283E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
 		{50100DB6-3657-444B-B308-42A9FD1B283E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{50100DB6-3657-444B-B308-42A9FD1B283E}.Release|x86.ActiveCfg = Release|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Release|Any CPU.Build.0 = Release|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{291DBA6E-5B96-4D97-8150-36B47053D978}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 6 - 1
Rx.NET/Samples/Portable/PortableClassLibrary/PortableClassLibrary.csproj

@@ -11,9 +11,14 @@
     <RootNamespace>PortableClassLibrary</RootNamespace>
     <AssemblyName>PortableClassLibrary</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <TargetFrameworkProfile>Profile2</TargetFrameworkProfile>
+    <TargetFrameworkProfile>Profile88</TargetFrameworkProfile>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <OldToolsVersion>4.0</OldToolsVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>

+ 28 - 0
Rx.NET/Samples/Portable/PortableClassLibrary_NuGet/PortableClass.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using System.Reactive;
+using System.Reactive.Linq;
+using System.Reactive.Concurrency;
+
+namespace PortableClassLibrary
+{
+    public class PortableClass
+    {
+        public IObservable<long> CreateTimer(int numSamples, TimeSpan timespan)
+        {
+            var fromTime = DateTimeOffset.Now.Add(timespan);
+            return Observable.Timer(fromTime, timespan)
+                    .Take(numSamples);
+        }
+
+        public IObservable<int> CreateList(IScheduler scheduler)
+        {
+            var values = new [] {1,2,5,7,8,324,4234,654654};
+
+            return values.ToObservable(scheduler);
+        }        
+    }
+}

+ 83 - 0
Rx.NET/Samples/Portable/PortableClassLibrary_NuGet/PortableClassLibrary_NuGet.csproj

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{291DBA6E-5B96-4D97-8150-36B47053D978}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>PortableClassLibrary_NuGet</RootNamespace>
+    <AssemblyName>PortableClassLibrary_NuGet</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Profile88</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <OldToolsVersion>4.0</OldToolsVersion>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <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|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <!-- A reference to the entire .NET Framework is automatically included -->
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="PortableClass.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.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>

+ 30 - 0
Rx.NET/Samples/Portable/PortableClassLibrary_NuGet/Properties/AssemblyInfo.cs

@@ -0,0 +1,30 @@
+using System.Resources;
+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("PortableClassLibrary_NuGet")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("PortableClassLibrary_NuGet")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: NeutralResourcesLanguage("en")]
+
+// 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")]

+ 11 - 0
Rx.NET/Samples/Portable/PortableClassLibrary_NuGet/app.config

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-2.6.3.0" newVersion="2.6.3.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>