Skip to content

Commit 6952d2c

Browse files
dotnet-botImmo Landwerth
authored and
Immo Landwerth
committed
Add sources of Microsoft.Bcl and Microsoft.Bcl.Aync NuGet packages
1 parent e458f8d commit 6952d2c

File tree

118 files changed

+26900
-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.

118 files changed

+26900
-0
lines changed

Microsoft.Bcl.Async/CodePlexKey.snk

596 Bytes
Binary file not shown.

Microsoft.Bcl.Async/Microsoft.Threading.Tasks.Extensions.Desktop/AsyncPlatformExtensions.WebClient.cs

+465
Large diffs are not rendered by default.

Microsoft.Bcl.Async/Microsoft.Threading.Tasks.Extensions.Desktop/AsyncPlatformExtensions.cs

+693
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.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>{9D4342DE-EF5A-4ACF-8AFC-0C777D23577B}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>System</RootNamespace>
11+
<AssemblyName>Microsoft.Threading.Tasks.Extensions.Desktop</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<SccProjectName>SAK</SccProjectName>
15+
<SccLocalPath>SAK</SccLocalPath>
16+
<SccAuxPath>SAK</SccAuxPath>
17+
<SccProvider>SAK</SccProvider>
18+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
19+
<RestorePackages>true</RestorePackages>
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
22+
<DebugSymbols>true</DebugSymbols>
23+
<DebugType>full</DebugType>
24+
<Optimize>false</Optimize>
25+
<OutputPath>bin\Debug\</OutputPath>
26+
<DefineConstants>DEBUG;TRACE</DefineConstants>
27+
<ErrorReport>prompt</ErrorReport>
28+
<WarningLevel>4</WarningLevel>
29+
<DocumentationFile>bin\Debug\Microsoft.Threading.Tasks.Extensions.Desktop.xml</DocumentationFile>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<DebugType>pdbonly</DebugType>
33+
<Optimize>true</Optimize>
34+
<OutputPath>bin\Release\</OutputPath>
35+
<DefineConstants>TRACE</DefineConstants>
36+
<ErrorReport>prompt</ErrorReport>
37+
<WarningLevel>4</WarningLevel>
38+
<DocumentationFile>bin\Release\Microsoft.Threading.Tasks.Extensions.Desktop.xml</DocumentationFile>
39+
</PropertyGroup>
40+
<PropertyGroup>
41+
<SignAssembly>true</SignAssembly>
42+
<ExternallyShipping>true</ExternallyShipping>
43+
<AssemblyOriginatorKeyFile>..\CodePlexKey.snk</AssemblyOriginatorKeyFile>
44+
</PropertyGroup>
45+
<ItemGroup>
46+
<Reference Include="System" />
47+
<Reference Include="System.Core" />
48+
<Reference Include="System.Runtime">
49+
<HintPath>..\..\packages\Microsoft.Bcl.1.0.19\lib\net40\System.Runtime.dll</HintPath>
50+
</Reference>
51+
<Reference Include="System.ServiceModel" />
52+
<Reference Include="System.ServiceModel.Channels" />
53+
<Reference Include="System.ServiceModel.Discovery" />
54+
<Reference Include="System.Threading.Tasks">
55+
<HintPath>..\..\packages\Microsoft.Bcl.1.0.19\lib\net40\System.Threading.Tasks.dll</HintPath>
56+
</Reference>
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Xml" />
62+
<Reference Include="WindowsBase" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="..\Microsoft.Threading.Tasks\Threading\Tasks\TaskServices.cs">
66+
<Link>Threading\Tasks\TaskServices.cs</Link>
67+
</Compile>
68+
<Compile Include="AsyncPlatformExtensions.WebClient.cs" />
69+
<Compile Include="Properties\AssemblyInfo.cs" />
70+
<Compile Include="Net\DnsEx.cs" />
71+
<Compile Include="AsyncPlatformExtensions.cs" />
72+
</ItemGroup>
73+
<ItemGroup>
74+
<None Include="app.config" />
75+
<None Include="packages.config" />
76+
</ItemGroup>
77+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78+
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets')" />
79+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
80+
<PropertyGroup>
81+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
82+
</PropertyGroup>
83+
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets'))" />
84+
</Target>
85+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
86+
Other similar extension points exist, see Microsoft.Common.targets.
87+
<Target Name="BeforeBuild">
88+
</Target>
89+
<Target Name="AfterBuild">
90+
</Target>
91+
-->
92+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
4+
namespace System.Net
5+
{
6+
/// <summary>Provides asynchronous wrappers for the <see cref="Dns"/> class.</summary>
7+
public static class DnsEx
8+
{
9+
/// <summary>Asynchronously returns the Internet Protocol (IP) addresses for the specified host.</summary>
10+
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
11+
/// <returns>An array of type System.Net.IPAddress that holds the IP addresses for the host specified.</returns>
12+
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress)
13+
{
14+
return Task<IPAddress[]>.Factory.FromAsync(Dns.BeginGetHostAddresses, Dns.EndGetHostAddresses, hostNameOrAddress, null);
15+
}
16+
17+
/// <summary>Asynchronously resolves an IP address to an System.Net.IPHostEntry instance.</summary>
18+
/// <param name="address">The IP address to resolve.</param>
19+
/// <returns>An System.Net.IPHostEntry instance that contains address information about the host.</returns>
20+
public static Task<IPHostEntry> GetHostEntryAsync(IPAddress address)
21+
{
22+
return Task<IPHostEntry>.Factory.FromAsync(Dns.BeginGetHostEntry, Dns.EndGetHostEntry, address, null);
23+
}
24+
25+
/// <summary>Asynchronously resolves an IP address to an System.Net.IPHostEntry instance.</summary>
26+
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
27+
/// <returns>An System.Net.IPHostEntry instance that contains address information about the host.</returns>
28+
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress)
29+
{
30+
return Task<IPHostEntry>.Factory.FromAsync(Dns.BeginGetHostEntry, Dns.EndGetHostEntry, hostNameOrAddress, null);
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//--------------------------------------------------------------------------
2+
//
3+
// Copyright (c) Microsoft Corporation. All rights reserved.
4+
//
5+
//--------------------------------------------------------------------------
6+
using System.Resources;
7+
using System.Reflection;
8+
using System.Runtime.InteropServices;
9+
using System.Security;
10+
11+
// General Information about an assembly is controlled through the following
12+
// set of attributes. Change these attribute values to modify the information
13+
// associated with an assembly.
14+
[assembly: AssemblyTitle("Microsoft.Threading.Tasks.Extensions.Desktop")]
15+
[assembly: AssemblyDescription("")]
16+
[assembly: AssemblyConfiguration("")]
17+
[assembly: AssemblyProduct("Microsoft.Threading.Tasks.Extensions.Desktop")]
18+
[assembly: AssemblyTrademark("")]
19+
[assembly: AssemblyCulture("")]
20+
[assembly: NeutralResourcesLanguage("en")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.Bcl" version="1.0.19" targetFramework="net40" />
4+
<package id="Microsoft.Bcl.Build" version="1.0.19" targetFramework="net40" />
5+
</packages>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.20506</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{AECCDA63-2C7E-4F94-B609-BA552C619EB3}</ProjectGuid>
9+
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>Microsoft.Threading.Tasks.Phone</RootNamespace>
13+
<AssemblyName>Microsoft.Threading.Tasks.Extensions.Phone</AssemblyName>
14+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
15+
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
16+
<TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
17+
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
18+
<SilverlightApplication>false</SilverlightApplication>
19+
<ValidateXaml>false</ValidateXaml>
20+
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
21+
<SccProjectName>SAK</SccProjectName>
22+
<SccLocalPath>SAK</SccLocalPath>
23+
<SccAuxPath>SAK</SccAuxPath>
24+
<SccProvider>SAK</SccProvider>
25+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
26+
<RestorePackages>true</RestorePackages>
27+
<FixedVersion>true</FixedVersion>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
30+
<DebugSymbols>true</DebugSymbols>
31+
<DebugType>full</DebugType>
32+
<Optimize>false</Optimize>
33+
<OutputPath>Bin\Debug</OutputPath>
34+
<DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
35+
<NoStdLib>true</NoStdLib>
36+
<NoConfig>true</NoConfig>
37+
<ErrorReport>prompt</ErrorReport>
38+
<WarningLevel>4</WarningLevel>
39+
<DocumentationFile>Bin\Debug\Microsoft.Threading.Tasks.Extensions.Phone.xml</DocumentationFile>
40+
</PropertyGroup>
41+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
42+
<DebugType>pdbonly</DebugType>
43+
<Optimize>true</Optimize>
44+
<OutputPath>Bin\Release</OutputPath>
45+
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
46+
<NoStdLib>true</NoStdLib>
47+
<NoConfig>true</NoConfig>
48+
<ErrorReport>prompt</ErrorReport>
49+
<WarningLevel>4</WarningLevel>
50+
<DocumentationFile>Bin\Release\Microsoft.Threading.Tasks.Extensions.Phone.xml</DocumentationFile>
51+
</PropertyGroup>
52+
<PropertyGroup>
53+
<SignAssembly>true</SignAssembly>
54+
<ExternallyShipping>true</ExternallyShipping>
55+
<AssemblyOriginatorKeyFile>..\CodePlexKey.snk</AssemblyOriginatorKeyFile>
56+
</PropertyGroup>
57+
<ItemGroup>
58+
<Reference Include="System" />
59+
<Reference Include="System.Runtime">
60+
<HintPath>..\..\packages\Microsoft.Bcl.1.0.19\lib\sl4-windowsphone71\System.Runtime.dll</HintPath>
61+
</Reference>
62+
<Reference Include="System.Threading.Tasks">
63+
<HintPath>..\..\packages\Microsoft.Bcl.1.0.19\lib\sl4-windowsphone71\System.Threading.Tasks.dll</HintPath>
64+
</Reference>
65+
<Reference Include="System.Windows" />
66+
<Reference Include="System.Net" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<Compile Include="..\Microsoft.Threading.Tasks.Extensions.Desktop\AsyncPlatformExtensions.WebClient.cs">
70+
<Link>AsyncPlatformExtensions.WebClient.cs</Link>
71+
</Compile>
72+
<Compile Include="..\Microsoft.Threading.Tasks.Extensions.Silverlight\AsyncPlatformExtensions.Dispatcher.cs">
73+
<Link>AsyncPlatformExtensions.Dispatcher.cs</Link>
74+
</Compile>
75+
<Compile Include="..\Microsoft.Threading.Tasks\Threading\Tasks\TaskServices.cs">
76+
<Link>Threading\Tasks\TaskServices.cs</Link>
77+
</Compile>
78+
<Compile Include="Properties\AssemblyInfo.cs" />
79+
</ItemGroup>
80+
<ItemGroup>
81+
<None Include="app.config" />
82+
<None Include="packages.config" />
83+
</ItemGroup>
84+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
85+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
86+
<ProjectExtensions />
87+
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets')" />
88+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
89+
<PropertyGroup>
90+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
91+
</PropertyGroup>
92+
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.19\build\Microsoft.Bcl.Build.targets'))" />
93+
</Target>
94+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
95+
Other similar extension points exist, see Microsoft.Common.targets.
96+
<Target Name="BeforeBuild">
97+
</Target>
98+
<Target Name="AfterBuild">
99+
</Target>
100+
-->
101+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//--------------------------------------------------------------------------
2+
//
3+
// Copyright (c) Microsoft Corporation. All rights reserved.
4+
//
5+
//--------------------------------------------------------------------------
6+
using System.Resources;
7+
using System.Reflection;
8+
using System.Runtime.InteropServices;
9+
using System.Security;
10+
11+
// General Information about an assembly is controlled through the following
12+
// set of attributes. Change these attribute values to modify the information
13+
// associated with an assembly.
14+
[assembly: AssemblyTitle("Microsoft.Threading.Tasks.Extensions.Phone")]
15+
[assembly: AssemblyDescription("")]
16+
[assembly: AssemblyConfiguration("")]
17+
[assembly: AssemblyProduct("Microsoft.Threading.Tasks.Extensions.Phone")]
18+
[assembly: AssemblyTrademark("")]
19+
[assembly: AssemblyCulture("")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.Bcl" version="1.0.19" targetFramework="wp71" />
4+
<package id="Microsoft.Bcl.Build" version="1.0.19" targetFramework="wp71" />
5+
</packages>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using System;
2+
using System.Net;
3+
using System.Threading.Tasks;
4+
using System.Windows;
5+
6+
/// <summary>
7+
/// Provides asynchronous wrappers for .NET Framework operations.
8+
/// </summary>
9+
public static partial class AsyncPlatformExtensions
10+
{
11+
/// <summary>Asynchronously invokes an Action on the Dispatcher.</summary>
12+
/// <param name="dispatcher">The Dispatcher.</param>
13+
/// <param name="action">The action to invoke.</param>
14+
/// <returns>A Task that represents the execution of the action.</returns>
15+
public static Task InvokeAsync(this System.Windows.Threading.Dispatcher dispatcher, Action action)
16+
{
17+
if (dispatcher == null) throw new ArgumentNullException("dispatcher");
18+
if (action == null) throw new ArgumentNullException("action");
19+
20+
var tcs = new TaskCompletionSource<VoidTaskResult>();
21+
dispatcher.BeginInvoke(new Action(() =>
22+
{
23+
try
24+
{
25+
action();
26+
tcs.TrySetResult(default(VoidTaskResult));
27+
}
28+
catch (Exception exc)
29+
{
30+
tcs.TrySetException(exc);
31+
}
32+
}));
33+
return tcs.Task;
34+
}
35+
36+
/// <summary>Asynchronously invokes an Action on the Dispatcher.</summary>
37+
/// <param name="dispatcher">The Dispatcher.</param>
38+
/// <param name="function">The function to invoke.</param>
39+
/// <returns>A Task that represents the execution of the function.</returns>
40+
public static Task<TResult> InvokeAsync<TResult>(this System.Windows.Threading.Dispatcher dispatcher, Func<TResult> function)
41+
{
42+
if (dispatcher == null) throw new ArgumentNullException("dispatcher");
43+
if (function == null) throw new ArgumentNullException("function");
44+
45+
var tcs = new TaskCompletionSource<TResult>();
46+
dispatcher.BeginInvoke(new Action(() =>
47+
{
48+
try
49+
{
50+
var result = function();
51+
tcs.TrySetResult(result);
52+
}
53+
catch (Exception exc)
54+
{
55+
tcs.TrySetException(exc);
56+
}
57+
}));
58+
return tcs.Task;
59+
}
60+
}
61+
62+
/// <summary>Used with Task(of void)</summary>
63+
internal struct VoidTaskResult { }

0 commit comments

Comments
 (0)