This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Drawing; | |
| using System.Linq; | |
| using System.Threading; | |
| namespace Snake | |
| { | |
| public enum Direction { Stop, Up, Down, Left, Right } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ApplicationTask : IBackgroundTask | |
| { | |
| public void Run(IBackgroundTaskInstance instance) | |
| { | |
| Debugger.Break(); | |
| } | |
| public static async Task<IBackgroundTrigger> RegisterWithApplicationTriggerAsync(params IBackgroundCondition[] conditions) | |
| { | |
| var trigger = new ApplicationTrigger(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private async Task<SoftwareBitmapSource> CropImageAsync(ImageSource source, Rectangle rectangle) | |
| { | |
| try | |
| { | |
| SoftwareBitmap bitmap; | |
| var image = source as BitmapImage; | |
| var file = await StorageFile.GetFileFromApplicationUriAsync(image.UriSource); | |
| using (var stream = await file.OpenAsync(FileAccessMode.Read)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void GetBoxCoordinates(long[] longs, out (Point TopLeft, Point TopRight, Point BottomRight, Point BottomLeft) corners, out Size size, out double angle) | |
| { | |
| if (longs.Length != 8) | |
| { | |
| throw new ArgumentOutOfRangeException(nameof(longs)); | |
| } | |
| corners = ( | |
| new Point((int)longs[0], (int)longs[1]), | |
| new Point((int)longs[2], (int)longs[3]), | |
| new Point((int)longs[4], (int)longs[5]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void Main(string[] args) | |
| { | |
| SetLicense(); | |
| var path = Path.Combine(Environment.CurrentDirectory, "artwork1.pdf"); | |
| using (var doc = new Document(path)) | |
| { | |
| var tableOptions = new TextSearchOptions(false) | |
| { | |
| IgnoreShadowText = true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.ApplicationInsights; | |
| using Microsoft.ApplicationInsights.Extensibility; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.Azure.Functions.Extensions.DependencyInjection; | |
| using Microsoft.Azure.WebJobs; | |
| using Microsoft.Azure.WebJobs.Extensions.Http; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Logging; | |
| using Newtonsoft.Json.Linq; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Page | |
| x:Class="UsingRing.MainPage" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:local="using:UsingRing" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| mc:Ignorable="d" | |
| Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| internal class Program | |
| { | |
| private static void Main(string[] args) | |
| { | |
| Test("pass"); | |
| Test("password"); | |
| Test("Password"); | |
| Test("P@ssword"); | |
| Test("P@ssw0rd"); | |
| Test("P@ssW0rD"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sealed partial class App : Application | |
| { | |
| public App() | |
| { | |
| InitializeComponent(); | |
| Suspending += (s, e) => Helpers.ShowToast("Suspending"); | |
| Resuming += (s, e) => Helpers.ShowToast("Resuming"); | |
| Helpers.SetupExSession( | |
| allowed: () => Helpers.ShowToast("Allowed"), | |
| denied: () => Helpers.ShowToast("Denied"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static async Task<string> ScaleImageAsync(string path, uint height = 32, uint width = 32, StorageFile output_file = null) | |
| { | |
| // open file from path | |
| var input_file = default(StorageFile); | |
| try | |
| { | |
| input_file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(path)); | |
| } | |
| catch (FileNotFoundException) |