Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated the 4.5 samples

  • Loading branch information...
commit 667d423b92dcabd25b7027a8d747beddb764d785 1 parent 0730e55
Damian Edwards DamianEdwards authored
15 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Global.asax.cs
View
@@ -34,20 +34,5 @@ protected void Application_AuthenticateRequest(object sender, EventArgs e)
}
}
}
-
- private class SamplePipelineModule : HubPipelineModule
- {
- protected override bool OnBeforeIncoming(IHubIncomingInvokerContext context)
- {
- Debug.WriteLine("=> Invoking " + context.MethodDescriptor.Name + " on hub " + context.MethodDescriptor.Hub.Name);
- return base.OnBeforeIncoming(context);
- }
-
- protected override bool OnBeforeOutgoing(IHubOutgoingInvokerContext context)
- {
- Debug.WriteLine("<= Invoking " + context.Invocation.Method + " on client hub " + context.Invocation.Hub);
- return base.OnBeforeOutgoing(context);
- }
- }
}
}
21 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Hubs/ConnectDisconnect/Default.aspx
View
@@ -0,0 +1,21 @@
+<%@ Page Title="ASP.NET SignalR: Connection Status" Language="C#" MasterPageFile="~/SignalR.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Microsoft.AspNet.SignalR.Samples.Hubs.ConnectDisconnect.Default" %>
+
+<asp:Content ContentPlaceHolderID="MainContent" runat="server">
+ <ul class="breadcrumb">
+ <li><a href="<%: ResolveUrl("~/") %>">SignalR Samples</a> <span class="divider">/</span></li>
+ <li class="active">Connection Status</li>
+ </ul>
+
+ <div class="page-header">
+ <h2>Connection Status <small>Handling client connection state</small></h2>
+ <p>Demonstrates how to handle the events that are raised when connections connect, reconnect and disconnect from the Hub API.</p>
+ </div>
+
+ <h4>Connection Status Messages</h4>
+ <ul id="messages">
+ </ul>
+</asp:Content>
+<asp:Content ContentPlaceHolderID="Scripts" runat="server">
+ <script src="<%: ResolveUrl("~/signalr/hubs") %>"></script>
+ <script src="Status.js"></script>
+</asp:Content>
17 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Hubs/ConnectDisconnect/Default.aspx.cs
View
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Microsoft.AspNet.SignalR.Samples.Hubs.ConnectDisconnect
+{
+ public partial class Default : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
17 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Hubs/ConnectDisconnect/Default.aspx.designer.cs
View
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Microsoft.AspNet.SignalR.Samples.Hubs.ConnectDisconnect
+{
+
+
+ public partial class Default
+ {
+ }
+}
17 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Hubs/ConnectDisconnect/index.htm
View
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title></title>
- <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
- <script src="../../Scripts/signalr.samples.js" type="text/javascript"></script>
- <script src="../../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
- <script src="../../Scripts/json2.min.js" type="text/javascript"></script>
- <script src="../../Scripts/jquery.signalR.js" type="text/javascript"></script>
- <script src="../../signalr/hubs" type="text/javascript"></script>
- <script src="Status.js" type="text/javascript"></script>
-</head>
-<body>
- <ul id="messages">
- </ul>
-</body>
-</html>
24 ...Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples.csproj
View
@@ -113,8 +113,8 @@
<Content Include="Hubs\Benchmark\index.htm" />
<Content Include="Hubs\Chat\Mobile.css" />
<Content Include="Hubs\Chat\mobile.htm" />
+ <Content Include="Hubs\ConnectDisconnect\Default.aspx" />
<Content Include="Hubs\ConnectDisconnect\Status.js" />
- <Content Include="Hubs\ConnectDisconnect\index.htm" />
<Content Include="Hubs\DemoHub\crossdomain.htm" />
<Content Include="Hubs\DemoHub\index.htm" />
<Content Include="Hubs\DemoHub\DemoHub.js" />
@@ -157,7 +157,7 @@
<Content Include="Scripts\remedial.js" />
<Content Include="Scripts\jquery.signalR.js" />
<Content Include="Scripts\jquery.signalR.min.js" />
- <Content Include="Streaming\index.html" />
+ <Content Include="Streaming\Default.aspx" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
@@ -232,8 +232,8 @@
<Compile Include="..\Microsoft.AspNet.SignalR.Hosting.AspNet.Samples\Hubs\ShapeShare\ShapeShare.cs">
<Link>Hubs\ShapeShare\ShapeShare.cs</Link>
</Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Hosting.AspNet.Samples\Raw\Raw.cs">
- <Link>Raw\Raw.cs</Link>
+ <Compile Include="..\Microsoft.AspNet.SignalR.Hosting.AspNet.Samples\Raw\RawConnection.cs">
+ <Link>Raw\RawConnection.cs</Link>
</Compile>
<Compile Include="..\Microsoft.AspNet.SignalR.Hosting.AspNet.Samples\Raw\SendingConnection.cs">
<Link>Raw\SendingConnection.cs</Link>
@@ -241,6 +241,9 @@
<Compile Include="..\Microsoft.AspNet.SignalR.Hosting.AspNet.Samples\Raw\TestConnection.cs">
<Link>Raw\TestConnection.cs</Link>
</Compile>
+ <Compile Include="..\Microsoft.AspNet.SignalR.Hosting.AspNet.Samples\Streaming\StreamingConnection.cs">
+ <Link>Streaming\StreamingConnection.cs</Link>
+ </Compile>
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
@@ -256,8 +259,19 @@
<Compile Include="Hubs\Chat\ContentProviders\IContentProvider.cs" />
<Compile Include="Hubs\Chat\ContentProviders\ImageContentProvider.cs" />
<Compile Include="Hubs\Chat\ContentProviders\YouTubeContentProvider.cs" />
+ <Compile Include="Hubs\ConnectDisconnect\Default.aspx.cs">
+ <DependentUpon>Default.aspx</DependentUpon>
+ </Compile>
+ <Compile Include="Hubs\ConnectDisconnect\Default.aspx.designer.cs">
+ <DependentUpon>Default.aspx</DependentUpon>
+ </Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Streaming\Streaming.cs" />
+ <Compile Include="Streaming\Default.aspx.cs">
+ <DependentUpon>Default.aspx</DependentUpon>
+ </Compile>
+ <Compile Include="Streaming\Default.aspx.designer.cs">
+ <DependentUpon>Default.aspx</DependentUpon>
+ </Compile>
</ItemGroup>
<ItemGroup>
<Content Include="packages.config">
31 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Streaming/Default.aspx
View
@@ -0,0 +1,31 @@
+<%@ Page Title="ASP.NET SignalR: Simple Streaming" Language="C#" MasterPageFile="~/SignalR.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Microsoft.AspNet.SignalR.Samples.Streaming.Default" %>
+
+<asp:Content ContentPlaceHolderID="MainContent" runat="server">
+ <ul class="breadcrumb">
+ <li><a href="<%: ResolveUrl("~/") %>">SignalR Samples</a> <span class="divider">/</span></li>
+ <li class="active">Simple Streaming</li>
+ </ul>
+
+ <div class="page-header">
+ <h2>Simple Streaming <small>Broadcasting to connected clients</small></h2>
+ <p>A simple example of a background thread that broadcasts the server time to all connected clients every two seconds.</p>
+ </div>
+
+ <h4>Streaming Messages</h4>
+ <ul id="messages">
+ </ul>
+</asp:Content>
+
+<asp:Content ID="Content3" ContentPlaceHolderID="Scripts" runat="server">
+ <script>
+ $(function () {
+ var connection = $.connection('/streaming-connection');
+
+ connection.received(function (data) {
+ $('#messages').append('<li>' + data + '</li>');
+ });
+
+ connection.start({ transport: activeTransport });
+ });
+ </script>
+</asp:Content>
17 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Streaming/Default.aspx.cs
View
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Microsoft.AspNet.SignalR.Samples.Streaming
+{
+ public partial class Default : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
17 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Streaming/Default.aspx.designer.cs
View
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Microsoft.AspNet.SignalR.Samples.Streaming
+{
+
+
+ public partial class Default
+ {
+ }
+}
7 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Streaming/Streaming.cs
View
@@ -1,7 +0,0 @@
-
-namespace Microsoft.AspNet.SignalR.Samples
-{
- public class Streaming : PersistentConnection
- {
- }
-}
25 samples/Microsoft.AspNet.SignalR.Hosting.AspNet45.Samples/Streaming/index.html
View
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title></title>
- <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
- <script src="../Scripts/signalr.samples.js" type="text/javascript"></script>
- <script src="../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
- <script src="../Scripts/jquery.signalR.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(function () {
- var connection = $.connection('streaming');
-
- connection.received(function (data) {
- $('#messages').append('<li>' + data + '</li>');
- });
-
- connection.start({ transport: activeTransport });
- });
- </script>
-</head>
-<body>
- <ul id="messages">
- </ul>
-</body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.