├── .gitignore ├── LICENSE ├── README.md ├── assets └── install.gif ├── console1 ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── Program.cs ├── console1.csproj └── global.json ├── console2 ├── Program.cs ├── console2.csproj └── global.json ├── dotnetdebug.sh ├── install.sh ├── remotedebugsetup.bat ├── remotedebugsetup_uno.bat ├── rpiblazor ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── App.razor ├── Data │ ├── WeatherForecast.cs │ └── WeatherForecastService.cs ├── Pages │ ├── Counter.razor │ ├── Error.razor │ ├── FetchData.razor │ ├── Index.razor │ └── _Host.cshtml ├── Program.cs ├── Shared │ ├── MainLayout.razor │ └── NavMenu.razor ├── Startup.cs ├── _Imports.razor ├── appsettings.Development.json ├── appsettings.json ├── global.json ├── rpiblazor.csproj └── wwwroot │ ├── css │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── open-iconic │ │ ├── FONT-LICENSE │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ └── site.css │ └── favicon.ico ├── rpibutton ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── Program.cs ├── global.json └── rpibutton.csproj ├── rpiiothubin ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── Program.cs ├── global.json └── rpiiothubin.csproj ├── rpiiothubout ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── Program.cs ├── global.json └── rpiiothubout.csproj ├── rpiiothubtwitter ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── Program.cs ├── global.json └── rpiiothubtwitter.csproj ├── rpiled ├── .gitignore ├── .vscode │ ├── launch.json │ └── tasks.json ├── Program.cs ├── global.json └── rpiled.csproj └── uno ├── .gitignore ├── .vsconfig ├── global.json ├── uno.Droid ├── Assets │ ├── AboutAssets.txt │ └── Fonts │ │ └── uno-fluentui-assets.ttf ├── Main.cs ├── MainActivity.cs ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Resources │ ├── AboutResources.txt │ ├── drawable │ │ └── Icon.png │ └── values │ │ ├── Strings.xml │ │ └── Styles.xml └── uno.Droid.csproj ├── uno.Shared ├── App.xaml ├── App.xaml.cs ├── Assets │ └── SharedAssets.md ├── MainPage.xaml ├── MainPage.xaml.cs ├── Strings │ └── en │ │ └── Resources.resw ├── uno.Shared.projitems └── uno.Shared.shproj ├── uno.Skia.Gtk ├── .vscode │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── Assets │ └── Fonts │ │ └── uno-fluentui-assets.ttf ├── Program.cs ├── global.json ├── uno.Skia.Gtk.csproj └── workspace.code-workspace ├── uno.Skia.Tizen ├── Assets │ └── Fonts │ │ └── uno-fluentui-assets.ttf ├── Program.cs ├── shared │ └── res │ │ └── Icon.png ├── tizen-manifest.xml └── uno.Skia.Tizen.csproj ├── uno.Skia.WPF.Host ├── App.config ├── App.xaml ├── App.xaml.cs ├── Assets │ └── Fonts │ │ └── uno-fluentui-assets.ttf ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── uno.Skia.Wpf.Host.csproj ├── uno.Skia.WPF ├── Program.cs └── uno.Skia.WPF.csproj ├── uno.UWP ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png ├── Package.appxmanifest ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml └── uno.Uwp.csproj ├── uno.Wasm ├── Assets │ └── SplashScreen.png ├── LinkerConfig.xml ├── Program.cs ├── WasmCSS │ └── Fonts.css ├── WasmScripts │ └── AppManifest.js ├── uno.Wasm.csproj └── wwwroot │ └── web.config ├── uno.iOS ├── Entitlements.plist ├── Info.plist ├── LaunchScreen.storyboard ├── Main.cs ├── Media.xcassets │ ├── AppIcons.appiconset │ │ ├── Contents.json │ │ ├── iPad-76x76@2x.png │ │ ├── iPad-84x84@2x.png │ │ ├── iPhone-20x20@2x.png │ │ ├── iPhone-20x20@3x.png │ │ ├── iPhone-40x40@3x.png │ │ ├── iPhone-60x60@2x.png │ │ └── ios-marketing-1024x1024@1x.png │ └── LaunchImages.launchimage │ │ └── Contents.json ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Default-568h@2x.png │ ├── Fonts │ │ └── uno-fluentui-assets.ttf │ ├── SplashScreen@2x.png │ └── SplashScreen@3x.png └── uno.iOS.csproj ├── uno.macOS ├── AppDelegate.cs ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── AppIcon-128.png │ │ ├── AppIcon-128@2x.png │ │ ├── AppIcon-16.png │ │ ├── AppIcon-16@2x.png │ │ ├── AppIcon-256.png │ │ ├── AppIcon-256@2x.png │ │ ├── AppIcon-32.png │ │ ├── AppIcon-32@2x.png │ │ ├── AppIcon-512.png │ │ ├── AppIcon-512@2x.png │ │ └── Contents.json │ ├── Contents.json │ └── unologo.imageset │ │ ├── Contents.json │ │ └── unoplatform.jpg ├── Entitlements.plist ├── Info.plist ├── Main.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources │ └── Fonts │ │ └── uno-fluentui-assets.ttf └── uno.macOS.csproj └── uno.sln /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Peter Gallagher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dot Net 7 with the Raspberry Pi 2 | 3 | This is the source code to accompany my talk on Microsoft .NET 7 with the Raspberry Pi. 4 | 5 | Talk details, slides and a blog are incoming! 6 | 7 | Tested on a Raspberry Pi 3B+ / Raspberry Pi Zero 2W and a Raspberry Pi 4 8 | 9 | Any Queries, contact me at; 10 | 11 | https://www.petecodes.co.uk/contact/ 12 | 13 | Pete Gallagher / Pete Codes / PJG Creations 2022 14 | 15 | # Blog Post 16 | 17 | You can read the accompanying blog post for this repository here; 18 | 19 | [Install and use .NET 7 with the Raspberry Pi](http://bit.ly/dotnet7pi) 20 | 21 | # .NET 7 Installation on a Raspberry Pi 22 | 23 | You can install Dot Net 7 on the Raspberry Pi in one command by executing; 24 | 25 | ``` 26 | wget -O - https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/master/install.sh | sudo bash 27 | ``` 28 | 29 | You can see a run through of the installation here; 30 | 31 | ![Image](/assets/install.gif "Installation") 32 | 33 | # Local Install Script 34 | 35 | If you've cloned this repo, you can install Dot Net 7 by running the following in the root of the repo; 36 | 37 | ``` 38 | sudo chmod +x install.sh 39 | sudo ./install.sh 40 | 41 | ``` 42 | 43 | # PC Setup 44 | 45 | Download the latest version of the .NET framework for your system from here; 46 | 47 | https://dotnet.microsoft.com/download/dotnet/7.0 48 | 49 | # Other Devices 50 | 51 | ## ODroid HC4 52 | 53 | This script has been tentatively tested on an ODroid HC4, which has an ARM Cortex A55 which is an ARMv8 Processor. The script installs correctly, however the GPIO functionality hasn't been tested yet. 54 | 55 | The .NET GPIO Nuget Package supports the Odroid Devices according to the documentation, so it should be fine to use. 56 | 57 | If you have one of these devices and get it working, do get in touch by tweeting me [@pete_codes](https://www.twitter.com/pete_codes)! 58 | 59 | # Remote Deployment and Debugging 60 | 61 | If you'd like to be able to write code on your PC and then Deploy and Debug that code directly on a Raspberry Pi, then I've create a one line script to set that up; 62 | 63 | ``` 64 | curl --output remotedebugsetup.bat https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/master/remotedebugsetup.bat && remotedebugsetup.bat 65 | ``` 66 | 67 | You can read more about this in a blog post here; 68 | 69 | http://bit.ly/piremotedeployanddebug 70 | 71 | 72 | # Setup PC for Remote Deployment and Debugging an Uno Application 73 | 74 | If you'd like to be able to Create an Uno Platform Application on your PC and then Deploy and Debug that code directly on a Raspberry Pi, then I've create a one line script to set that up; 75 | 76 | ``` 77 | curl --output remotedebugsetup_uno.bat https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/master/remotedebugsetup_uno.bat && remotedebugsetup_uno.bat 78 | ``` 79 | 80 | You can read more about this in a blog post here; 81 | 82 | http://bit.ly/piremotedeployanddebuguno 83 | 84 | # IoT Hub Connection 85 | 86 | The 3 IoT Hub Based Examples will require an IoT Hub Device Primary Connection String to work. 87 | 88 | # Deploying from VS Code on Windows 89 | 90 | If you want to Deploy from VSCode on a Windows PC, then modify the RaspberryDeployWSL task's ```rsync``` command in the ```.vscode/tasks.json``` files in the various projects to point to your Pi IP Address; 91 | 92 | ``` 93 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@[Enter Your IP Address]:share/${workspaceFolderBasename}/'" 94 | ``` 95 | 96 | Replace the ```[Enter Your IP Address]``` Section with the IP Address of your Pi (No Square Brackets!). 97 | 98 | You will also need to change the username (```pi@```) and password (```-p \"raspberry"```) if you have altered those too. 99 | 100 | # Debugging from VS Code on Windows 101 | 102 | If you want to Debug from VSCode on a Windows PC, then modify the ```.NET Core Launch Console``` task in the ```.vscode/launch.json``` files in the various projects to point to your Pi's Hostname; 103 | 104 | ``` 105 | "pipeArgs": [ 106 | "-pw", 107 | "raspberry", 108 | "root@[Your Pi Hostname].local" 109 | ], 110 | ``` 111 | 112 | You'll also need to install the VS Debugger; 113 | 114 | ``` 115 | curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -r linux-arm -v latest -l ~/vsdbg 116 | ``` 117 | 118 | You may also need to install curl and zip if they're not already installed; 119 | 120 | ``` 121 | sudo apt-get install curl 122 | ``` -------------------------------------------------------------------------------- /assets/install.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/assets/install.gif -------------------------------------------------------------------------------- /console1/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /console1/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@mscognitive.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /console1/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublish", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 53 | "|", 54 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@mscognitive.local:/home/pi/share/${workspaceFolderBasename}\"" 55 | ], 56 | "problemMatcher": [] 57 | } 58 | }, 59 | { 60 | "label": "RaspberryPublishWSL", 61 | "command": "sh", 62 | "type": "shell", 63 | "dependsOn": "build", 64 | "windows": { 65 | "command": "cmd", 66 | "args": [ 67 | "/c", 68 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 69 | ], 70 | "problemMatcher": [] 71 | } 72 | 73 | }, 74 | { 75 | "label": "RaspberryDeployWSL", 76 | "type": "shell", 77 | "dependsOn": "RaspberryPublishWSL", 78 | "presentation": { 79 | "reveal": "always", 80 | "panel": "new" 81 | }, 82 | "command": "bash", 83 | "args": [ 84 | "-c", 85 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 86 | ], 87 | "problemMatcher": [] 88 | 89 | }, 90 | { 91 | "label": "RaspberryDeployWSLBat", 92 | "type": "shell", 93 | "dependsOn": "RaspberryPublishWSL", 94 | "presentation": { 95 | "reveal": "always", 96 | "panel": "new" 97 | }, 98 | "options": { 99 | "cwd": "${workspaceFolder}" 100 | }, 101 | "windows": { 102 | "command": "${cwd}\\publish3.bat" 103 | }, 104 | "problemMatcher": [] 105 | }, 106 | { 107 | "label": "echo", 108 | "type": "shell", 109 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /console1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace console1 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /console1/console1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /console1/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /console2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace console2 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /console2/console2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /console2/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /dotnetdebug.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | echo -e "\e[1m----------------------------------------------------------------------" 4 | echo -e "\e[1m| .NET Debug Stub |" 5 | echo -e "\e[1m----------------------------------------------------------------------" 6 | echo -e "\e[1m| |" 7 | echo -e "\e[1m| Created by Pete Gallagher - Pete Codes / PJG Creations 2021 |" 8 | echo -e "\e[1m| |" 9 | echo -e "\e[1m| Latest update 06/02/2021 |" 10 | echo -e "\e[1m| |" 11 | echo -e "\e[1m| Let me know how you do by tweeting me at @pete_codes on Twitter |" 12 | echo -e "\e[1m| |" 13 | echo -e "\e[1m----------------------------------------------------------------------" 14 | echo "" 15 | 16 | export DISPLAY=:0 17 | 18 | exec $@ -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo -e "\e[1m----------------------------------------" 4 | echo -e "\e[1m .NET 7 Installer" 5 | echo -e "\e[1m----------------------------------------" 6 | echo "" 7 | echo -e "\e[1mPete Codes / PJG Creations 2024" 8 | echo "" 9 | echo -e "Latest update 02/01/2024" 10 | echo "" 11 | 12 | echo -e "\e[0m" 13 | echo -e "\e[1m----------------------------------------" 14 | echo -e "\e[1m Installing .NET for the following user" 15 | echo -e "\e[1m----------------------------------------" 16 | echo -e "\e[0m" 17 | 18 | username=$(logname) 19 | echo -e "\e[1m$username\e[0m" 20 | 21 | echo -e "\e[0m" 22 | echo -e "\e[1m----------------------------------------" 23 | echo -e "\e[1m Fetching Latest .NET Versions" 24 | echo -e "\e[1m----------------------------------------" 25 | echo -e "\e[0m" 26 | 27 | dotnetver=7.0 28 | 29 | # 30 | # We can add this back in when this release becomes recommended 31 | # 32 | #dotnetver=$1 33 | # 34 | #if [[ "$dotnetver" = "" ]]; then 35 | # versionspage=$(wget -qO - https://dotnet.microsoft.com/download/dotnet) 36 | # matchrecommended='\.NET ([^]*) \(recommended\)' 37 | 38 | # [[ $versionspage =~ $matchrecommended ]] 39 | # dotnetver=${BASH_REMATCH[1]} 40 | #fi 41 | 42 | sdkfile=/tmp/dotnetsdk.tar.gz 43 | aspnetfile=/tmp/aspnetcore.tar.gz 44 | 45 | download() { 46 | [[ $downloadspage =~ $1 ]] 47 | linkpage=$(wget -qO - https://dotnet.microsoft.com${BASH_REMATCH[1]}) 48 | 49 | matchdl='id="directLink" href="([^"]*)"' 50 | [[ $linkpage =~ $matchdl ]] 51 | wget -O $2 "${BASH_REMATCH[1]}" 52 | } 53 | 54 | detectArch() { 55 | arch=arm32 56 | 57 | if command -v uname > /dev/null; then 58 | # machineCpu=$(uname -m)-$(uname -p) 59 | machineCpu=$(getconf LONG_BIT) 60 | 61 | if [[ $machineCpu == *64* ]]; then 62 | arch=arm64 63 | fi 64 | fi 65 | } 66 | 67 | echo -e "\e[0m" 68 | echo -e "\e[1m----------------------------------------" 69 | echo -e "\e[1m Installation information" 70 | echo -e "\e[1m----------------------------------------" 71 | echo -e "\e[0m" 72 | 73 | echo "" 74 | echo "This will install the latest versions of the following:" 75 | echo "" 76 | echo -e "\e[1m----------------------------------------" 77 | echo -e "\e[0m" 78 | echo "- .NET SDK $dotnetver" 79 | echo "- ASP.NET Runtime $dotnetver" 80 | echo "" 81 | echo -e "\e[1m----------------------------------------" 82 | echo -e "\e[0m" 83 | echo "For the following user:" 84 | echo "" 85 | echo -e "\e[1m$username\e[0m" 86 | echo "" 87 | echo -e "\e[1m----------------------------------------" 88 | echo -e "\e[0m" 89 | echo -e "Any suggestions or questions, email \e[1;4mpete@pjgcreations.co.uk" 90 | echo -e "\e[0mSend me a tweet \e[1;4m@pete_codes" 91 | echo -e "\e[0mTutorials on \e[1;4mhttps://www.petecodes.co.uk" 92 | echo "" 93 | echo -e "\e[1m----------------------------------------" 94 | echo -e "\e[0m" 95 | 96 | if [[ $EUID -ne 0 ]]; then 97 | echo -e "\e[1;31mThis script must be run as root (sudo $0)" 98 | exit 1 99 | fi 100 | 101 | echo -e "\e[0m" 102 | echo -e "\e[1m----------------------------------------" 103 | echo -e "\e[1m Installing Dependencies" 104 | echo -e "\e[1m----------------------------------------" 105 | echo -e "\e[0m" 106 | 107 | apt-get -y install libunwind8 gettext 108 | 109 | echo -e "\e[0m" 110 | echo -e "\e[1m----------------------------------------" 111 | echo -e "\e[1m Remove Old Binaries" 112 | echo -e "\e[1m----------------------------------------" 113 | echo -e "\e[0m" 114 | 115 | rm -f $sdkfile 116 | rm -f $aspnetfile 117 | 118 | echo -e "\e[0m" 119 | echo -e "\e[1m----------------------------------------" 120 | echo -e "\e[1m Getting .NET SDK $dotnetver" 121 | echo -e "\e[1m----------------------------------------" 122 | echo -e "\e[0m" 123 | 124 | [[ "$dotnetver" > "5" ]] && dotnettype="dotnet" || dotnettype="dotnet-core" 125 | downloadspage=$(wget -qO - https://dotnet.microsoft.com/download/$dotnettype/$dotnetver) 126 | 127 | detectArch 128 | 129 | download 'href="([^"]*sdk-[^"/]*linux-'$arch'-binaries)"' $sdkfile 130 | 131 | echo -e "\e[0m" 132 | echo -e "\e[1m----------------------------------------" 133 | echo -e "\e[1m Getting ASP.NET Runtime $dotnetver" 134 | echo -e "\e[1m----------------------------------------" 135 | echo -e "\e[0m" 136 | 137 | download 'href="([^"]*aspnetcore-[^"/]*linux-'$arch'-binaries)"' $aspnetfile 138 | 139 | echo -e "\e[0m" 140 | echo -e "\e[1m----------------------------------------" 141 | echo -e "\e[1m Creating Main Directory" 142 | echo -e "\e[1m----------------------------------------" 143 | echo -e "\e[0m" 144 | 145 | if [[ -d /opt/dotnet ]]; then 146 | echo "/opt/dotnet already exists on your filesystem." 147 | else 148 | echo "Creating Main Directory" 149 | echo "" 150 | mkdir /opt/dotnet 151 | fi 152 | 153 | echo -e "\e[0m" 154 | echo -e "\e[1m----------------------------------------" 155 | echo -e "\e[1m Extracting .NET SDK $dotnetver" 156 | echo -e "\e[1m----------------------------------------" 157 | echo -e "\e[0m" 158 | 159 | tar -xvf $sdkfile -C /opt/dotnet/ 160 | 161 | echo -e "\e[0m" 162 | echo -e "\e[1m----------------------------------------" 163 | echo -e "\e[1m Extracting ASP.NET Runtime $dotnetver" 164 | echo -e "\e[1m----------------------------------------" 165 | echo -e "\e[0m" 166 | 167 | tar -xvf $aspnetfile -C /opt/dotnet/ 168 | 169 | echo -e "\e[0m" 170 | echo -e "\e[1m----------------------------------------" 171 | echo -e "\e[1m Link Binaries to User Profile" 172 | echo -e "\e[1m----------------------------------------" 173 | echo -e "\e[0m" 174 | 175 | ln -s /opt/dotnet/dotnet /usr/local/bin 176 | 177 | echo -e "\e[0m" 178 | echo -e "\e[1m----------------------------------------" 179 | echo -e "\e[1m Make Link Permanent" 180 | echo -e "\e[1m----------------------------------------" 181 | echo -e "\e[0m" 182 | 183 | if grep -q 'export DOTNET_ROOT=' /home/$username/.bashrc; then 184 | echo 'Already added link to .bashrc' 185 | else 186 | echo 'Adding Link to .bashrc' 187 | echo 'export DOTNET_ROOT=/opt/dotnet' >> /home/$username/.bashrc 188 | fi 189 | 190 | echo -e "\e[0m" 191 | echo -e "\e[1m----------------------------------------" 192 | echo -e "\e[1m Download Debug Stub" 193 | echo -e "\e[1m----------------------------------------" 194 | echo -e "\e[0m" 195 | 196 | cd ~ 197 | 198 | wget -O /home/$username/dotnetdebug.sh https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/master/dotnetdebug.sh 199 | chmod +x /home/$username/dotnetdebug.sh 200 | 201 | echo -e "\e[0m" 202 | echo -e "\e[1m----------------------------------------" 203 | echo -e "\e[1m Run dotnet --info" 204 | echo -e "\e[1m----------------------------------------" 205 | echo -e "\e[0m" 206 | 207 | dotnet --info 208 | 209 | echo -e "\e[0m" 210 | echo -e "\e[1m----------------------------------------" 211 | echo -e "\e[1m ALL DONE!" 212 | echo "" 213 | echo -e "\e[1mNote: It's highly recommended that you perform a reboot at this point!" 214 | echo "" 215 | echo -e "\e[0mGo ahead and run \e[1mdotnet new console \e[0min a new directory!" 216 | echo "" 217 | echo "" 218 | echo "" 219 | echo -e "\e[0mLet me know how you get on by tweeting me at \e[1;5m@pete_codes\e[0m" 220 | echo "" 221 | echo -e "\e[1m----------------------------------------" 222 | echo -e "\e[0m" 223 | -------------------------------------------------------------------------------- /rpiblazor/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@mscognitive.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /rpiblazor/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublish", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 53 | "|", 54 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@mscognitive.local:/home/pi/share/${workspaceFolderBasename}\"" 55 | ], 56 | "problemMatcher": [] 57 | } 58 | }, 59 | { 60 | "label": "RaspberryPublishWSL", 61 | "command": "sh", 62 | "type": "shell", 63 | "dependsOn": "build", 64 | "windows": { 65 | "command": "cmd", 66 | "args": [ 67 | "/c", 68 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 69 | ], 70 | "problemMatcher": [] 71 | } 72 | 73 | }, 74 | { 75 | "label": "RaspberryDeployWSL", 76 | "type": "shell", 77 | "dependsOn": "RaspberryPublishWSL", 78 | "presentation": { 79 | "reveal": "always", 80 | "panel": "new" 81 | }, 82 | "command": "bash", 83 | "args": [ 84 | "-c", 85 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 86 | ], 87 | "problemMatcher": [] 88 | 89 | }, 90 | { 91 | "label": "RaspberryDeployWSLBat", 92 | "type": "shell", 93 | "dependsOn": "RaspberryPublishWSL", 94 | "presentation": { 95 | "reveal": "always", 96 | "panel": "new" 97 | }, 98 | "options": { 99 | "cwd": "${workspaceFolder}" 100 | }, 101 | "windows": { 102 | "command": "${cwd}\\publish3.bat" 103 | }, 104 | "problemMatcher": [] 105 | }, 106 | { 107 | "label": "echo", 108 | "type": "shell", 109 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /rpiblazor/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /rpiblazor/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace rpiblazor.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /rpiblazor/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace rpiblazor.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /rpiblazor/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rpiblazor/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/error" 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

