.dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/Scripts/chat.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 | $(function () {
3 | var chatInput = $("#chat-input");
4 | var userName;
5 |
6 | //ask for a username
7 | setTimeout(function () {
8 | userName = prompt("Please enter a username.");
9 | }, 0);
10 |
11 | var chat = $.connection.chat;
12 | var chatWindow = $("#chat-window");
13 |
14 | //this is the function that's run when the "messageReceived" function is called from the server
15 | chat.client.messageReceived = function (username, message) {
16 | chatWindow.append("" + username + ": " + message + "
");
17 | };
18 |
19 | $.connection.hub.start().done(function () {
20 | chatInput.keydown(function (e) {
21 |
22 | if (e.which === 13) {
23 | var text = chatInput.val();
24 |
25 | //empty the textbox
26 | chatInput.val("");
27 |
28 | //send the message to the server
29 | chat.server.sendMessage(userName, text);
30 |
31 | //focus cursor on the textbox for easy chatting!
32 | self.focus();
33 | }
34 | });
35 | });
36 | });
37 | })(jQuery);
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/Scripts/jquery.signalR-2.2.0.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ASP.NET SignalR JavaScript Library v2.2.0
3 | * http://signalr.net/
4 | *
5 | * Copyright (C) Microsoft Corporation. All rights reserved.
6 | *
7 | */
8 | (function(n,t,i){function w(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function b(n){return n==="http:"?80:n==="https:"?443:void 0}function a(n,t){return t.match(/:\d+$/)?t:t+":"+b(n)}function k(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if(typeof n!="function")throw new Error(f.nojQuery);var r,h,s=t.document.readyState==="complete",e=n(t),c="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},v=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},y=function(n){return n.state===r.connectionState.disconnected},l=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},p=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,"TimeoutException")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new k(this,function(n){f.triggerHandler(u.onReceived,[n])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+a(u.protocol,u.host)!==r.protocol+a(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var a=this,v={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,y=a._deferral||n.Deferred(),b=t.document.createElement("a"),k,g;if(a.lastError=null,a._deferral=y,!a.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(v,i),n.type(v.callback)==="function"&&(h=v.callback)),v.transport=w(v.transport,a),!v.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(a._.config=v,!s&&v.waitForPageLoad===!0)?(a._.deferredStartHandler=function(){a.start(i,h)},e.bind("load",a._.deferredStartHandler),y.promise()):a.state===r.connectionState.connecting?y.promise():o(a,r.connectionState.disconnected,r.connectionState.connecting)===!1?(y.resolve(a),y.promise()):(p(a),b.href=a.url,b.protocol&&b.protocol!==":"?(a.protocol=b.protocol,a.host=b.host):(a.protocol=t.document.location.protocol,a.host=b.host||t.document.location.host),a.baseUrl=a.protocol+"//"+a.host,a.wsProtocol=a.protocol==="https:"?"wss://":"ws://",v.transport==="auto"&&v.jsonp===!0&&(v.transport="longPolling"),a.url.indexOf("//")===0&&(a.url=t.location.protocol+a.url,a.log("Protocol relative URL detected, normalizing it to '"+a.url+"'.")),this.isCrossDomain(a.url)&&(a.log("Auto detected cross domain url."),v.transport==="auto"&&(v.transport=["webSockets","serverSentEvents","longPolling"]),typeof v.withCredentials=="undefined"&&(v.withCredentials=!0),v.jsonp||(v.jsonp=!n.support.cors,v.jsonp&&a.log("Using jsonp because this browser doesn't support CORS.")),a.contentType=r._.defaultContentType),a.withCredentials=v.withCredentials,a.ajaxDataType=v.jsonp?"jsonp":"text",n(a).bind(u.onStart,function(){n.type(h)==="function"&&h.call(a);y.resolve(a)}),a._.initHandler=r.transports._logic.initHandler(a),d=function(i,s){var c=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){s===0?a.log("No transports supported by the server were selected."):s===1?a.log("No fallback transports were selected."):a.log("Fallback transports exhausted.");n(a).triggerHandler(u.onError,[c]);y.reject(c);a.stop();return}if(a.state!==r.connectionState.disconnected){var p=i[s],h=r.transports[p],v=function(){d(i,s+1)};a.transport=h;try{a._.initHandler.start(h,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!a.withCredentials&&i;a.log("The start request succeeded. Transitioning to the connected state.");l(a)&&r.transports._logic.monitorKeepAlive(a);r.transports._logic.startHeartbeat(a);r._.configurePingInterval(a);o(a,r.connectionState.connecting,r.connectionState.connected)||a.log("WARNING! The connection was not in the connecting state.");a._.connectingMessageBuffer.drain();n(a).triggerHandler(u.onStart);e.bind("unload",function(){a.log("Window unloading, stopping the connection.");a.stop(f)});i&&e.bind("beforeunload",function(){t.setTimeout(function(){a.stop(f)},0)})},v)}catch(w){a.log(h.name+" transport threw '"+w.message+"' when attempting to start.");v()}}},k=a.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);y.reject(e);i.stop()},n(a).triggerHandler(u.onStarting),k=r.transports._logic.prepareQueryString(a,k),a.log("Negotiating with '"+k+"'."),a._.negotiateRequest=r.transports._logic.ajax(a,{url:k,error:function(n,t){t!==c?g(n,a):y.reject(r._.error(f.stoppedWhileNegotiating,null,a._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=a._parseResponse(t)}catch(c){g(r._.error(f.errorParsingNegotiateResponse,c),a);return}if(e=a._.keepAliveData,a.appRelativeUrl=i.Url,a.id=i.ConnectionId,a.token=i.ConnectionToken,a.webSocketServerUrl=i.WebSocketServerUrl,a._.pollTimeout=i.ConnectionTimeout*1e3+1e4,a.disconnectTimeout=i.DisconnectTimeout*1e3,a._.totalTransportConnectTimeout=a.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*a.keepAliveWarnAt,a._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,a.reconnectWindow=a.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==a.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,a.clientProtocol,i.ProtocolVersion));n(a).triggerHandler(u.onError,[h]);y.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(v.transport)?n.each(v.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):v.transport==="auto"?o=s:n.inArray(v.transport,s)>=0&&o.push(v.transport);d(o)}}),y.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var a=this,v=a._deferral;if(a._.deferredStartHandler&&e.unbind("load",a._.deferredStartHandler),delete a._.config,delete a._.deferredStartHandler,!s&&(!a._.config||a._.config.waitForPageLoad===!0)){a.log("Stopping connection prior to negotiate.");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(a.state!==r.connectionState.disconnected)return a.log("Stopping connection."),o(a,a.state,r.connectionState.disconnected),t.clearTimeout(a._.beatHandle),t.clearInterval(a._.pingIntervalId),a.transport&&(a.transport.stop(a),h!==!1&&a.transport.abort(a,i),l(a)&&r.transports._logic.stopMonitoringKeepAlive(a),a.transport=null),a._.negotiateRequest&&(a._.negotiateRequest.abort(c),delete a._.negotiateRequest),a._.initHandler&&a._.initHandler.stop(),n(a).triggerHandler(u.onDisconnect),delete a._deferral,delete a.messageId,delete a.groupsToken,delete a.id,delete a._.pingIntervalId,delete a._.lastMessageAt,delete a._.lastActiveAt,a._.connectingMessageBuffer.clear(),a},log:function(n){v(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=h),r};n.connection&&(h=n.connection);n.connection=n.signalR=r})(window.jQuery,window),function(n,t,i){function s(n){n._.keepAliveData.monitoring&&l(n);u.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){s(n)},n._.beatInterval))}function l(t){var i=t._.keepAliveData,u;t.state===r.connectionState.connected&&(u=(new Date).getTime()-t._.lastMessageAt,u>=i.timeout?(t.log("Keep alive timed out. Notifying transport that connection has been lost."),t.transport.lostConnection(t)):u>=i.timeoutWarning?i.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(f.onConnectionSlow),i.userNotified=!0):i.userNotified=!1)}function e(n,t){var i=n.url+t;return n.transport&&(i+="?transport="+n.transport.name),u.prepareQueryString(n,i)}function h(n){this.connection=n;this.startRequested=!1;this.startCompleted=!1;this.connectionStopped=!1}var r=n.signalR,f=n.signalR.events,c=n.signalR.changeState,o="__Start Aborted__",u;r.transports={};h.prototype={start:function(n,r,u){var f=this,e=f.connection,o=!1;if(f.startRequested||f.connectionStopped){e.log("WARNING! "+n.name+" transport cannot be started. Initialization ongoing or completed.");return}e.log(n.name+" transport starting.");f.transportTimeoutHandle=t.setTimeout(function(){o||(o=!0,e.log(n.name+" transport timed out when trying to connect."),f.transportFailed(n,i,u))},e._.totalTransportConnectTimeout);n.start(e,function(){o||f.initReceived(n,r)},function(t){return o||(o=!0,f.transportFailed(n,t,u)),!f.startCompleted||f.connectionStopped})},stop:function(){this.connectionStopped=!0;t.clearTimeout(this.transportTimeoutHandle);r.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(n,i){var u=this,f=u.connection;if(u.startRequested){f.log("WARNING! The client received multiple init messages.");return}u.connectionStopped||(u.startRequested=!0,t.clearTimeout(u.transportTimeoutHandle),f.log(n.name+" transport connected. Initiating start request."),r.transports._logic.ajaxStart(f,function(){u.startCompleted=!0;i()}))},transportFailed:function(i,u,e){var o=this.connection,h=o._deferral,s;this.connectionStopped||(t.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(s=r._.error(r.resources.errorDuringStartRequest,u),o.log(i.name+" transport failed during the start request. Stopping the connection."),n(o).triggerHandler(f.onError,[s]),h&&h.reject(s),o.stop()):(i.stop(o),o.log(i.name+" transport failed to connect. Attempting to fall back."),e()))}};u=r.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,i=n.Deferred();return t.transport?(e=t.url+"/ping",e=u.addQs(e,t.qs),f=u.ajax(t,{url:e,success:function(n){var u;try{u=t._parseResponse(n)}catch(e){i.reject(r._.transportError(r.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}u.Response==="pong"?i.resolve():i.reject(r._.transportError(r._.format(r.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(i.reject(r._.transportError(r._.format(r.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):i.reject(r._.transportError(r.resources.pingServerFailed,t.transport,n,f))}})):i.reject(r._.transportError(r.resources.noConnectionTransport,t.transport)),i.promise()},prepareQueryString:function(n,i){var r;return r=u.addQs(i,"clientProtocol="+n.clientProtocol),r=u.addQs(r,n.qs),n.token&&(r+="&connectionToken="+t.encodeURIComponent(n.token)),n.data&&(r+="&connectionData="+t.encodeURIComponent(n.data)),r},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f,e){var h=i==="webSockets"?"":n.baseUrl,o=h+n.appRelativeUrl,s="transport="+i;return!e&&n.groupsToken&&(s+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(o+=f?"/poll":"/reconnect",!e&&n.messageId&&(s+="&messageId="+t.encodeURIComponent(n.messageId))):o+="/connect",o+="?"+s,o=u.prepareQueryString(n,o),e||(o+="&tid="+Math.floor(Math.random()*11)),o},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,i){var h=u.stringifySend(t,i),c=e(t,"/send"),o,s=function(t,u){n(u).triggerHandler(f.onError,[r._.transportError(r.resources.sendFailed,u.transport,t,o),i])};return o=u.ajax(t,{url:c,type:t.ajaxDataType==="jsonp"?"GET":"POST",contentType:r._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(r){s(r,t);t.stop();return}u.triggerReceived(t,i)}},error:function(n,i){i!=="abort"&&i!=="parsererror"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!="undefined"){t=typeof t=="undefined"?!0:t;var i=e(n,"/abort");u.ajax(n,{url:i,async:t,timeout:1e3,type:"POST"});n.log("Fired ajax abort async = "+t+".")}},ajaxStart:function(t,i){var h=function(n){var i=t._deferral;i&&i.reject(n)},s=function(i){t.log("The start request failed. Stopping the connection.");n(t).triggerHandler(f.onError,[i]);h(i);t.stop()};t._.startRequest=u.ajax(t,{url:e(t,"/start"),success:function(n,u,f){var e;try{e=t._parseResponse(n)}catch(o){s(r._.error(r._.format(r.resources.errorParsingStartResponse,n),o,f));return}e.Response==="started"?i():s(r._.error(r._.format(r.resources.invalidStartResponse,n),null,f))},error:function(n,i,u){i!==o?s(r._.error(r.resources.errorDuringStartRequest,u,n)):(t.log("The start request aborted because connection.stop() was called."),h(r._.error(r.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(o),delete n._.startRequest)},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(f.onReceived,[i])},processMessages:function(t,i,r){var f;u.markLastMessage(t);i&&(f=u.maximizePersistentResponse(i),u.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){u.triggerReceived(t,i)}),u.tryInitialize(f,r)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,u.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(t)},n(t).bind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+", keep alive timeout of "+i.timeout+" and disconnecting timeout of "+t.disconnectTimeout))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();s(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return u.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===r.connectionState.connected||n.state===r.connectionState.reconnecting},ensureReconnectingState:function(t){return c(t,r.connectionState.connected,r.connectionState.reconnecting)===!0&&n(t).triggerHandler(f.onReconnecting),t.state===r.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var i=r._.format(r.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(i),n(t).triggerHandler(f.onError,[r._.error(i,"TimeoutException")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,i){var f=r.transports[i];if(u.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!u.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){u.verifyLastActive(n)&&(f.stop(n),u.ensureReconnectingState(n)&&(n.log(i+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,i,u,e,o){var s=r._.transportError(r._.format(r.resources.parseFailed,i),t.transport,u,o);e&&e(s)?t.log("Failed to parse server response while attempting to connect."):(n(t).triggerHandler(f.onError,[s]),t.stop())},initHandler:function(n){return new h(n)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){var i;this===e.socket&&(c&&typeof t.wasClean!="undefined"&&t.wasClean===!1?(i=r._.transportError(r.resources.webSocketClosed,e.transport,t),e.log("Unclean disconnect from websocket: "+(t.reason||"[no reason given]."))):e.log("Websocket closed."),s&&s(i)||(i&&n(e).triggerHandler(u.onError,[i]),l.reconnect(e)))},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}y=r.getUrl(o,this.name,v);try{o.log("Attempting to connect to SSE endpoint '"+y+"'.");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log("EventSource failed trying to connect with error "+p.Message+".");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener("open",function(){o.log("EventSource connected.");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener("error",function(n){var r=i._.transportError(i.resources.eventSourceError,o.transport,n);this===o.eventSource&&(h&&h(r)||(o.log("EventSource readyState: "+o.eventSource.readyState+"."),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending."),c.reconnect(o)):(o.log("EventSource error."),a.triggerHandler(u.onError,[r]))))},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages.");e&&e()||l.reconnect(n)};if(t.EventSource){e&&(n.log("Forever Frame is not supported by SignalR on browsers with SSE support."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.documentElement.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occured when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log("LongPolling connected.");s()},y=function(n){return h(n)?(o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var g=s.messageId,nt=g===null,k=!nt,tt=!h,d=i.getUrl(s,a.name,k,tt,!0),b={};(s.messageId&&(b.messageId=s.messageId),s.groupsToken&&(b.groupsToken=s.groupsToken),f(s)!==!0)&&(o.log("Opening long polling request to '"+d+"'."),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:d,type:"POST",contentType:r._.defaultContentType,data:b,timeout:o._.pollTimeout,success:function(r){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),f(s)!==!0)&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){var v=r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr);if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y(v)){if(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+". Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[v])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),k&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort("lostConnection")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+e}function s(n,t,i){for(var f=n.length,u=[],r=0;r
7 |
8 |
9 |
10 |
11 | Index
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/XamarinSignalRExample.Server.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Debug
8 | AnyCPU
9 |
10 |
11 | 2.0
12 | {6A964AB5-A93D-4641-8F53-F264307A1A84}
13 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
14 | Library
15 | Properties
16 | XamarinSignalRExample.Server
17 | XamarinSignalRExample.Server
18 | v4.5.2
19 | true
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | true
30 | full
31 | false
32 | bin\
33 | DEBUG;TRACE
34 | prompt
35 | 4
36 |
37 |
38 | pdbonly
39 | true
40 | bin\
41 | TRACE
42 | prompt
43 | 4
44 |
45 |
46 |
47 | ..\packages\Microsoft.AspNet.SignalR.Core.2.2.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll
48 | True
49 |
50 |
51 | ..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.2.0\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll
52 | True
53 |
54 |
55 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
56 | True
57 |
58 |
59 |
60 | ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll
61 | True
62 |
63 |
64 | ..\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll
65 | True
66 |
67 |
68 | ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll
69 | True
70 |
71 |
72 | ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll
73 | True
74 |
75 |
76 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
77 | True
78 |
79 |
80 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll
81 | True
82 |
83 |
84 | ..\packages\Owin.1.0\lib\net40\Owin.dll
85 | True
86 |
87 |
88 |
89 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll
90 | True
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll
103 | True
104 |
105 |
106 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
107 | True
108 |
109 |
110 | ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll
111 | True
112 |
113 |
114 | ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll
115 | True
116 |
117 |
118 | ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll
119 | True
120 |
121 |
122 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll
123 | True
124 |
125 |
126 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll
127 | True
128 |
129 |
130 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll
131 | True
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | Web.config
146 |
147 |
148 | Web.config
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 | Global.asax
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 | 10.0
188 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | True
198 | True
199 | 63172
200 | /
201 | http://localhost:63172/
202 | False
203 | False
204 |
205 |
206 | False
207 |
208 |
209 |
210 |
211 |
212 |
213 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
214 |
215 |
216 |
217 |
218 |
225 |
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/XamarinSignalRExample.Server/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/XamarinSignalRExample.Server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/XamarinSignalRExample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinSignalRExample", "XamarinSignalRExample\XamarinSignalRExample.csproj", "{54105BD6-73FD-4A53-A6EB-84C91ED65833}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinSignalRExample.iOS", "iOS\XamarinSignalRExample.iOS.csproj", "{D7DBF3E3-78E3-40D7-889C-A253C910E57E}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinSignalRExample.Droid", "Droid\XamarinSignalRExample.Droid.csproj", "{22957A98-E767-4F1B-9995-C1171FA33256}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinSignalRExample.UITests", "UITests\XamarinSignalRExample.UITests.csproj", "{97DFF570-9CC0-460B-9BDE-5091E12609D0}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinSignalRExample.Server", "XamarinSignalRExample.Server\XamarinSignalRExample.Server.csproj", "{6A964AB5-A93D-4641-8F53-F264307A1A84}"
15 | EndProject
16 | Global
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 | Debug|Any CPU = Debug|Any CPU
19 | Debug|iPhone = Debug|iPhone
20 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
21 | Release|Any CPU = Release|Any CPU
22 | Release|iPhone = Release|iPhone
23 | Release|iPhoneSimulator = Release|iPhoneSimulator
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Debug|iPhone.ActiveCfg = Debug|Any CPU
29 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Debug|iPhone.Build.0 = Debug|Any CPU
30 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
31 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
32 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Release|iPhone.ActiveCfg = Release|Any CPU
35 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Release|iPhone.Build.0 = Release|Any CPU
36 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
37 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
38 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
39 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
40 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Debug|iPhone.ActiveCfg = Debug|iPhone
41 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Debug|iPhone.Build.0 = Debug|iPhone
42 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
43 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
44 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Release|Any CPU.ActiveCfg = Release|iPhone
45 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Release|Any CPU.Build.0 = Release|iPhone
46 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Release|iPhone.ActiveCfg = Release|iPhone
47 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Release|iPhone.Build.0 = Release|iPhone
48 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
49 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
50 | {22957A98-E767-4F1B-9995-C1171FA33256}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51 | {22957A98-E767-4F1B-9995-C1171FA33256}.Debug|Any CPU.Build.0 = Debug|Any CPU
52 | {22957A98-E767-4F1B-9995-C1171FA33256}.Debug|iPhone.ActiveCfg = Debug|Any CPU
53 | {22957A98-E767-4F1B-9995-C1171FA33256}.Debug|iPhone.Build.0 = Debug|Any CPU
54 | {22957A98-E767-4F1B-9995-C1171FA33256}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
55 | {22957A98-E767-4F1B-9995-C1171FA33256}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
56 | {22957A98-E767-4F1B-9995-C1171FA33256}.Release|Any CPU.ActiveCfg = Release|Any CPU
57 | {22957A98-E767-4F1B-9995-C1171FA33256}.Release|Any CPU.Build.0 = Release|Any CPU
58 | {22957A98-E767-4F1B-9995-C1171FA33256}.Release|iPhone.ActiveCfg = Release|Any CPU
59 | {22957A98-E767-4F1B-9995-C1171FA33256}.Release|iPhone.Build.0 = Release|Any CPU
60 | {22957A98-E767-4F1B-9995-C1171FA33256}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
61 | {22957A98-E767-4F1B-9995-C1171FA33256}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
62 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
64 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Debug|iPhone.ActiveCfg = Debug|Any CPU
65 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Debug|iPhone.Build.0 = Debug|Any CPU
66 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
67 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
68 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
69 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Release|Any CPU.Build.0 = Release|Any CPU
70 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Release|iPhone.ActiveCfg = Release|Any CPU
71 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Release|iPhone.Build.0 = Release|Any CPU
72 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
73 | {97DFF570-9CC0-460B-9BDE-5091E12609D0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
74 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Debug|Any CPU.Build.0 = Debug|Any CPU
76 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Debug|iPhone.ActiveCfg = Debug|Any CPU
77 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Debug|iPhone.Build.0 = Debug|Any CPU
78 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
79 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
80 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Release|Any CPU.ActiveCfg = Release|Any CPU
81 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Release|Any CPU.Build.0 = Release|Any CPU
82 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Release|iPhone.ActiveCfg = Release|Any CPU
83 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Release|iPhone.Build.0 = Release|Any CPU
84 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
85 | {6A964AB5-A93D-4641-8F53-F264307A1A84}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
86 | EndGlobalSection
87 | GlobalSection(SolutionProperties) = preSolution
88 | HideSolutionNode = FALSE
89 | EndGlobalSection
90 | EndGlobal
91 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/ChatListViewCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using System.Collections.ObjectModel;
5 |
6 | namespace XamarinSignalRExample
7 | {
8 |
9 | public class ChatListViewCell : ViewCell {
10 | public ChatListViewCell() {
11 | var label = new Label();
12 |
13 | label.SetBinding (Label.TextProperty, "Text");
14 | View = new StackLayout {
15 | Padding = new Thickness(5),
16 | Children = {
17 | label
18 | }
19 | };
20 | }
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/ChatListViewStackLayout.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using System.Collections.ObjectModel;
5 |
6 | namespace XamarinSignalRExample
7 | {
8 |
9 | public class ChatListViewStackLayout : StackLayout
10 | {
11 | private ObservableCollection TextContainer = new ObservableCollection();
12 | public ListView ListView = new ListView();
13 |
14 | public ChatListViewStackLayout()
15 | {
16 | ListView = new ListView {
17 | ItemsSource = TextContainer,
18 | VerticalOptions = LayoutOptions.FillAndExpand,
19 | ItemTemplate = new DataTemplate (typeof(ChatListViewCell)),
20 | SeparatorVisibility = SeparatorVisibility.None,
21 | HasUnevenRows = true
22 | };
23 | Children.Add(ListView);
24 | }
25 |
26 | public void AddText(string text)
27 | {
28 | TextContainer.Add(new MessageText {Text = text});
29 | }
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/MessageText.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using System.Collections.ObjectModel;
5 |
6 | namespace XamarinSignalRExample
7 | {
8 |
9 | public class MessageText
10 | {
11 | public string Text { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle ("XamarinSignalRExample")]
8 | [assembly: AssemblyDescription ("")]
9 | [assembly: AssemblyConfiguration ("")]
10 | [assembly: AssemblyCompany ("")]
11 | [assembly: AssemblyProduct ("")]
12 | [assembly: AssemblyCopyright ("owner")]
13 | [assembly: AssemblyTrademark ("")]
14 | [assembly: AssemblyCulture ("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion ("1.0.*")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
28 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/SendMessageStackLayout.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using System.Collections.ObjectModel;
5 |
6 | namespace XamarinSignalRExample
7 | {
8 |
9 | public class SendMessageStackLayout : StackLayout
10 | {
11 | private Entry Entry;
12 | private Button EnterButton;
13 | public event OnMessageSent MessageSent;
14 | public delegate void OnMessageSent(string message);
15 |
16 | public SendMessageStackLayout()
17 | {
18 | Orientation = StackOrientation.Horizontal;
19 |
20 | EnterButton = new Button {
21 | Text = "Send",
22 | HorizontalOptions = LayoutOptions.EndAndExpand
23 | };
24 | EnterButton.Clicked += EnterButton_Clicked;
25 |
26 | Entry = new Entry {
27 | Placeholder = "Enter a message",
28 | HorizontalOptions = LayoutOptions.FillAndExpand
29 | };
30 |
31 | Children.Add (new Label {
32 | Text="Text:"
33 | });
34 | Children.Add(Entry);
35 | Children.Add(EnterButton);
36 | }
37 |
38 | private void EnterButton_Clicked(object sender, EventArgs e)
39 | {
40 | var messageSent = MessageSent;
41 | if (messageSent != null)
42 | messageSent(Entry.Text);
43 |
44 | Entry.Text = string.Empty;
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/SignalRClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.AspNet.SignalR.Client;
3 | using System.Threading.Tasks;
4 | using System.ComponentModel;
5 | using System.Runtime.CompilerServices;
6 |
7 | namespace XamarinSignalRExample
8 | {
9 | public class SignalRClient : INotifyPropertyChanged
10 | {
11 | private HubConnection Connection;
12 | private IHubProxy ChatHubProxy;
13 |
14 | public delegate void MessageReceived(string username, string message);
15 | public event MessageReceived OnMessageReceived;
16 |
17 | public SignalRClient(string url)
18 | {
19 | Connection = new HubConnection(url);
20 |
21 | Connection.StateChanged += (StateChange obj) => {
22 | OnPropertyChanged("ConnectionState");
23 | };
24 |
25 | ChatHubProxy = Connection.CreateHubProxy("Chat");
26 | ChatHubProxy.On("MessageReceived", (username, text) => {
27 | OnMessageReceived?.Invoke(username, text);
28 | });
29 | }
30 |
31 | public void SendMessage(string username, string text)
32 | {
33 | ChatHubProxy.Invoke ("SendMessage", username, text);
34 | }
35 |
36 | public Task Start()
37 | {
38 | return Connection.Start();
39 | }
40 |
41 | public bool IsConnectedOrConnecting {
42 | get {
43 | return Connection.State != ConnectionState.Disconnected;
44 | }
45 | }
46 |
47 | public ConnectionState ConnectionState { get { return Connection.State; } }
48 |
49 | public static async Task CreateAndStart(string url)
50 | {
51 | var client = new SignalRClient(url);
52 | await client.Start();
53 | return client;
54 | }
55 |
56 | public event PropertyChangedEventHandler PropertyChanged;
57 |
58 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
59 | {
60 | var handler = PropertyChanged;
61 | if (handler != null)
62 | handler (this, new PropertyChangedEventArgs (propertyName));
63 | }
64 |
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/UsernameStackLayout.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using System.Collections.ObjectModel;
5 |
6 | namespace XamarinSignalRExample
7 | {
8 |
9 | public class UsernameStackLayout : StackLayout
10 | {
11 | public UsernameStackLayout()
12 | {
13 | Orientation = StackOrientation.Horizontal;
14 | Children.Add(new Label {Text="Username:"});
15 | UsernameTextbox = new Entry {
16 | HorizontalOptions = LayoutOptions.FillAndExpand
17 | };
18 | Children.Add(UsernameTextbox);
19 | }
20 |
21 | public Entry UsernameTextbox { get; private set; }
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/XamarinSignalRExample.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using System.Collections.ObjectModel;
5 |
6 | namespace XamarinSignalRExample
7 | {
8 | public class App : Application
9 | {
10 | public SignalRClient SignalRClient = new SignalRClient("http://localhost:9995");
11 |
12 | public App()
13 | {
14 | //show an error if the connection doesn't succeed for some reason
15 | SignalRClient.Start ().ContinueWith(task => {
16 | if (task.IsFaulted)
17 | MainPage.DisplayAlert("Error", "An error occurred when trying to connect to SignalR: " + task.Exception.InnerExceptions[0].Message, "OK");
18 | });
19 |
20 |
21 | //try to reconnect every 10 seconds, just in case
22 | Device.StartTimer (TimeSpan.FromSeconds (10), () => {
23 | if (!SignalRClient.IsConnectedOrConnecting)
24 | SignalRClient.Start();
25 |
26 | return true;
27 | });
28 |
29 | var usernameStack = new UsernameStackLayout();
30 | var sendMessage = new SendMessageStackLayout();
31 | var listView = new ChatListViewStackLayout ();
32 | var connectionLabel = new Label {
33 | HorizontalOptions = LayoutOptions.CenterAndExpand,
34 | BindingContext = SignalRClient
35 | };
36 | connectionLabel.SetBinding (Label.TextProperty, "ConnectionState");
37 |
38 | // The root page of your application
39 | MainPage = new ContentPage
40 | {
41 | Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5),
42 | Content = new StackLayout
43 | {
44 | Children = {
45 | new Label {
46 | FontSize = 12.0,
47 | HorizontalOptions = LayoutOptions.CenterAndExpand,
48 | Text = "SignalR + Xamarin!"
49 | },
50 | usernameStack,
51 | sendMessage,
52 | listView,
53 | connectionLabel
54 | }
55 | }
56 | };
57 |
58 | sendMessage.MessageSent += (message) => {
59 | listView.AddText("Me: " + message);
60 | SignalRClient.SendMessage(usernameStack.UsernameTextbox.Text, message);
61 | };
62 |
63 | SignalRClient.OnMessageReceived += (username, message) =>{
64 | listView.AddText(username + ": " + message);
65 | };
66 | }
67 | }
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/XamarinSignalRExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}
8 | Library
9 | XamarinSignalRExample
10 | XamarinSignalRExample
11 | v4.5
12 | Profile78
13 |
14 |
15 | true
16 | full
17 | false
18 | bin\Debug
19 | DEBUG;
20 | prompt
21 | 4
22 | false
23 |
24 |
25 | full
26 | true
27 | bin\Release
28 | prompt
29 | 4
30 | false
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | ..\packages\Newtonsoft.Json.6.0.4\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll
47 |
48 |
49 | ..\packages\Microsoft.Net.Http.2.2.28\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll
50 |
51 |
52 | ..\packages\Microsoft.Net.Http.2.2.28\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll
53 |
54 |
55 | ..\packages\Microsoft.Net.Http.2.2.28\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll
56 |
57 |
58 | ..\packages\Microsoft.AspNet.SignalR.Client.2.2.0\lib\portable-net45+sl5+netcore45+wp8+wp81\Microsoft.AspNet.SignalR.Client.dll
59 |
60 |
61 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll
62 |
63 |
64 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll
65 |
66 |
67 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/XamarinSignalRExample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace XamarinSignalRExample.iOS
9 | {
10 | [Register ("AppDelegate")]
11 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
12 | {
13 | public override bool FinishedLaunching (UIApplication app, NSDictionary options)
14 | {
15 | global::Xamarin.Forms.Forms.Init ();
16 |
17 | // Code for starting up the Xamarin Test Cloud Agent
18 | #if ENABLE_TEST_CLOUD
19 | Xamarin.Calabash.Start();
20 | #endif
21 |
22 | LoadApplication (new App ());
23 |
24 | return base.FinishedLaunching (app, options);
25 | }
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/iOS/ITunesArtwork:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/ITunesArtwork
--------------------------------------------------------------------------------
/iOS/ITunesArtwork@2x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/ITunesArtwork@2x
--------------------------------------------------------------------------------
/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | XamarinSignalRExample
7 | CFBundleIdentifier
8 | net.schneids.xamarinsignalrexample
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSRequiresIPhoneOS
14 |
15 | MinimumOSVersion
16 | 7.0
17 | UIDeviceFamily
18 |
19 | 1
20 | 2
21 |
22 | UIRequiredDeviceCapabilities
23 |
24 | armv7
25 |
26 | UISupportedInterfaceOrientations
27 |
28 | UIInterfaceOrientationPortrait
29 | UIInterfaceOrientationLandscapeLeft
30 | UIInterfaceOrientationLandscapeRight
31 |
32 | UISupportedInterfaceOrientations~ipad
33 |
34 | UIInterfaceOrientationPortrait
35 | UIInterfaceOrientationPortraitUpsideDown
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | CFBundleIconFiles
40 |
41 | Icon-60@2x
42 | Icon-60@3x
43 | Icon-76
44 | Icon-76@2x
45 | Default
46 | Default@2x
47 | Default-568h
48 | Default-568h@2x
49 | Default-Landscape
50 | Default-Landscape@2x
51 | Default-Portrait
52 | Default-Portrait@2x
53 | Icon-Small-40
54 | Icon-Small-40@2x
55 | Icon-Small-40@3x
56 | Icon-Small
57 | Icon-Small@2x
58 | Icon-Small@3x
59 |
60 | UILaunchStoryboardName
61 | LaunchScreen
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace XamarinSignalRExample.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main (string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main (args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Default.png
--------------------------------------------------------------------------------
/iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-60@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-60@3x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-76.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-76@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-Small-40.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/schneidenbach/Xamarin-Forms-and-SignalR-Example/d8aaa0321c1715196456a7930396330a1a4abeef/iOS/Resources/Icon-Small@3x.png
--------------------------------------------------------------------------------
/iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/iOS/XamarinSignalRExample.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {D7DBF3E3-78E3-40D7-889C-A253C910E57E}
8 | Exe
9 | XamarinSignalRExample.iOS
10 | Resources
11 | XamarinSignalRExampleiOS
12 |
13 |
14 | true
15 | full
16 | false
17 | bin\iPhoneSimulator\Debug
18 | DEBUG;ENABLE_TEST_CLOUD;
19 | prompt
20 | 4
21 | false
22 | i386
23 | None
24 | true
25 | true
26 |
27 |
28 | full
29 | true
30 | bin\iPhone\Release
31 | prompt
32 | 4
33 | Entitlements.plist
34 | ARMv7, ARM64
35 | false
36 | iPhone Developer
37 |
38 |
39 | full
40 | true
41 | bin\iPhoneSimulator\Release
42 | prompt
43 | 4
44 | i386
45 | false
46 | None
47 |
48 |
49 | true
50 | full
51 | false
52 | bin\iPhone\Debug
53 | DEBUG;ENABLE_TEST_CLOUD;
54 | prompt
55 | 4
56 | false
57 | ARMv7, ARM64
58 | Entitlements.plist
59 | true
60 | iPhone Developer
61 | true
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | ..\packages\Xamarin.TestCloud.Agent.0.13.0\lib\Xamarin.iOS10\Calabash.dll
70 |
71 |
72 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
73 |
74 |
75 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
76 |
77 |
78 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
79 |
80 |
81 | ..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
82 |
83 |
84 |
85 |
86 | {54105BD6-73FD-4A53-A6EB-84C91ED65833}
87 | XamarinSignalRExample
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------