This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using Microsoft.AspNet.SignalR; | |
namespace MoveShape | |
{ | |
public class MoveShapeHub : Hub | |
{ | |
// Broadcast 50 times per second | |
private static readonly TimeSpan BroadcastInterval = TimeSpan.FromMilliseconds(20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SignalR MoveShape Demo</title> | |
<style> | |
#shape { | |
width: 100px; | |
height: 100px; | |
background-color: #FF0000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SignalR MoveShape Demo</title> | |
<style> | |
#shape { | |
width: 100px; | |
height: 100px; | |
background-color: #FF0000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using Microsoft.AspNet.SignalR; | |
namespace MoveShape | |
{ | |
public class MoveShapeHub : Hub | |
{ | |
// Is set via the constructor on each creation | |
private Broadcaster _broadcaster; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using Microsoft.AspNet.SignalR; | |
namespace MoveShape | |
{ | |
public class Broadcaster | |
{ | |
private readonly static Lazy<Broadcaster> _instance = new Lazy<Broadcaster>(() => new Broadcaster()); | |
private readonly TimeSpan BroadcastInterval = TimeSpan.FromMilliseconds(20); // We're going to broadcast to all clients 50 times per second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
namespace MoveShape | |
{ | |
public class ShapeModel | |
{ | |
// We declare Left and Top as lowercase with JsonProperty to sync the client and server models | |
[JsonProperty("left")] | |
public double Left { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
namespace MoveShape | |
{ | |
public class ShapeModel | |
{ | |
// We declare Left and Top as lowercase with JsonProperty to sync the client and server models | |
[JsonProperty("left")] | |
public double Left { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
namespace EndGate.Core.Utilities | |
{ | |
internal class Looper : IDisposable | |
{ | |
private object _updateLock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../Scripts/jquery-2.0.0.js" /> | |
/// <reference path="codemirror.js" /> | |
(function () { | |
var fileCache = {}, | |
fileListTemplate = $("<li class='fileNav'><a href='#'></a></li>"), | |
fileList = $("#_fileList"), | |
fileContent = $("#_fileContent"), | |
jsScriptHolder = $("#_scripts"), | |
newFileListNav = function (name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Web; | |
using Microsoft.AspNet.SignalR; | |
namespace DryRunDemo | |
{ | |
public class GameHub : Hub |
OlderNewer