コード例 #1
0
        public Broadcaster()
        {
            _hubContext  = GlobalHost.ConnectionManager.GetHubContext <MoveShapeHub>();
            _model       = new ShapeModel();
            _modelUpdate = false;

            _broadcastLoop = new Timer(
                BroadcastShape, null,
                BroadcasterInterval,
                BroadcasterInterval);
        }
コード例 #2
0
 /// <summary>
 /// Updates the model.
 /// </summary>
 /// <param name="clientModel">The client model.</param>
 public void UpdateModel(ShapeModel clientModel)
 {
     clientModel.LastUpdateBy = Context.ConnectionId;
     _broadcaster.UpdateShape(clientModel);
 }
コード例 #3
0
 /// <summary>
 /// Updates the shape.
 /// </summary>
 /// <param name="clientModel">The client model.</param>
 public void UpdateShape(ShapeModel clientModel)
 {
     _model       = clientModel;
     _modelUpdate = true;
 }