├── .gitattributes ├── .gitignore ├── AndroidJavaClient ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── aspnet │ │ │ └── signalr │ │ │ └── samples │ │ │ └── androidjavaclient │ │ │ └── MainActivity.java │ │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── CODE-OF-CONDUCT.md ├── ChatSample ├── ChatSample.sln └── ChatSample │ ├── ChatSample.csproj │ ├── Hubs │ └── ChatHub.cs │ ├── Program.cs │ ├── Startup.cs │ └── wwwroot │ ├── index.html │ └── lib │ ├── signalr.js │ ├── signalr.min.js │ └── third-party-notices.txt ├── MoveShape ├── MoveShape.sln └── MoveShape │ ├── Hubs │ └── ShapeHub.cs │ ├── MoveShape.csproj │ ├── Program.cs │ ├── Startup.cs │ └── wwwroot │ ├── index.html │ └── lib │ ├── signalr.js │ ├── signalr.min.js │ └── third-party-notices.txt ├── PullRequestR ├── android │ ├── PullRequestR.iml │ ├── android.iml │ ├── app │ │ ├── .gitignore │ │ ├── app.iml │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── pullrequestr │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ └── pullrequestlayout.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── function-dotnet │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ ├── settings.json │ │ └── tasks.json │ ├── Negotiate.cs │ ├── PullRequests.cs │ ├── function-dotnet.csproj │ ├── host.json │ └── local.settings.json ├── function-javascript │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ ├── settings.json │ │ └── tasks.json │ ├── extensions.csproj │ ├── host.json │ ├── negotiate │ │ ├── function.json │ │ └── index.js │ ├── proxies.json │ └── pullRequests │ │ ├── function.json │ │ └── index.js ├── html │ └── index.html ├── project.code-workspace └── readme.md ├── README.md ├── StockTickR ├── CsharpClient │ ├── CsharpClient.csproj │ └── Program.cs ├── NodeClient │ ├── README.md │ ├── app.js │ ├── package-lock.json │ └── package.json ├── README.md ├── StockTickR.sln └── StockTickRApp │ ├── Hubs │ └── StockTickerHub.cs │ ├── ObservableExtensions.cs │ ├── Program.cs │ ├── Startup.cs │ ├── Stock.cs │ ├── StockTickR.csproj │ ├── StockTicker.cs │ └── wwwroot │ ├── StockTicker.css │ ├── index.html │ └── lib │ ├── signalr.js │ ├── signalr.min.js │ └── stockTicker.js ├── WhiteBoard ├── WhiteBoard.sln └── WhiteBoard │ ├── Hubs │ └── DrawHub.cs │ ├── Program.cs │ ├── Startup.cs │ ├── WhiteBoard.csproj │ └── wwwroot │ ├── index.html │ └── lib │ ├── signalr.js │ ├── signalr.min.js │ └── third-party-notices.txt ├── WindowsFormsSample ├── WindowsFormsSample.sln └── WindowsFormsSample │ ├── App.config │ ├── ChatForm.Designer.cs │ ├── ChatForm.cs │ ├── ChatForm.resx │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── WindowsFormsSample.csproj ├── WindowsUniversal ├── WindowsUniversal.sln └── WindowsUniversal │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml │ ├── WindowsUniversal.csproj │ └── WindowsUniversal_TemporaryKey.pfx └── Xamarin ├── AndroidClient ├── AndroidClient.csproj ├── Assets │ └── AboutAssets.txt ├── MainActivity.cs ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs └── Resources │ ├── AboutResources.txt │ ├── Resource.Designer.cs │ ├── layout │ └── activity_main.axml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ └── values │ ├── Strings.xml │ ├── colors.xml │ ├── ic_launcher_background.xml │ └── styles.xml ├── FormsClient ├── FormsClient.Android │ ├── Assets │ │ └── AboutAssets.txt │ ├── FormsClient.Android.csproj │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ └── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.designer.cs │ │ ├── layout │ │ ├── Tabbar.axml │ │ └── Toolbar.axml │ │ ├── mipmap-anydpi-v26 │ │ ├── icon.xml │ │ └── icon_round.xml │ │ ├── mipmap-hdpi │ │ ├── Icon.png │ │ └── launcher_foreground.png │ │ ├── mipmap-mdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ │ ├── mipmap-xhdpi │ │ ├── Icon.png │ │ └── launcher_foreground.png │ │ ├── mipmap-xxhdpi │ │ ├── Icon.png │ │ └── launcher_foreground.png │ │ ├── mipmap-xxxhdpi │ │ ├── Icon.png │ │ └── launcher_foreground.png │ │ └── values │ │ ├── colors.xml │ │ └── styles.xml ├── FormsClient.UWP │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LargeTile.scale-100.png │ │ ├── LargeTile.scale-200.png │ │ ├── LargeTile.scale-400.png │ │ ├── SmallTile.scale-100.png │ │ ├── SmallTile.scale-200.png │ │ ├── SmallTile.scale-400.png │ │ ├── SplashScreen.scale-100.png │ │ ├── SplashScreen.scale-200.png │ │ ├── SplashScreen.scale-400.png │ │ ├── Square150x150Logo.scale-100.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square150x150Logo.scale-400.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16.png │ │ ├── Square44x44Logo.targetsize-256.png │ │ ├── Square44x44Logo.targetsize-48.png │ │ ├── StoreLogo.backup.png │ │ ├── StoreLogo.scale-100.png │ │ ├── StoreLogo.scale-200.png │ │ ├── StoreLogo.scale-400.png │ │ ├── Wide310x150Logo.scale-100.png │ │ ├── Wide310x150Logo.scale-200.png │ │ └── Wide310x150Logo.scale-400.png │ ├── FormsClient.UWP.csproj │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ └── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml ├── FormsClient.iOS │ ├── AppDelegate.cs │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon1024.png │ │ │ ├── Icon120.png │ │ │ ├── Icon152.png │ │ │ ├── Icon167.png │ │ │ ├── Icon180.png │ │ │ ├── Icon20.png │ │ │ ├── Icon29.png │ │ │ ├── Icon40.png │ │ │ ├── Icon58.png │ │ │ ├── Icon60.png │ │ │ ├── Icon76.png │ │ │ ├── Icon80.png │ │ │ └── Icon87.png │ ├── Entitlements.plist │ ├── FormsClient.iOS.csproj │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ └── LaunchScreen.storyboard └── FormsClient │ ├── App.xaml │ ├── App.xaml.cs │ ├── FormsClient.csproj │ ├── MainPage.xaml │ └── MainPage.xaml.cs ├── README.md ├── Xamarin.sln └── iOSClient ├── AppDelegate.cs ├── Assets.xcassets └── AppIcon.appiconset │ ├── Contents.json │ ├── Icon1024.png │ ├── Icon120.png │ ├── Icon152.png │ ├── Icon167.png │ ├── Icon180.png │ ├── Icon20.png │ ├── Icon29.png │ ├── Icon40.png │ ├── Icon58.png │ ├── Icon60.png │ ├── Icon76.png │ ├── Icon80.png │ └── Icon87.png ├── Entitlements.plist ├── Info.plist ├── LaunchScreen.storyboard ├── Main.cs ├── Main.storyboard ├── Properties └── AssemblyInfo.cs ├── Resources └── LaunchScreen.xib ├── ViewController.cs ├── ViewController.designer.cs ├── app.config └── iOSClient.csproj /.gitattributes: -------------------------------------------------------------------------------- 1 | *.doc diff=astextplain 2 | *.DOC diff=astextplain 3 | *.docx diff=astextplain 4 | *.DOCX diff=astextplain 5 | *.dot diff=astextplain 6 | *.DOT diff=astextplain 7 | *.pdf diff=astextplain 8 | *.PDF diff=astextplain 9 | *.rtf diff=astextplain 10 | *.RTF diff=astextplain 11 | 12 | *.jpg binary 13 | *.png binary 14 | *.gif binary 15 | 16 | *.cs text=auto diff=csharp 17 | *.vb text=auto 18 | *.resx text=auto 19 | *.c text=auto 20 | *.cpp text=auto 21 | *.cxx text=auto 22 | *.h text=auto 23 | *.hxx text=auto 24 | *.py text=auto 25 | *.rb text=auto 26 | *.java text=auto 27 | *.html text=auto 28 | *.htm text=auto 29 | *.css text=auto 30 | *.scss text=auto 31 | *.sass text=auto 32 | *.less text=auto 33 | *.js text=auto 34 | *.lisp text=auto 35 | *.clj text=auto 36 | *.sql text=auto 37 | *.php text=auto 38 | *.lua text=auto 39 | *.m text=auto 40 | *.asm text=auto 41 | *.erl text=auto 42 | *.fs text=auto 43 | *.fsx text=auto 44 | *.hs text=auto 45 | 46 | *.csproj text=auto 47 | *.vbproj text=auto 48 | *.fsproj text=auto 49 | *.dbproj text=auto 50 | *.sln text=auto eol=crlf 51 | 52 | *.sh eol=lf 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Oo]bj/ 2 | [Bb]in/ 3 | TestResults/ 4 | .nuget/ 5 | *.sln.ide/ 6 | _ReSharper.*/ 7 | packages/ 8 | artifacts/ 9 | PublishProfiles/ 10 | .vs/ 11 | *.user 12 | *.suo 13 | *.cache 14 | *.docstates 15 | _ReSharper.* 16 | nuget.exe 17 | *net45.csproj 18 | *net451.csproj 19 | *k10.csproj 20 | *.psess 21 | *.vsp 22 | *.pidb 23 | *.userprefs 24 | *DS_Store 25 | *.ncrunchsolution 26 | *.*sdf 27 | *.ipch 28 | project.lock.json 29 | runtimes/ 30 | .build/ 31 | .testPublish/ 32 | launchSettings.json 33 | node_modules/ 34 | npm-debug.log 35 | *.tmp 36 | *.nuget.props 37 | *.nuget.targets 38 | autobahnreports/ 39 | site.min.css 40 | .idea/ 41 | .vscode/ 42 | signalr-client/ 43 | dist/ 44 | global.json 45 | BenchmarkDotNet.Artifacts/ 46 | korebuild-lock.txt 47 | PullRequestR/android/.gradle/ 48 | !PullRequestR/function-dotnet/.vscode 49 | !PullRequestR/function-javascript/.vscode 50 | !PullRequestR/function-javascript/local.settings.json -------------------------------------------------------------------------------- /AndroidJavaClient/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /AndroidJavaClient/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /AndroidJavaClient/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.microsoft.aspnet.signalr.samples.androidjavaclient" 7 | minSdkVersion 26 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | compileOptions { 20 | targetCompatibility 1.8 21 | sourceCompatibility 1.8 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | implementation 'com.android.support:appcompat-v7:28.0.0-rc01' 28 | implementation 'com.android.support.constraint:constraint-layout:1.1.2' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 32 | implementation 'com.microsoft.signalr:signalr:3.0.0' 33 | implementation group: 'org.slf4j', name: 'slf4j-android', version: '1.7.7' 34 | } 35 | -------------------------------------------------------------------------------- /AndroidJavaClient/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /AndroidJavaClient/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AndroidJavaClient/app/src/main/java/com/microsoft/aspnet/signalr/samples/androidjavaclient/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.aspnet.signalr.samples.androidjavaclient; 2 | 3 | 4 | import android.os.AsyncTask; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.widget.ArrayAdapter; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | import android.widget.ListView; 12 | import android.widget.TextView; 13 | 14 | import com.microsoft.signalr.HubConnection; 15 | import com.microsoft.signalr.HubConnectionBuilder; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | public class MainActivity extends AppCompatActivity { 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_main); 26 | HubConnection hubConnection = HubConnectionBuilder.create("YOUR URL HERE").build(); 27 | TextView textView = (TextView)findViewById(R.id.tvMain); 28 | ListView listView = (ListView)findViewById(R.id.lvMessages); 29 | Button sendButton = (Button)findViewById(R.id.bSend); 30 | EditText editText = (EditText)findViewById(R.id.etMessageText); 31 | 32 | List messageList = new ArrayList(); 33 | ArrayAdapter arrayAdapter = new ArrayAdapter(MainActivity.this, 34 | android.R.layout.simple_list_item_1, messageList); 35 | listView.setAdapter(arrayAdapter); 36 | 37 | hubConnection.on("Send", (message)-> { 38 | runOnUiThread(new Runnable() { 39 | @Override 40 | public void run() { 41 | arrayAdapter.add(message); 42 | arrayAdapter.notifyDataSetChanged(); 43 | } 44 | }); 45 | }, String.class); 46 | 47 | sendButton.setOnClickListener(new View.OnClickListener() { 48 | @Override 49 | public void onClick(View view) { 50 | String message = editText.getText().toString(); 51 | editText.setText(""); 52 | try { 53 | hubConnection.send("Send", message); 54 | } catch (Exception e) { 55 | e.printStackTrace(); 56 | } 57 | } 58 | }); 59 | 60 | new HubConnectionTask().execute(hubConnection); 61 | } 62 | 63 | class HubConnectionTask extends AsyncTask{ 64 | 65 | @Override 66 | protected void onPreExecute() { 67 | super.onPreExecute(); 68 | } 69 | 70 | @Override 71 | protected Void doInBackground(HubConnection... hubConnections) { 72 | HubConnection hubConnection = hubConnections[0]; 73 | hubConnection.start().blockingAwait(); 74 | return null; 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /AndroidJavaClient/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /AndroidJavaClient/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | 18 | 19 | 24 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /WindowsUniversal/WindowsUniversal/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | using Microsoft.AspNetCore.SignalR.Client; 16 | using System.Threading; 17 | using Microsoft.Extensions.Logging; 18 | using Windows.UI.Core; 19 | 20 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 21 | 22 | namespace WindowsUniversal 23 | { 24 | /// 25 | /// An empty page that can be used on its own or navigated to within a Frame. 26 | /// 27 | public sealed partial class MainPage : Page 28 | { 29 | private HubConnection _connection; 30 | 31 | public MainPage() 32 | { 33 | this.InitializeComponent(); 34 | } 35 | 36 | private async void ConnectButton_Click(object sender, RoutedEventArgs e) 37 | { 38 | try 39 | { 40 | _connection = new HubConnectionBuilder() 41 | .WithUrl(UrlTextBox.Text) 42 | .ConfigureLogging(logging => 43 | { 44 | logging.AddDebug(); 45 | logging.SetMinimumLevel(LogLevel.Trace); 46 | }) 47 | .Build(); 48 | 49 | _connection.On("Send", s => 50 | { 51 | // We don't need to actually wait for this, we're done after kicking this off. 52 | _ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => AppendMessage(s)); 53 | }); 54 | 55 | await _connection.StartAsync(); 56 | 57 | ClearMessages(); 58 | 59 | AppendMessage("Connected"); 60 | 61 | ConnectGrid.Visibility = Visibility.Collapsed; 62 | DisconnectGrid.Visibility = Visibility.Visible; 63 | MessageTextBox.IsEnabled = true; 64 | SendButton.IsEnabled = true; 65 | } 66 | catch (Exception ex) 67 | { 68 | AppendMessage($"Error connecting: {ex}"); 69 | } 70 | } 71 | 72 | private void ClearMessages() 73 | { 74 | MessagesListView.Items?.Clear(); 75 | } 76 | 77 | private void AppendMessage(string message) 78 | { 79 | MessagesListView.Items?.Add(message); 80 | } 81 | 82 | private async void SendButton_Click(object sender, RoutedEventArgs e) 83 | { 84 | try 85 | { 86 | await _connection.InvokeAsync("Send", MessageTextBox.Text); 87 | } 88 | catch (Exception ex) 89 | { 90 | AppendMessage($"Error sending: {ex}"); 91 | } 92 | } 93 | 94 | private async void DisconnectButton_Click(object sender, RoutedEventArgs e) 95 | { 96 | try 97 | { 98 | await _connection.StopAsync(); 99 | await _connection.DisposeAsync(); 100 | 101 | AppendMessage("Disconnected"); 102 | 103 | ConnectGrid.Visibility = Visibility.Visible; 104 | DisconnectGrid.Visibility = Visibility.Collapsed; 105 | MessageTextBox.IsEnabled = false; 106 | SendButton.IsEnabled = false; 107 | } 108 | catch (Exception ex) 109 | { 110 | AppendMessage($"Error disconnecting: {ex}"); 111 | } 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /WindowsUniversal/WindowsUniversal/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | WindowsUniversal 7 | Microsoft ASP.NET Core SignalR Team 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /WindowsUniversal/WindowsUniversal/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WindowsUniversal")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsUniversal")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /WindowsUniversal/WindowsUniversal/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /WindowsUniversal/WindowsUniversal/WindowsUniversal_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnet/SignalR-samples/ad86612fc22cb7ecaccb257ea0c0c1b235bc963d/WindowsUniversal/WindowsUniversal/WindowsUniversal_TemporaryKey.pfx -------------------------------------------------------------------------------- /Xamarin/AndroidClient/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); -------------------------------------------------------------------------------- /Xamarin/AndroidClient/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Xamarin/AndroidClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("AndroidApp")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("AndroidApp")] 14 | [assembly: AssemblyCopyright("Copyright © 2018")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /Xamarin/AndroidClient/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.axml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable/ 12 | icon.png 13 | 14 | layout/ 15 | main.axml 16 | 17 | values/ 18 | strings.xml 19 | 20 | In order to get the build system to recognize Android resources, set the build action to 21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 22 | instead operate on resource IDs. When you compile an Android application that uses resources, 23 | the build system will package the resources for distribution and generate a class called "R" 24 | (this is an Android convention) that contains the tokens for each one of the resources 25 | included. For example, for the above Resources layout, this is what the R class would expose: 26 | 27 | public class R { 28 | public class drawable { 29 | public const int icon = 0x123; 30 | } 31 | 32 | public class layout { 33 | public const int main = 0x456; 34 | } 35 | 36 | public class strings { 37 | public const int first_string = 0xabc; 38 | public const int second_string = 0xbcd; 39 | } 40 | } 41 | 42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main 43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first 44 | string in the dictionary file values/strings.xml. -------------------------------------------------------------------------------- /Xamarin/AndroidClient/Resources/layout/activity_main.axml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 |