Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Commit

Permalink
As submitted to NuGet.
Browse files Browse the repository at this point in the history
  • Loading branch information
vegardlarsen committed May 28, 2013
1 parent dc74603 commit 2cfc2b9
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Pusher.Connections.WindowsStore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.1.0")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1.0-prerelease")]
[assembly: AssemblyInformationalVersion("0.0.1.0")]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
<VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.5\tools\Microsoft.Bcl.Build.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">
Expand Down
2 changes: 2 additions & 0 deletions Pusher.Samples.WindowsStore/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.0.19" targetFramework="win" />
<package id="Microsoft.Bcl.Build" version="1.0.5" targetFramework="win" />
<package id="MvvmLight" version="4.1.26.1" targetFramework="win" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="win" />
</packages>
2 changes: 1 addition & 1 deletion Pusher.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pusher.Samples.WindowsStore
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1F1DE06F-0720-4881-BF16-BF9F4F44B333}"
ProjectSection(SolutionItems) = preProject
..\README.md = ..\README.md
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{082A47ED-0510-48EC-9E4D-CE5DE5908E7D}"
Expand Down
12 changes: 6 additions & 6 deletions Pusher/Pusher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,27 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.12-beta\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.16\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.12-beta\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.16\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.5.0.5\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.0.11-beta\lib\portable-net40+sl5+win8+wp8\System.Runtime.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.1.0.19\lib\portable-net40+sl5+win8+wp8\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.0.11-beta\lib\portable-net40+sl5+win8+wp8\System.Threading.Tasks.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.1.0.19\lib\portable-net40+sl5+win8+wp8\System.Threading.Tasks.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.1.0.11-beta\tools\portable-net40+sl4+win8+wp71\Microsoft.Bcl.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.5\tools\Microsoft.Bcl.Build.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">
Expand Down
27 changes: 27 additions & 0 deletions Pusher/Pusher.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>PusherNET</id>
<version>0.0.1</version>
<title>Pusher.NET</title>
<authors>vegardlarsen</authors>
<owners>vegardlarsen</owners>
<projectUrl>https://github.com/digitalcreations/Pusher.NET</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>.NET implementation of Pusher.

When installing this package, you will have to provide a connection method. For now we only provide a built-in connection method for Windows Store apps, new up a Pusher.Connections.WindowsStore.WebsocketConnectionFactory for those.</description>
<releaseNotes>Initial release.</releaseNotes>
<copyright>Copyright 2013 Digital Creations AS.</copyright>
<tags>pusher</tags>
<dependencies>
<dependency id="Microsoft.Bcl.Async" version="1.0.16" />
<dependency id="Newtonsoft.Json" version="5.0.5" />
</dependencies>
</metadata>
<files>
<file src="..\Pusher.Connections.WindowsStore\bin\Release\Pusher.Connections.WindowsStore.dll" target="lib\netcore45\Pusher.Connections.WindowsStore.dll" />
<file src="bin\Release\Pusher.dll" target="lib\netcore45\Pusher.dll" />
<file src="bin\Release\Pusher.dll" target="lib\portable-net45+sl5+win8\Pusher.dll" />
</files>
</package>
11 changes: 8 additions & 3 deletions Pusher/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
<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.5.11.0" newVersion="2.5.11.0" />


<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.11.0" newVersion="2.5.11.0" />
<bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
7 changes: 4 additions & 3 deletions Pusher/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.0.11-beta" targetFramework="portable-win+net45+sl50" />
<package id="Microsoft.Bcl.Async" version="1.0.12-beta" targetFramework="portable-win+net45+sl50" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="portable-win+net45+sl50" />
<package id="Microsoft.Bcl" version="1.0.19" targetFramework="portable-win+net45+sl50" />
<package id="Microsoft.Bcl.Async" version="1.0.16" targetFramework="portable-win+net45+sl50" />
<package id="Microsoft.Bcl.Build" version="1.0.5" targetFramework="portable-win+net45+sl50" />
<package id="Newtonsoft.Json" version="5.0.5" targetFramework="portable-win+net45+sl50" />
</packages>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Pusher.NET==========.NET client library for Pusher.com.Pusher.NET is structured as a Portable Class Library, but is dependent on a WebSocket implementation, which is currently only available for Windows Store apps.How to use----------```csharpvar pusher = new Pusher(new WebsocketConnectionFactory(), appKey);await pusher.ConnectAsync();var fooChannel = await pusher.SubscribeToChannelAsync("foo");fooChannel.EventEmitted += (sender, evt) => { Debug.WriteLine(evt.Data); };```HTTPS-----Use the options object to enable HTTPS:```csharpvar pusher = new Pusher(new WebsocketConnectionFactory(), appKey, new Options { Scheme = WebServiceScheme.Secure });```Authenticators--------------If you want to use private or presence channels, you will have to implement a simple authenticator. How you do this is dependent on your existing infrastructure. You provide the authenticator through the Pusher options object:```csharpvar pusher = new Pusher(new WebsocketConnectionFactory(), appKey, new Options { Authenticator = new MyAuthenticator(whatever, parameters, youNeed) });```Event contracts---------------By default events that are raised contain a string Data field which is straight-up JSON code returned from the server. If you want statically typed access to this object, you will have to provide an event contract.An event contract is most easily created by registering with Pusher:```csharp[DataContract]class SomeDataStructure{ [DataMember(Name = "id")] public int Id { get; set; }}pusher.AddContract(EventContract.Create<SomeDataStructure>("event name"));```Now, you can elect to receive strongly typed events:```csharppusher.GetEventSubscription<SomeDataStructure>().EventEmitted += (sender, evt) { // evt.Data is SomeDataStructure Debug.WriteLine(evt.Data.Id); };```
Pusher.NET==========.NET client library for Pusher.com.Pusher.NET is structured as a Portable Class Library, but is dependent on a WebSocket implementation, which is currently only available for Windows Store apps.Install-------Using Nuget:```PM> Install-Package PusherNET```How to use----------```csharpvar pusher = new Pusher(new WebsocketConnectionFactory(), appKey);await pusher.ConnectAsync();var fooChannel = await pusher.SubscribeToChannelAsync("foo");fooChannel.EventEmitted += (sender, evt) => { Debug.WriteLine(evt.Data); };```PS! `WebsocketConnectionFactory` is currently only implemented for Windows Store apps. Feel free to contribute an implementation for other platforms.HTTPS-----Use the options object to enable HTTPS:```csharpvar pusher = new Pusher(new WebsocketConnectionFactory(), appKey, new Options { Scheme = WebServiceScheme.Secure });```Authenticators--------------If you want to use private or presence channels, you will have to implement a simple authenticator. How you do this is dependent on your existing infrastructure. You provide the authenticator through the Pusher options object:```csharpvar pusher = new Pusher(new WebsocketConnectionFactory(), appKey, new Options { Authenticator = new MyAuthenticator(whatever, parameters, youNeed) });```Event contracts---------------By default events that are raised contain a string Data field which is straight-up JSON code returned from the server. If you want statically typed access to this object, you will have to provide an event contract.An event contract is most easily created by registering with Pusher:```csharp[DataContract]class SomeDataStructure{ [DataMember(Name = "id")] public int Id { get; set; }}pusher.AddContract(EventContract.Create<SomeDataStructure>("event name"));```Now, you can elect to receive strongly typed events:```csharppusher.GetEventSubscription<SomeDataStructure>().EventEmitted += (sender, evt) { // evt.Data is SomeDataStructure Debug.WriteLine(evt.Data.Id); };```
Expand Down

0 comments on commit 2cfc2b9

Please sign in to comment.