-------------------------------------------------------------------------------- /rpiblazor/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | 3 | @using rpiblazor.Data 4 | @inject WeatherForecastService ForecastService 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from a service.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /rpiblazor/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | -------------------------------------------------------------------------------- /rpiblazor/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace rpiblazor.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | rpiblazor 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /rpiblazor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | 12 | namespace rpiblazor 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | webBuilder.UseUrls("http://*:5000"); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rpiblazor/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /rpiblazor/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rpiblazor/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Components; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.HttpsPolicy; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using rpiblazor.Data; 13 | 14 | namespace rpiblazor 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 27 | public void ConfigureServices(IServiceCollection services) 28 | { 29 | services.AddRazorPages(); 30 | services.AddServerSideBlazor(); 31 | services.AddSingleton(); 32 | } 33 | 34 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 35 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 36 | { 37 | if (env.IsDevelopment()) 38 | { 39 | app.UseDeveloperExceptionPage(); 40 | } 41 | else 42 | { 43 | app.UseExceptionHandler("/Error"); 44 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 45 | app.UseHsts(); 46 | } 47 | 48 | app.UseHttpsRedirection(); 49 | app.UseStaticFiles(); 50 | 51 | app.UseRouting(); 52 | 53 | app.UseEndpoints(endpoints => 54 | { 55 | endpoints.MapBlazorHub(); 56 | endpoints.MapFallbackToPage("/_Host"); 57 | }); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /rpiblazor/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using rpiblazor 9 | @using rpiblazor.Shared 10 | -------------------------------------------------------------------------------- /rpiblazor/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /rpiblazor/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /rpiblazor/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /rpiblazor/rpiblazor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/rpiblazor/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /rpiblazor/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | app { 18 | position: relative; 19 | display: flex; 20 | flex-direction: column; 21 | } 22 | 23 | .top-row { 24 | height: 3.5rem; 25 | display: flex; 26 | align-items: center; 27 | } 28 | 29 | .main { 30 | flex: 1; 31 | } 32 | 33 | .main .top-row { 34 | background-color: #f7f7f7; 35 | border-bottom: 1px solid #d6d5d5; 36 | justify-content: flex-end; 37 | } 38 | 39 | .main .top-row > a, .main .top-row .btn-link { 40 | white-space: nowrap; 41 | margin-left: 1.5rem; 42 | } 43 | 44 | .main .top-row a:first-child { 45 | overflow: hidden; 46 | text-overflow: ellipsis; 47 | } 48 | 49 | .sidebar { 50 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 51 | } 52 | 53 | .sidebar .top-row { 54 | background-color: rgba(0,0,0,0.4); 55 | } 56 | 57 | .sidebar .navbar-brand { 58 | font-size: 1.1rem; 59 | } 60 | 61 | .sidebar .oi { 62 | width: 2rem; 63 | font-size: 1.1rem; 64 | vertical-align: text-top; 65 | top: -2px; 66 | } 67 | 68 | .sidebar .nav-item { 69 | font-size: 0.9rem; 70 | padding-bottom: 0.5rem; 71 | } 72 | 73 | .sidebar .nav-item:first-of-type { 74 | padding-top: 1rem; 75 | } 76 | 77 | .sidebar .nav-item:last-of-type { 78 | padding-bottom: 1rem; 79 | } 80 | 81 | .sidebar .nav-item a { 82 | color: #d7d7d7; 83 | border-radius: 4px; 84 | height: 3rem; 85 | display: flex; 86 | align-items: center; 87 | line-height: 3rem; 88 | } 89 | 90 | .sidebar .nav-item a.active { 91 | background-color: rgba(255,255,255,0.25); 92 | color: white; 93 | } 94 | 95 | .sidebar .nav-item a:hover { 96 | background-color: rgba(255,255,255,0.1); 97 | color: white; 98 | } 99 | 100 | .content { 101 | padding-top: 1.1rem; 102 | } 103 | 104 | .navbar-toggler { 105 | background-color: rgba(255, 255, 255, 0.1); 106 | } 107 | 108 | .valid.modified:not([type=checkbox]) { 109 | outline: 1px solid #26b050; 110 | } 111 | 112 | .invalid { 113 | outline: 1px solid red; 114 | } 115 | 116 | .validation-message { 117 | color: red; 118 | } 119 | 120 | #blazor-error-ui { 121 | background: lightyellow; 122 | bottom: 0; 123 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 124 | display: none; 125 | left: 0; 126 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 127 | position: fixed; 128 | width: 100%; 129 | z-index: 1000; 130 | } 131 | 132 | #blazor-error-ui .dismiss { 133 | cursor: pointer; 134 | position: absolute; 135 | right: 0.75rem; 136 | top: 0.5rem; 137 | } 138 | 139 | @media (max-width: 767.98px) { 140 | .main .top-row:not(.auth) { 141 | display: none; 142 | } 143 | 144 | .main .top-row.auth { 145 | justify-content: space-between; 146 | } 147 | 148 | .main .top-row a, .main .top-row .btn-link { 149 | margin-left: 0; 150 | } 151 | } 152 | 153 | @media (min-width: 768px) { 154 | app { 155 | flex-direction: row; 156 | } 157 | 158 | .sidebar { 159 | width: 250px; 160 | height: 100vh; 161 | position: sticky; 162 | top: 0; 163 | } 164 | 165 | .main .top-row { 166 | position: sticky; 167 | top: 0; 168 | } 169 | 170 | .main > div { 171 | padding-left: 2rem !important; 172 | padding-right: 1.5rem !important; 173 | } 174 | 175 | .navbar-toggler { 176 | display: none; 177 | } 178 | 179 | .sidebar .collapse { 180 | /* Never collapse the sidebar for wide screens */ 181 | display: block; 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /rpiblazor/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/rpiblazor/wwwroot/favicon.ico -------------------------------------------------------------------------------- /rpibutton/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /rpibutton/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@mscognitive.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /rpibutton/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublish", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 53 | "|", 54 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@mscognitive.local:/home/pi/share/${workspaceFolderBasename}\"" 55 | ], 56 | "problemMatcher": [] 57 | } 58 | }, 59 | { 60 | "label": "RaspberryPublishWSL", 61 | "command": "sh", 62 | "type": "shell", 63 | "dependsOn": "build", 64 | "windows": { 65 | "command": "cmd", 66 | "args": [ 67 | "/c", 68 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 69 | ], 70 | "problemMatcher": [] 71 | } 72 | 73 | }, 74 | { 75 | "label": "RaspberryDeployWSL", 76 | "type": "shell", 77 | "dependsOn": "RaspberryPublishWSL", 78 | "presentation": { 79 | "reveal": "always", 80 | "panel": "new" 81 | }, 82 | "command": "bash", 83 | "args": [ 84 | "-c", 85 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.80:share/${workspaceFolderBasename}/'" 86 | ], 87 | "problemMatcher": [] 88 | 89 | }, 90 | { 91 | "label": "RaspberryDeployWSLBat", 92 | "type": "shell", 93 | "dependsOn": "RaspberryPublishWSL", 94 | "presentation": { 95 | "reveal": "always", 96 | "panel": "new" 97 | }, 98 | "options": { 99 | "cwd": "${workspaceFolder}" 100 | }, 101 | "windows": { 102 | "command": "${cwd}\\publish3.bat" 103 | }, 104 | "problemMatcher": [] 105 | }, 106 | { 107 | "label": "echo", 108 | "type": "shell", 109 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /rpibutton/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Device.Gpio; 3 | 4 | namespace rpitest 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | Console.WriteLine("Hello World!"); 11 | 12 | GpioController controller = new GpioController(PinNumberingScheme.Board); 13 | var pin = 10; 14 | var buttonPin = 26; 15 | 16 | controller.OpenPin(pin, PinMode.Output); 17 | controller.OpenPin(buttonPin, PinMode.InputPullUp); 18 | 19 | try 20 | { 21 | while (true) 22 | { 23 | if (controller.Read(buttonPin) == false) 24 | { 25 | controller.Write(pin, PinValue.High); 26 | } 27 | else 28 | { 29 | controller.Write(pin, PinValue.Low); 30 | } 31 | } 32 | } 33 | finally 34 | { 35 | controller.ClosePin(pin); 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /rpibutton/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /rpibutton/rpibutton.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rpiiothubin/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /rpiiothubin/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@mscognitive.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /rpiiothubin/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublishWSL", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 53 | ], 54 | "problemMatcher": [] 55 | } 56 | 57 | }, 58 | { 59 | "label": "RaspberryDeployWSL", 60 | "type": "shell", 61 | "dependsOn": "RaspberryPublishWSL", 62 | "presentation": { 63 | "reveal": "always", 64 | "panel": "new" 65 | }, 66 | "command": "bash", 67 | "args": [ 68 | "-c", 69 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.80:share/${workspaceFolderBasename}/'" 70 | ], 71 | "problemMatcher": [] 72 | 73 | } 74 | ] 75 | } -------------------------------------------------------------------------------- /rpiiothubin/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Device.Gpio; 3 | using Microsoft.Azure.Devices.Client; 4 | using System.Threading.Tasks; 5 | using System.Text; 6 | 7 | namespace rpitest 8 | { 9 | class Program 10 | { 11 | 12 | private static readonly string connectionString = "HostName=petecodesiothub.azure-devices.net;DeviceId=raspberrypi;SharedAccessKey=aUdhO1CE6gNkCKoQbAomkwXX1V8oRTKfYvmzmzGvlI8="; 13 | private static DeviceClient deviceClient; 14 | 15 | static void Main(string[] args) 16 | { 17 | Console.WriteLine("Hello World!"); 18 | 19 | deviceClient = DeviceClient.CreateFromConnectionString(connectionString); 20 | 21 | GpioController controller = new GpioController(PinNumberingScheme.Board); 22 | var pin = 10; 23 | var buttonPin = 26; 24 | var buttonPressed = false; 25 | 26 | controller.OpenPin(pin, PinMode.Output); 27 | controller.OpenPin(buttonPin, PinMode.InputPullUp); 28 | 29 | try 30 | { 31 | while (true) 32 | { 33 | 34 | ReceiveCloudToDeviceMessageAsync(); 35 | 36 | if (controller.Read(buttonPin) == false) 37 | { 38 | controller.Write(pin, PinValue.High); 39 | 40 | if (buttonPressed == false) 41 | { 42 | buttonPressed = true; 43 | SendDeviceToCloudMessageAsync().Wait(); 44 | } 45 | } 46 | else 47 | { 48 | controller.Write(pin, PinValue.Low); 49 | buttonPressed = false; 50 | } 51 | } 52 | } 53 | finally 54 | { 55 | controller.ClosePin(pin); 56 | } 57 | } 58 | 59 | private static async Task SendDeviceToCloudMessageAsync() 60 | { 61 | var messageString = "Button Pressed"; 62 | Message message = new Message(Encoding.ASCII.GetBytes(messageString)); 63 | 64 | message.Properties.Add("buttonEvent", "true"); 65 | 66 | await deviceClient.SendEventAsync(message); 67 | Console.WriteLine("Sending Message {0}", messageString); 68 | 69 | } 70 | 71 | private static async Task ReceiveCloudToDeviceMessageAsync() 72 | { 73 | Message receivedMessage = await deviceClient.ReceiveAsync(); 74 | 75 | if (receivedMessage != null) 76 | { 77 | string receivedMessageString = Encoding.ASCII.GetString(receivedMessage.GetBytes()); 78 | Console.WriteLine("Received message: {0}", receivedMessageString); 79 | await deviceClient.CompleteAsync(receivedMessage); 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /rpiiothubin/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /rpiiothubin/rpiiothubin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpiiothubout/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /rpiiothubout/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@iothubpete2.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /rpiiothubout/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublish", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 53 | "|", 54 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@iothubpete2.local:/home/pi/share/${workspaceFolderBasename}\"" 55 | ], 56 | "problemMatcher": [] 57 | } 58 | }, 59 | { 60 | "label": "RaspberryPublishWSL", 61 | "command": "sh", 62 | "type": "shell", 63 | "dependsOn": "build", 64 | "windows": { 65 | "command": "cmd", 66 | "args": [ 67 | "/c", 68 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 69 | ], 70 | "problemMatcher": [] 71 | } 72 | 73 | }, 74 | { 75 | "label": "RaspberryDeployWSL", 76 | "type": "shell", 77 | "dependsOn": "RaspberryPublishWSL", 78 | "presentation": { 79 | "reveal": "always", 80 | "panel": "new" 81 | }, 82 | "command": "bash", 83 | "args": [ 84 | "-c", 85 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.76:share/${workspaceFolderBasename}/'" 86 | ], 87 | "problemMatcher": [] 88 | 89 | }, 90 | { 91 | "label": "RaspberryDeployWSLBat", 92 | "type": "shell", 93 | "dependsOn": "RaspberryPublishWSL", 94 | "presentation": { 95 | "reveal": "always", 96 | "panel": "new" 97 | }, 98 | "options": { 99 | "cwd": "${workspaceFolder}" 100 | }, 101 | "windows": { 102 | "command": "${cwd}\\publish3.bat" 103 | }, 104 | "problemMatcher": [] 105 | }, 106 | { 107 | "label": "echo", 108 | "type": "shell", 109 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.76:share/${workspaceFolderBasename}/'" 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /rpiiothubout/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Device.Gpio; 3 | using Microsoft.Azure.Devices.Client; 4 | using System.Threading.Tasks; 5 | using System.Text; 6 | 7 | namespace rpitest 8 | { 9 | class Program 10 | { 11 | 12 | private static readonly string connectionString = "HostName=petecodesiothub.azure-devices.net;DeviceId=raspberrypi;SharedAccessKey=aUdhO1CE6gNkCKoQbAomkwXX1V8oRTKfYvmzmzGvlI8="; 13 | private static DeviceClient deviceClient; 14 | 15 | static void Main(string[] args) 16 | { 17 | Console.WriteLine("Hello World!"); 18 | 19 | deviceClient = DeviceClient.CreateFromConnectionString(connectionString); 20 | 21 | GpioController controller = new GpioController(PinNumberingScheme.Board); 22 | var pin = 10; 23 | var buttonPin = 26; 24 | var buttonPressed = false; 25 | 26 | controller.OpenPin(pin, PinMode.Output); 27 | controller.OpenPin(buttonPin, PinMode.InputPullUp); 28 | 29 | try 30 | { 31 | while (true) 32 | { 33 | if (controller.Read(buttonPin) == false) 34 | { 35 | controller.Write(pin, PinValue.High); 36 | 37 | if (buttonPressed == false) 38 | { 39 | buttonPressed = true; 40 | SendDeviceToCloudMessageAsync().Wait(); 41 | } 42 | } 43 | else 44 | { 45 | controller.Write(pin, PinValue.Low); 46 | buttonPressed = false; 47 | } 48 | } 49 | } 50 | catch(Exception ex) { 51 | Console.WriteLine(ex); 52 | } 53 | finally 54 | { 55 | controller.ClosePin(pin); 56 | } 57 | } 58 | 59 | private static async Task SendDeviceToCloudMessageAsync() 60 | { 61 | var messageString = "Button Pressed"; 62 | Message message = new Message(Encoding.ASCII.GetBytes(messageString)); 63 | 64 | message.Properties.Add("buttonEvent", "true"); 65 | 66 | try 67 | { 68 | await deviceClient.SendEventAsync(message); 69 | } 70 | catch (Exception ex) 71 | { 72 | Console.WriteLine(ex); 73 | } 74 | 75 | Console.WriteLine("Sending Message {0}", messageString); 76 | 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /rpiiothubout/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /rpiiothubout/rpiiothubout.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpiiothubtwitter/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /rpiiothubtwitter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@mscognitive.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /rpiiothubtwitter/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublish", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 53 | "|", 54 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@mscognitive.local:/home/pi/share/${workspaceFolderBasename}\"" 55 | ], 56 | "problemMatcher": [] 57 | } 58 | }, 59 | { 60 | "label": "RaspberryPublishWSL", 61 | "command": "sh", 62 | "type": "shell", 63 | "dependsOn": "build", 64 | "windows": { 65 | "command": "cmd", 66 | "args": [ 67 | "/c", 68 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 69 | ], 70 | "problemMatcher": [] 71 | } 72 | 73 | }, 74 | { 75 | "label": "RaspberryDeployWSL", 76 | "type": "shell", 77 | "dependsOn": "RaspberryPublishWSL", 78 | "presentation": { 79 | "reveal": "always", 80 | "panel": "new" 81 | }, 82 | "command": "bash", 83 | "args": [ 84 | "-c", 85 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.80:share/${workspaceFolderBasename}/'" 86 | ], 87 | "problemMatcher": [] 88 | 89 | }, 90 | { 91 | "label": "RaspberryDeployWSLBat", 92 | "type": "shell", 93 | "dependsOn": "RaspberryPublishWSL", 94 | "presentation": { 95 | "reveal": "always", 96 | "panel": "new" 97 | }, 98 | "options": { 99 | "cwd": "${workspaceFolder}" 100 | }, 101 | "windows": { 102 | "command": "${cwd}\\publish3.bat" 103 | }, 104 | "problemMatcher": [] 105 | }, 106 | { 107 | "label": "echo", 108 | "type": "shell", 109 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /rpiiothubtwitter/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Device.Gpio; 3 | using Microsoft.Azure.Devices.Client; 4 | using System.Threading.Tasks; 5 | using System.Text; 6 | 7 | namespace rpitest 8 | { 9 | class Program 10 | { 11 | 12 | private static readonly string connectionString = "[Enter your IoT hub Device Primary Connection String]"; 13 | private static DeviceClient deviceClient; 14 | private static int messageCount = 0; 15 | 16 | static void Main(string[] args) 17 | { 18 | Console.WriteLine("Hello World!"); 19 | 20 | deviceClient = DeviceClient.CreateFromConnectionString(connectionString); 21 | 22 | GpioController controller = new GpioController(PinNumberingScheme.Board); 23 | var pin = 10; 24 | var buttonPin = 26; 25 | var buttonPressed = false; 26 | 27 | controller.OpenPin(pin, PinMode.Output); 28 | controller.OpenPin(buttonPin, PinMode.InputPullUp); 29 | 30 | try 31 | { 32 | while (true) 33 | { 34 | 35 | ReceiveCloudToDeviceMessageAsync(); 36 | 37 | if (controller.Read(buttonPin) == false) 38 | { 39 | controller.Write(pin, PinValue.High); 40 | 41 | if (buttonPressed == false) 42 | { 43 | buttonPressed = true; 44 | SendDeviceToCloudMessageAsync().Wait(); 45 | } 46 | } 47 | else 48 | { 49 | controller.Write(pin, PinValue.Low); 50 | buttonPressed = false; 51 | } 52 | } 53 | } 54 | finally 55 | { 56 | controller.ClosePin(pin); 57 | } 58 | } 59 | 60 | private static async Task SendDeviceToCloudMessageAsync() 61 | { 62 | messageCount +=1; 63 | 64 | var messageString = "Button Pressed"; 65 | Message message = new Message(Encoding.ASCII.GetBytes(messageString)); 66 | 67 | if (messageCount > 5) 68 | { 69 | message.Properties.Add("sendTweet", "true"); 70 | Console.WriteLine("Message will trigger tweet!"); 71 | } 72 | 73 | await deviceClient.SendEventAsync(message); 74 | Console.WriteLine("Sending Message {0}", messageString); 75 | 76 | } 77 | 78 | private static async Task ReceiveCloudToDeviceMessageAsync() 79 | { 80 | Message receivedMessage = await deviceClient.ReceiveAsync(); 81 | 82 | if (receivedMessage != null) 83 | { 84 | string receivedMessageString = Encoding.ASCII.GetString(receivedMessage.GetBytes()); 85 | Console.WriteLine("Received message: {0}", receivedMessageString); 86 | await deviceClient.CompleteAsync(receivedMessage); 87 | } 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /rpiiothubtwitter/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /rpiiothubtwitter/rpiiothubtwitter.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpiled/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /rpiled/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/${workspaceFolderBasename}.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@mscognitive.local" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /rpiled/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/${workspaceFolderBasename}.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | }, 14 | { 15 | "label": "publish", 16 | "type": "shell", 17 | "dependsOn": "build", 18 | "presentation": { 19 | "reveal": "always", 20 | "panel": "new" 21 | }, 22 | "options": { 23 | "cwd": "${workspaceFolder}" 24 | }, 25 | "windows": { 26 | "command": "${cwd}\\publish.bat" 27 | }, 28 | "problemMatcher": [] 29 | }, 30 | { 31 | "label": "watch", 32 | "command": "dotnet", 33 | "type": "process", 34 | "args": [ 35 | "watch", 36 | "run", 37 | "${workspaceFolder}/consoleapp1.csproj", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "problemMatcher": "$msCompile" 42 | }, 43 | { 44 | "label": "RaspberryPublish", 45 | "command": "sh", 46 | "type": "shell", 47 | "dependsOn": "build", 48 | "windows": { 49 | "command": "cmd", 50 | "args": [ 51 | "/c", 52 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 53 | "|", 54 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@mscognitive.local:/home/pi/share/${workspaceFolderBasename}\"" 55 | ], 56 | "problemMatcher": [] 57 | } 58 | }, 59 | { 60 | "label": "RaspberryPublishWSL", 61 | "command": "sh", 62 | "type": "shell", 63 | "dependsOn": "build", 64 | "windows": { 65 | "command": "cmd", 66 | "args": [ 67 | "/c", 68 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"" 69 | ], 70 | "problemMatcher": [] 71 | } 72 | 73 | }, 74 | { 75 | "label": "RaspberryDeployWSL", 76 | "type": "shell", 77 | "dependsOn": "RaspberryPublishWSL", 78 | "presentation": { 79 | "reveal": "always", 80 | "panel": "new" 81 | }, 82 | "command": "bash", 83 | "args": [ 84 | "-c", 85 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 86 | ], 87 | "problemMatcher": [] 88 | 89 | }, 90 | { 91 | "label": "RaspberryDeployWSLBat", 92 | "type": "shell", 93 | "dependsOn": "RaspberryPublishWSL", 94 | "presentation": { 95 | "reveal": "always", 96 | "panel": "new" 97 | }, 98 | "options": { 99 | "cwd": "${workspaceFolder}" 100 | }, 101 | "windows": { 102 | "command": "${cwd}\\publish3.bat" 103 | }, 104 | "problemMatcher": [] 105 | }, 106 | { 107 | "label": "echo", 108 | "type": "shell", 109 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.43.47:share/${workspaceFolderBasename}/'" 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /rpiled/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Device.Gpio; 3 | using System.Threading; 4 | 5 | namespace rpitest 6 | { 7 | class Program 8 | { 9 | 10 | static void Main(string[] args) 11 | { 12 | 13 | GpioController controller = new GpioController(PinNumberingScheme.Board); 14 | 15 | Console.WriteLine("Hello World!"); 16 | 17 | var pin = 10; 18 | var lightTime = 300; 19 | controller.OpenPin(pin, PinMode.Output); 20 | 21 | try 22 | { 23 | while (true) 24 | { 25 | controller.Write(pin, PinValue.High); 26 | Thread.Sleep(lightTime); 27 | controller.Write(pin, PinValue.Low); 28 | Thread.Sleep(lightTime); 29 | } 30 | } 31 | finally 32 | { 33 | controller.ClosePin(pin); 34 | } 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rpiled/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /rpiled/rpiled.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /uno/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | # .vscode 10 | 11 | # Rider 12 | .idea 13 | 14 | # User-specific files 15 | *.suo 16 | *.user 17 | *.userosscache 18 | *.sln.docstates 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Oo]ut/ 32 | msbuild.log 33 | msbuild.err 34 | msbuild.wrn 35 | 36 | # Visual Studio 2015 37 | .vs/ -------------------------------------------------------------------------------- /uno/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Component.CoreEditor", 5 | "Microsoft.VisualStudio.Workload.CoreEditor", 6 | "Microsoft.NetCore.Component.Runtime.3.1", 7 | "Microsoft.NetCore.Component.SDK", 8 | "Microsoft.VisualStudio.Component.NuGet", 9 | "Microsoft.Net.Component.4.6.1.TargetingPack", 10 | "Microsoft.VisualStudio.Component.Roslyn.Compiler", 11 | "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", 12 | "Microsoft.NetCore.Component.DevelopmentTools", 13 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", 14 | "Microsoft.VisualStudio.Component.DockerTools", 15 | "Microsoft.NetCore.Component.Web", 16 | "Microsoft.Net.Component.4.8.SDK", 17 | "Microsoft.Net.Component.4.7.2.TargetingPack", 18 | "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", 19 | "Microsoft.VisualStudio.Component.TypeScript.4.0", 20 | "Microsoft.VisualStudio.Component.JavaScript.TypeScript", 21 | "Microsoft.VisualStudio.Component.JavaScript.Diagnostics", 22 | "Microsoft.Component.MSBuild", 23 | "Microsoft.VisualStudio.Component.TextTemplating", 24 | "Component.Microsoft.VisualStudio.RazorExtension", 25 | "Microsoft.VisualStudio.Component.IISExpress", 26 | "Microsoft.VisualStudio.Component.SQL.ADAL", 27 | "Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime", 28 | "Microsoft.VisualStudio.Component.Common.Azure.Tools", 29 | "Microsoft.VisualStudio.Component.SQL.CLR", 30 | "Microsoft.VisualStudio.Component.MSODBC.SQL", 31 | "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils", 32 | "Microsoft.VisualStudio.Component.ManagedDesktop.Core", 33 | "Microsoft.Net.Component.4.5.2.TargetingPack", 34 | "Microsoft.Net.Component.4.5.TargetingPack", 35 | "Microsoft.VisualStudio.Component.SQL.SSDT", 36 | "Microsoft.VisualStudio.Component.SQL.DataSources", 37 | "Component.Microsoft.Web.LibraryManager", 38 | "Microsoft.VisualStudio.ComponentGroup.Web", 39 | "Microsoft.VisualStudio.Component.Web", 40 | "Microsoft.VisualStudio.Component.IntelliCode", 41 | "Component.Microsoft.VisualStudio.LiveShare", 42 | "Microsoft.VisualStudio.ComponentGroup.Web.Client", 43 | "Microsoft.Net.Component.4.TargetingPack", 44 | "Microsoft.Net.Component.4.5.1.TargetingPack", 45 | "Microsoft.Net.Component.4.6.TargetingPack", 46 | "Microsoft.Net.ComponentGroup.TargetingPacks.Common", 47 | "Component.Microsoft.VisualStudio.Web.AzureFunctions", 48 | "Microsoft.VisualStudio.ComponentGroup.AzureFunctions", 49 | "Microsoft.VisualStudio.Component.Azure.Compute.Emulator", 50 | "Microsoft.VisualStudio.Component.Azure.Storage.Emulator", 51 | "Microsoft.VisualStudio.Component.Azure.ClientLibs", 52 | "Microsoft.VisualStudio.Component.Azure.AuthoringTools", 53 | "Microsoft.VisualStudio.Component.CloudExplorer", 54 | "Microsoft.VisualStudio.ComponentGroup.Web.CloudTools", 55 | "Microsoft.VisualStudio.Component.DiagnosticTools", 56 | "Microsoft.VisualStudio.Component.EntityFramework", 57 | "Microsoft.VisualStudio.Component.AspNet45", 58 | "Microsoft.VisualStudio.Component.AppInsights.Tools", 59 | "Microsoft.VisualStudio.Component.WebDeploy", 60 | "Microsoft.VisualStudio.Component.Wcf.Tooling", 61 | "Microsoft.Net.Component.4.6.2.TargetingPack", 62 | "Microsoft.Net.Component.4.7.TargetingPack", 63 | "Microsoft.Net.Component.4.7.1.TargetingPack", 64 | "Microsoft.VisualStudio.Workload.NetWeb", 65 | "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", 66 | "Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools", 67 | "Microsoft.VisualStudio.Component.Azure.Waverton", 68 | "Microsoft.Component.Azure.DataLake.Tools", 69 | "Microsoft.VisualStudio.Component.Azure.Kubernetes.Tools", 70 | "Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools", 71 | "Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools", 72 | "Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices", 73 | "Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools", 74 | "Microsoft.VisualStudio.Workload.Azure", 75 | "Microsoft.VisualStudio.Component.VC.CoreIde", 76 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", 77 | "Microsoft.VisualStudio.Component.Graphics.Tools", 78 | "Microsoft.VisualStudio.Component.Windows10SDK.19041", 79 | "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", 80 | "Microsoft.ComponentGroup.Blend", 81 | "Microsoft.VisualStudio.Component.Debugger.JustInTime", 82 | "Microsoft.VisualStudio.Component.PortableLibrary", 83 | "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", 84 | "Microsoft.VisualStudio.Workload.ManagedDesktop", 85 | "Microsoft.VisualStudio.Component.Windows10SDK.18362", 86 | "Microsoft.VisualStudio.Component.Windows10SDK.17763", 87 | "Microsoft.Component.NetFX.Native", 88 | "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard", 89 | "Microsoft.VisualStudio.Component.Graphics", 90 | "Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin", 91 | "Microsoft.VisualStudio.ComponentGroup.UWP.Support", 92 | "Microsoft.VisualStudio.Component.VC.Tools.ARM64", 93 | "Microsoft.VisualStudio.Component.UWP.VC.ARM64", 94 | "Microsoft.VisualStudio.Component.VC.Tools.ARM", 95 | "Microsoft.VisualStudio.ComponentGroup.UWP.VC", 96 | "Microsoft.VisualStudio.Workload.Universal", 97 | "Component.OpenJDK", 98 | "Microsoft.VisualStudio.Component.MonoDebugger", 99 | "Microsoft.VisualStudio.Component.Merq", 100 | "Component.Xamarin.RemotedSimulator", 101 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", 102 | "Component.Xamarin", 103 | "Component.Android.SDK28", 104 | "Microsoft.VisualStudio.Workload.NetCrossPlat", 105 | "Microsoft.VisualStudio.Workload.NetCoreTools", 106 | "Microsoft.Net.Component.4.6.1.SDK", 107 | "Microsoft.Net.Component.4.6.2.SDK", 108 | "Microsoft.Net.Component.4.7.SDK", 109 | "Microsoft.Net.Component.4.7.1.SDK", 110 | "Microsoft.Net.Component.4.7.2.SDK" 111 | ] 112 | } 113 | -------------------------------------------------------------------------------- /uno/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /uno/uno.Droid/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"); -------------------------------------------------------------------------------- /uno/uno.Droid/Assets/Fonts/uno-fluentui-assets.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Droid/Assets/Fonts/uno-fluentui-assets.ttf -------------------------------------------------------------------------------- /uno/uno.Droid/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Android.App; 7 | using Android.Content; 8 | using Android.OS; 9 | using Android.Runtime; 10 | using Android.Views; 11 | using Android.Widget; 12 | using Com.Nostra13.Universalimageloader.Core; 13 | using Windows.UI.Xaml.Media; 14 | 15 | namespace uno.Droid 16 | { 17 | [global::Android.App.ApplicationAttribute( 18 | Label = "@string/ApplicationName", 19 | LargeHeap = true, 20 | HardwareAccelerated = true, 21 | Theme = "@style/AppTheme" 22 | )] 23 | public class Application : Windows.UI.Xaml.NativeApplication 24 | { 25 | public Application(IntPtr javaReference, JniHandleOwnership transfer) 26 | : base(() => new App(), javaReference, transfer) 27 | { 28 | ConfigureUniversalImageLoader(); 29 | } 30 | 31 | private void ConfigureUniversalImageLoader() 32 | { 33 | // Create global configuration and initialize ImageLoader with this config 34 | ImageLoaderConfiguration config = new ImageLoaderConfiguration 35 | .Builder(Context) 36 | .Build(); 37 | 38 | ImageLoader.Instance.Init(config); 39 | 40 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /uno/uno.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Widget; 3 | using Android.OS; 4 | using Android.Content.PM; 5 | using Android.Views; 6 | 7 | namespace uno.Droid 8 | { 9 | [Activity( 10 | MainLauncher = true, 11 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, 12 | WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden 13 | )] 14 | public class MainActivity : Windows.UI.Xaml.ApplicationActivity 15 | { 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /uno/uno.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /uno/uno.Droid/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("$projectname$")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("$registeredorganization$")] 13 | [assembly: AssemblyProduct("$projectname$")] 14 | [assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")] 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 | -------------------------------------------------------------------------------- /uno/uno.Droid/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. -------------------------------------------------------------------------------- /uno/uno.Droid/Resources/drawable/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Droid/Resources/drawable/Icon.png -------------------------------------------------------------------------------- /uno/uno.Droid/Resources/values/Strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, Click Me! 4 | uno 5 | 6 | -------------------------------------------------------------------------------- /uno/uno.Droid/Resources/values/Styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /uno/uno.Droid/uno.Droid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | 52dda497-4886-45b3-b549-ae16a94c13b6 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | uno.Droid 13 | uno.Droid 14 | 512 15 | true 16 | Resources\Resource.Designer.cs 17 | true 18 | Off 19 | False 20 | v10.0 21 | Properties\AndroidManifest.xml 22 | True 23 | ..\uno.Shared\Strings 24 | 25 | 26 | true 27 | portable 28 | false 29 | bin\Debug\ 30 | DEBUG;TRACE 31 | prompt 32 | 4 33 | True 34 | None 35 | 36 | 37 | portable 38 | true 39 | true 40 | true 41 | bin\Release\ 42 | TRACE 43 | prompt 44 | 4 45 | False 46 | SdkOnly 47 | true 48 | true 49 | true 50 | true 51 | true 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /uno/uno.Shared/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /uno/uno.Shared/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Runtime.InteropServices.WindowsRuntime; 7 | using Windows.ApplicationModel; 8 | using Windows.ApplicationModel.Activation; 9 | using Windows.Foundation; 10 | using Windows.Foundation.Collections; 11 | using Windows.UI.Xaml; 12 | using Windows.UI.Xaml.Controls; 13 | using Windows.UI.Xaml.Controls.Primitives; 14 | using Windows.UI.Xaml.Data; 15 | using Windows.UI.Xaml.Input; 16 | using Windows.UI.Xaml.Media; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | namespace uno 20 | { 21 | /// 22 | /// Provides application-specific behavior to supplement the default Application class. 23 | /// 24 | public sealed partial class App : Application 25 | { 26 | /// 27 | /// Initializes the singleton application object. This is the first line of authored code 28 | /// executed, and as such is the logical equivalent of main() or WinMain(). 29 | /// 30 | public App() 31 | { 32 | ConfigureFilters(global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory); 33 | 34 | this.InitializeComponent(); 35 | this.Suspending += OnSuspending; 36 | } 37 | 38 | /// 39 | /// Invoked when the application is launched normally by the end user. Other entry points 40 | /// will be used such as when the application is launched to open a specific file. 41 | /// 42 | /// Details about the launch request and process. 43 | protected override void OnLaunched(LaunchActivatedEventArgs e) 44 | { 45 | #if DEBUG 46 | if (System.Diagnostics.Debugger.IsAttached) 47 | { 48 | // this.DebugSettings.EnableFrameRateCounter = true; 49 | } 50 | #endif 51 | 52 | #if NET5_0 && WINDOWS 53 | var window = new Window(); 54 | window.Activate(); 55 | #else 56 | var window = Windows.UI.Xaml.Window.Current; 57 | #endif 58 | 59 | Frame rootFrame = window.Content as Frame; 60 | 61 | // Do not repeat app initialization when the Window already has content, 62 | // just ensure that the window is active 63 | if (rootFrame == null) 64 | { 65 | // Create a Frame to act as the navigation context and navigate to the first page 66 | rootFrame = new Frame(); 67 | 68 | rootFrame.NavigationFailed += OnNavigationFailed; 69 | 70 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 71 | { 72 | //TODO: Load state from previously suspended application 73 | } 74 | 75 | // Place the frame in the current Window 76 | window.Content = rootFrame; 77 | } 78 | 79 | #if !(NET5_0 && WINDOWS) 80 | if (e.PrelaunchActivated == false) 81 | #endif 82 | { 83 | if (rootFrame.Content == null) 84 | { 85 | // When the navigation stack isn't restored navigate to the first page, 86 | // configuring the new page by passing required information as a navigation 87 | // parameter 88 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 89 | } 90 | // Ensure the current window is active 91 | window.Activate(); 92 | } 93 | } 94 | 95 | /// 96 | /// Invoked when Navigation to a certain page fails 97 | /// 98 | /// The Frame which failed navigation 99 | /// Details about the navigation failure 100 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 101 | { 102 | throw new Exception($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); 103 | } 104 | 105 | /// 106 | /// Invoked when application execution is being suspended. Application state is saved 107 | /// without knowing whether the application will be terminated or resumed with the contents 108 | /// of memory still intact. 109 | /// 110 | /// The source of the suspend request. 111 | /// Details about the suspend request. 112 | private void OnSuspending(object sender, SuspendingEventArgs e) 113 | { 114 | var deferral = e.SuspendingOperation.GetDeferral(); 115 | //TODO: Save application state and stop any background activity 116 | deferral.Complete(); 117 | } 118 | 119 | 120 | /// 121 | /// Configures global logging 122 | /// 123 | /// 124 | static void ConfigureFilters(ILoggerFactory factory) 125 | { 126 | factory 127 | .WithFilter(new FilterLoggerSettings 128 | { 129 | { "Uno", LogLevel.Warning }, 130 | { "Windows", LogLevel.Warning }, 131 | 132 | // Debug JS interop 133 | // { "Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug }, 134 | 135 | // Generic Xaml events 136 | // { "Windows.UI.Xaml", LogLevel.Debug }, 137 | // { "Windows.UI.Xaml.VisualStateGroup", LogLevel.Debug }, 138 | // { "Windows.UI.Xaml.StateTriggerBase", LogLevel.Debug }, 139 | // { "Windows.UI.Xaml.UIElement", LogLevel.Debug }, 140 | 141 | // Layouter specific messages 142 | // { "Windows.UI.Xaml.Controls", LogLevel.Debug }, 143 | // { "Windows.UI.Xaml.Controls.Layouter", LogLevel.Debug }, 144 | // { "Windows.UI.Xaml.Controls.Panel", LogLevel.Debug }, 145 | // { "Windows.Storage", LogLevel.Debug }, 146 | 147 | // Binding related messages 148 | // { "Windows.UI.Xaml.Data", LogLevel.Debug }, 149 | 150 | // DependencyObject memory references tracking 151 | // { "ReferenceHolder", LogLevel.Debug }, 152 | 153 | // ListView-related messages 154 | // { "Windows.UI.Xaml.Controls.ListViewBase", LogLevel.Debug }, 155 | // { "Windows.UI.Xaml.Controls.ListView", LogLevel.Debug }, 156 | // { "Windows.UI.Xaml.Controls.GridView", LogLevel.Debug }, 157 | // { "Windows.UI.Xaml.Controls.VirtualizingPanelLayout", LogLevel.Debug }, 158 | // { "Windows.UI.Xaml.Controls.NativeListViewBase", LogLevel.Debug }, 159 | // { "Windows.UI.Xaml.Controls.ListViewBaseSource", LogLevel.Debug }, //iOS 160 | // { "Windows.UI.Xaml.Controls.ListViewBaseInternalContainer", LogLevel.Debug }, //iOS 161 | // { "Windows.UI.Xaml.Controls.NativeListViewBaseAdapter", LogLevel.Debug }, //Android 162 | // { "Windows.UI.Xaml.Controls.BufferViewCache", LogLevel.Debug }, //Android 163 | // { "Windows.UI.Xaml.Controls.VirtualizingPanelGenerator", LogLevel.Debug }, //WASM 164 | } 165 | ) 166 | #if DEBUG 167 | .AddConsole(LogLevel.Debug); 168 | #else 169 | .AddConsole(LogLevel.Information); 170 | #endif 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /uno/uno.Shared/Assets/SharedAssets.md: -------------------------------------------------------------------------------- 1 | See documentation about assets here : https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md 2 | 3 | # Here is a cheat sheet: 4 | 5 | 1. Add the image file to the `Assets` directory of a shared project. 6 | 2. Set the build action to `Content`. 7 | 3. (Recommended) Provide an asset for various scales/dpi 8 | 9 | ## Examples 10 | 11 | ``` 12 | \Assets\Images\logo.scale-100.png 13 | \Assets\Images\logo.scale-200.png 14 | \Assets\Images\logo.scale-400.png 15 | 16 | \Assets\Images\scale-100\logo.png 17 | \Assets\Images\scale-200\logo.png 18 | \Assets\Images\scale\400\logo.png 19 | ``` 20 | 21 | ## Table of scales 22 | 23 | | Scale | UWP | iOS | Android | 24 | |-------|:-----------:|:--------:|:-------:| 25 | | `100` | scale-100 | @1x | mdpi | 26 | | `125` | scale-125 | N/A | N/A | 27 | | `150` | scale-150 | N/A | hdpi | 28 | | `200` | scale-200 | @2x | xhdpi | 29 | | `300` | scale-300 | @3x | xxhdpi | 30 | | `400` | scale-400 | N/A | xxxhdpi | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /uno/uno.Shared/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /uno/uno.Shared/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 | 16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 17 | 18 | namespace uno 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage : Page 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /uno/uno.Shared/Strings/en/Resources.resw: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | $ext_safeprojectname$ 122 | 123 | -------------------------------------------------------------------------------- /uno/uno.Shared/uno.Shared.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 6279c845-92f8-4333-ab99-3d213163593c 7 | 8 | 9 | uno.Shared 10 | 11 | 12 | 13 | Designer 14 | MSBuild:Compile 15 | 16 | 17 | 18 | 19 | App.xaml 20 | 21 | 22 | MainPage.xaml 23 | 24 | 25 | 26 | 27 | Designer 28 | MSBuild:Compile 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /uno/uno.Shared/uno.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6279c845-92f8-4333-ab99-3d213163593c 5 | 14.0 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/net5.0/uno.Skia.Gtk.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | }, 26 | { 27 | "name": ".NET Core Launch (remote console)", 28 | "type": "coreclr", 29 | "request": "launch", 30 | "preLaunchTask": "RaspberryDeployWSL", 31 | "program": "dotnet", 32 | "args": ["/home/pi/share/${workspaceFolderBasename}/${workspaceFolderBasename}.dll"], 33 | "cwd": "/home/pi/share/${workspaceFolderBasename}", 34 | "stopAtEntry": false, 35 | "console": "internalConsole", 36 | "pipeTransport": { 37 | "pipeCwd": "${workspaceFolder}", 38 | "pipeProgram": "C:\\Program Files\\PuTTY\\plink.exe", 39 | "pipeArgs": [ 40 | "-pw", 41 | "raspberry", 42 | "root@rpi4" 43 | ], 44 | "debuggerPath": "/home/pi/vsdbg/vsdbg" 45 | } 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.configureOnOpen": false 3 | } -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/uno.Skia.Gtk.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/uno.Skia.Gtk.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/uno.Skia.Gtk.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | }, 41 | { 42 | "label": "RaspberryPublish", 43 | "command": "sh", 44 | "type": "shell", 45 | "dependsOn": "build", 46 | "windows": { 47 | "command": "cmd", 48 | "args": [ 49 | "/c", 50 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish\"", 51 | "|", 52 | "\"scp -r ${workspaceFolder}/bin/linux-arm/publish/ pi@rpi4:/home/pi/share/${workspaceFolderBasename}\"" 53 | ], 54 | "problemMatcher": [] 55 | } 56 | }, 57 | { 58 | "label": "RaspberryPublishWSL", 59 | "command": "sh", 60 | "type": "shell", 61 | "dependsOn": "build", 62 | "windows": { 63 | "command": "cmd", 64 | "args": [ 65 | "/c", 66 | "\"dotnet publish -r linux-arm -o bin\\linux-arm\\publish --no-self-contained\"" 67 | ], 68 | "problemMatcher": [] 69 | } 70 | 71 | }, 72 | { 73 | "label": "RaspberryDeployWSL", 74 | "type": "shell", 75 | "dependsOn": "RaspberryPublishWSL", 76 | "presentation": { 77 | "reveal": "always", 78 | "panel": "new" 79 | }, 80 | "command": "bash", 81 | "args": [ 82 | "-c", 83 | "'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.91:share/${workspaceFolderBasename}/'" 84 | ], 85 | "problemMatcher": [] 86 | 87 | }, 88 | { 89 | "label": "RaspberryDeployWSLBat", 90 | "type": "shell", 91 | "dependsOn": "RaspberryPublishWSL", 92 | "presentation": { 93 | "reveal": "always", 94 | "panel": "new" 95 | }, 96 | "options": { 97 | "cwd": "${workspaceFolder}" 98 | }, 99 | "windows": { 100 | "command": "${cwd}\\publish3.bat" 101 | }, 102 | "problemMatcher": [] 103 | }, 104 | { 105 | "label": "echo", 106 | "type": "shell", 107 | "command": "echo 'sshpass -p \"raspberry\" rsync -rvuz $(wslpath '\"'${workspaceFolder}'\"')/bin/linux-arm/publish/ pi@192.168.1.91:share/${workspaceFolderBasename}/'" 108 | } 109 | ] 110 | } -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/Assets/Fonts/uno-fluentui-assets.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Skia.Gtk/Assets/Fonts/uno-fluentui-assets.ttf -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GLib; 3 | using Uno.UI.Runtime.Skia; 4 | 5 | namespace uno.Skia.Gtk 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs) 12 | { 13 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString()); 14 | expArgs.ExitApplication = true; 15 | }; 16 | 17 | var host = new GtkHost(() => new App(), args); 18 | 19 | host.Run(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "allowPrerelease": false, 4 | "version": "5.0.102", 5 | "rollForward": "latestMajor" 6 | } 7 | } -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/uno.Skia.Gtk.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | Exe 6 | net5.0 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /uno/uno.Skia.Gtk/workspace.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | }, 6 | { 7 | "path": "..\\uno.Shared" 8 | } 9 | ], 10 | "settings": {} 11 | } -------------------------------------------------------------------------------- /uno/uno.Skia.Tizen/Assets/Fonts/uno-fluentui-assets.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Skia.Tizen/Assets/Fonts/uno-fluentui-assets.ttf -------------------------------------------------------------------------------- /uno/uno.Skia.Tizen/Program.cs: -------------------------------------------------------------------------------- 1 | using Tizen.Applications; 2 | using Uno.UI.Runtime.Skia; 3 | 4 | namespace uno.Skia.Tizen 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | var host = new TizenHost(() => new uno.App(), args); 11 | host.Run(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /uno/uno.Skia.Tizen/shared/res/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Skia.Tizen/shared/res/Icon.png -------------------------------------------------------------------------------- /uno/uno.Skia.Tizen/tizen-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | Icon.png 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /uno/uno.Skia.Tizen/uno.Skia.Tizen.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | tizen50 6 | Exe 7 | $(DefineConstants);__TIZEN__; 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace uno.WPF.Host 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/Assets/Fonts/uno-fluentui-assets.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Skia.WPF.Host/Assets/Fonts/uno-fluentui-assets.ttf -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace uno.WPF.Host 17 | { 18 | /// 19 | /// Interaction logic for MainWindow.xaml 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | 27 | root.Content = new global::Uno.UI.Skia.Platform.WpfHost(Dispatcher, () => new uno.App()); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | //In order to begin building localizable applications, set 13 | //CultureYouAreCodingWith in your .csproj file 14 | //inside a . For example, if you are using US english 15 | //in your source files, set the to en-US. Then uncomment 16 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 17 | //the line below to match the UICulture setting in the project file. 18 | 19 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 20 | 21 | 22 | [assembly: ThemeInfo( 23 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 24 | //(used if a resource is not found in the page, 25 | // or application resource dictionaries) 26 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 27 | //(used if a resource is not found in the page, 28 | // app, or any theme specific resource dictionaries) 29 | )] 30 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace uno.WPF.Host.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("uno.WPF.Host.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace uno.WPF.Host.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF.Host/uno.Skia.Wpf.Host.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | Exe 6 | netcoreapp3.1 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF/Program.cs: -------------------------------------------------------------------------------- 1 | namespace uno.Skia.Gtk 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /uno/uno.Skia.WPF/uno.Skia.WPF.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /uno/uno.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /uno/uno.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /uno/uno.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /uno/uno.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /uno/uno.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /uno/uno.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /uno/uno.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | uno 18 | uno 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /uno/uno.UWP/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("$projectname$")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("$registeredorganization$")] 12 | [assembly: AssemblyProduct("$projectname$")] 13 | [assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")] 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)] 30 | -------------------------------------------------------------------------------- /uno/uno.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /uno/uno.Wasm/Assets/SplashScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.Wasm/Assets/SplashScreen.png -------------------------------------------------------------------------------- /uno/uno.Wasm/LinkerConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /uno/uno.Wasm/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.UI.Xaml; 3 | 4 | namespace uno.Wasm 5 | { 6 | public class Program 7 | { 8 | private static App _app; 9 | 10 | static int Main(string[] args) 11 | { 12 | Windows.UI.Xaml.Application.Start(_ => _app = new App()); 13 | 14 | return 0; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /uno/uno.Wasm/WasmScripts/AppManifest.js: -------------------------------------------------------------------------------- 1 | var UnoAppManifest = { 2 | 3 | splashScreenImage: "Assets/SplashScreen.png", 4 | splashScreenColor: "#0078D7", 5 | displayName: "uno" 6 | 7 | } 8 | -------------------------------------------------------------------------------- /uno/uno.Wasm/uno.Wasm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netstandard2.0 6 | NU1701 7 | 8 | 9 | true 10 | $(DefineConstants);TRACE;DEBUG 11 | portable 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /uno/uno.Wasm/wwwroot/web.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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /uno/uno.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /uno/uno.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | uno 7 | CFBundleIdentifier 8 | com.companyname.uno 9 | CFBundleShortVersionString 10 | 1.0 11 | CFBundleVersion 12 | 1.0 13 | LSRequiresIPhoneOS 14 | 15 | MinimumOSVersion 16 | 8.0 17 | UIDeviceFamily 18 | 19 | 1 20 | 2 21 | 22 | UILaunchStoryboardName 23 | LaunchScreen 24 | UIRequiredDeviceCapabilities 25 | 26 | armv7 27 | arm64 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIAppFonts 43 | 44 | Fonts/uno-fluentui-assets.ttf 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | UILaunchImageMinimumOSVersion 49 | 9.0 50 | UILaunchImageOrientation 51 | Portrait 52 | UILaunchImageSize 53 | {320, 568} 54 | UIApplicationSupportsIndirectInputEvents 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /uno/uno.iOS/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 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /uno/uno.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using UIKit; 2 | 3 | namespace uno.iOS 4 | { 5 | public class Application 6 | { 7 | // This is the main entry point of the application. 8 | static void Main(string[] args) 9 | { 10 | // if you want to use a different Application Delegate class from "AppDelegate" 11 | // you can specify it here. 12 | UIApplication.Main(args, null, typeof(App)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "scale": "2x", 5 | "size": "29x29", 6 | "idiom": "iphone" 7 | }, 8 | { 9 | "scale": "3x", 10 | "size": "29x29", 11 | "idiom": "iphone" 12 | }, 13 | { 14 | "scale": "2x", 15 | "size": "40x40", 16 | "idiom": "iphone" 17 | }, 18 | { 19 | "scale": "3x", 20 | "size": "60x60", 21 | "idiom": "iphone" 22 | }, 23 | { 24 | "scale": "1x", 25 | "size": "20x20", 26 | "idiom": "ipad" 27 | }, 28 | { 29 | "scale": "2x", 30 | "size": "20x20", 31 | "idiom": "ipad" 32 | }, 33 | { 34 | "scale": "1x", 35 | "size": "29x29", 36 | "idiom": "ipad" 37 | }, 38 | { 39 | "scale": "2x", 40 | "size": "29x29", 41 | "idiom": "ipad" 42 | }, 43 | { 44 | "scale": "1x", 45 | "size": "40x40", 46 | "idiom": "ipad" 47 | }, 48 | { 49 | "scale": "2x", 50 | "size": "40x40", 51 | "idiom": "ipad" 52 | }, 53 | { 54 | "scale": "1x", 55 | "size": "76x76", 56 | "idiom": "ipad" 57 | }, 58 | { 59 | "scale": "2x", 60 | "size": "20x20", 61 | "idiom": "iphone", 62 | "filename": "iPhone-20x20@2x.png" 63 | }, 64 | { 65 | "scale": "3x", 66 | "size": "20x20", 67 | "idiom": "iphone", 68 | "filename": "iPhone-20x20@3x.png" 69 | }, 70 | { 71 | "scale": "3x", 72 | "size": "40x40", 73 | "idiom": "iphone", 74 | "filename": "iPhone-40x40@3x.png" 75 | }, 76 | { 77 | "scale": "2x", 78 | "size": "60x60", 79 | "idiom": "iphone", 80 | "filename": "iPhone-60x60@2x.png" 81 | }, 82 | { 83 | "scale": "2x", 84 | "size": "76x76", 85 | "idiom": "ipad", 86 | "filename": "iPad-76x76@2x.png squaretile-sdk-ipad.png" 87 | }, 88 | { 89 | "scale": "2x", 90 | "size": "83.5x83.5", 91 | "idiom": "ipad", 92 | "filename": "iPad-84x84@2x.png" 93 | }, 94 | { 95 | "scale": "1x", 96 | "size": "1024x1024", 97 | "idiom": "ios-marketing", 98 | "filename": "ios-marketing-1024x1024@1x.png" 99 | } 100 | ], 101 | "properties": {}, 102 | "info": { 103 | "version": 1, 104 | "author": "xcode" 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPad-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPad-76x76@2x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPad-84x84@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPad-84x84@2x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-20x20@2x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-20x20@3x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-40x40@3x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/iPhone-60x60@2x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/AppIcons.appiconset/ios-marketing-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Media.xcassets/AppIcons.appiconset/ios-marketing-1024x1024@1x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Media.xcassets/LaunchImages.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "orientation": "portrait", 5 | "extent": "full-screen", 6 | "minimum-system-version": "7.0", 7 | "scale": "2x", 8 | "size": "640x960", 9 | "idiom": "iphone" 10 | }, 11 | { 12 | "orientation": "portrait", 13 | "extent": "full-screen", 14 | "minimum-system-version": "7.0", 15 | "subtype": "retina4", 16 | "scale": "2x", 17 | "size": "640x1136", 18 | "idiom": "iphone" 19 | }, 20 | { 21 | "orientation": "portrait", 22 | "extent": "full-screen", 23 | "minimum-system-version": "7.0", 24 | "scale": "1x", 25 | "size": "768x1024", 26 | "idiom": "ipad" 27 | }, 28 | { 29 | "orientation": "landscape", 30 | "extent": "full-screen", 31 | "minimum-system-version": "7.0", 32 | "scale": "1x", 33 | "size": "1024x768", 34 | "idiom": "ipad" 35 | }, 36 | { 37 | "orientation": "portrait", 38 | "extent": "full-screen", 39 | "minimum-system-version": "7.0", 40 | "scale": "2x", 41 | "size": "1536x2048", 42 | "idiom": "ipad" 43 | }, 44 | { 45 | "orientation": "landscape", 46 | "extent": "full-screen", 47 | "minimum-system-version": "7.0", 48 | "scale": "2x", 49 | "size": "2048x1536", 50 | "idiom": "ipad" 51 | } 52 | ], 53 | "properties": {}, 54 | "info": { 55 | "version": 1, 56 | "author": "" 57 | } 58 | } -------------------------------------------------------------------------------- /uno/uno.iOS/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("$projectname$")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("$registeredorganization$")] 12 | [assembly: AssemblyProduct("$projectname$")] 13 | [assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("166de4ca-8f11-4ef9-bcf8-3e7834988e7d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /uno/uno.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Resources/Fonts/uno-fluentui-assets.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Resources/Fonts/uno-fluentui-assets.ttf -------------------------------------------------------------------------------- /uno/uno.iOS/Resources/SplashScreen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Resources/SplashScreen@2x.png -------------------------------------------------------------------------------- /uno/uno.iOS/Resources/SplashScreen@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.iOS/Resources/SplashScreen@3x.png -------------------------------------------------------------------------------- /uno/uno.macOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using AppKit; 2 | using Foundation; 3 | 4 | namespace uno.macOS 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "AppIcon-16.png", 5 | "size": "16x16", 6 | "scale": "1x", 7 | "idiom": "mac" 8 | }, 9 | { 10 | "filename": "AppIcon-16@2x.png", 11 | "size": "16x16", 12 | "scale": "2x", 13 | "idiom": "mac" 14 | }, 15 | { 16 | "filename": "AppIcon-32.png", 17 | "size": "32x32", 18 | "scale": "1x", 19 | "idiom": "mac" 20 | }, 21 | { 22 | "filename": "AppIcon-32@2x.png", 23 | "size": "32x32", 24 | "scale": "2x", 25 | "idiom": "mac" 26 | }, 27 | { 28 | "filename": "AppIcon-128.png", 29 | "size": "128x128", 30 | "scale": "1x", 31 | "idiom": "mac" 32 | }, 33 | { 34 | "filename": "AppIcon-128@2x.png", 35 | "size": "128x128", 36 | "scale": "2x", 37 | "idiom": "mac" 38 | }, 39 | { 40 | "filename": "AppIcon-256.png", 41 | "size": "256x256", 42 | "scale": "1x", 43 | "idiom": "mac" 44 | }, 45 | { 46 | "filename": "AppIcon-256@2x.png", 47 | "size": "256x256", 48 | "scale": "2x", 49 | "idiom": "mac" 50 | }, 51 | { 52 | "filename": "AppIcon-512.png", 53 | "size": "512x512", 54 | "scale": "1x", 55 | "idiom": "mac" 56 | }, 57 | { 58 | "filename": "AppIcon-512@2x.png", 59 | "size": "512x512", 60 | "scale": "2x", 61 | "idiom": "mac" 62 | } 63 | ], 64 | "info": { 65 | "version": 1, 66 | "author": "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /uno/uno.macOS/Assets.xcassets/unologo.imageset/unoplatform.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Assets.xcassets/unologo.imageset/unoplatform.jpg -------------------------------------------------------------------------------- /uno/uno.macOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /uno/uno.macOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | uno.macOS 7 | CFBundleIdentifier 8 | com.companyname.uno-macOS 9 | CFBundleShortVersionString 10 | 1.0 11 | CFBundleVersion 12 | 1 13 | LSMinimumSystemVersion 14 | 10.11 15 | CFBundleDevelopmentRegion 16 | en 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | NSHumanReadableCopyright 24 | ${AuthorCopyright:HtmlEncode} 25 | NSPrincipalClass 26 | NSApplication 27 | XSAppIconAssets 28 | Assets.xcassets/AppIcon.appiconset 29 | ATSApplicationFontsPath 30 | Fonts/uno-fluentui-assets.ttf 31 | 32 | 33 | -------------------------------------------------------------------------------- /uno/uno.macOS/Main.cs: -------------------------------------------------------------------------------- 1 | using AppKit; 2 | 3 | namespace uno.macOS 4 | { 5 | static class MainClass 6 | { 7 | static void Main(string[] args) 8 | { 9 | NSApplication.Init(); 10 | NSApplication.SharedApplication.Delegate = new App(); 11 | NSApplication.Main(args); 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /uno/uno.macOS/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("$projectname$")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("$registeredorganization$")] 12 | [assembly: AssemblyProduct("$projectname$")] 13 | [assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("166de4ca-8f11-4ef9-bcf8-3e7834988e7d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /uno/uno.macOS/Resources/Fonts/uno-fluentui-assets.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pjgpetecodes/dotnet7pi/00f471fb5d88f7bb71466e91bbdd44821a8bd30c/uno/uno.macOS/Resources/Fonts/uno-fluentui-assets.ttf -------------------------------------------------------------------------------- /uno/uno.macOS/uno.macOS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | 0962fcc8-1151-4973-ad15-061d0022230f 7 | {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Exe 9 | uno.macOS 10 | uno.macOS 11 | v2.0 12 | Xamarin.Mac 13 | Resources 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug 20 | DEBUG 21 | prompt 22 | 4 23 | false 24 | Mac Developer 25 | false 26 | false 27 | false 28 | true 29 | true 30 | true 31 | 32 | 33 | 34 | 35 | 36 | 37 | false 38 | pdbonly 39 | true 40 | bin\Release 41 | 42 | prompt 43 | 4 44 | false 45 | true 46 | false 47 | true 48 | true 49 | true 50 | SdkOnly 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Always 102 | 103 | 104 | 105 | 106 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | --------------------------------------------------------------------------------