$ git clone [REPO-URL]
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
| <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | |
| <StreamGeometry x:Key="Blank"></StreamGeometry> | |
| <StreamGeometry x:Key="CheckBoxUnchecked">M5.75,3 L18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 Z M5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 L5.75,4.5 Z</StreamGeometry> | |
| <StreamGeometry x:Key="CheckBoxChecked">M18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 L18.25,3 Z M18.25,4.5 L5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406 |
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
| // Switch Expression with partial string matching | |
| var dict = new Dictionary<int, string>(); | |
| var files = new List<string> { "cloud-records.cfg", "ex1-usergroups.cfg", "ex1-users.cfg", "doesntbelong.cfg" }; | |
| foreach (var file in files) | |
| { | |
| var keyName = file switch | |
| { | |
| string s when s.Contains("cloud") => ConfigType.CloudConnection, | |
| string s when s.Contains("usergroups") => ConfigType.FrameSerialNumber, | |
| string s when s.Contains("users") => ConfigType.PCSerialNumber, |
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.Linq; | |
| using System.Reflection; | |
| using Microsoft.Extensions.DependencyInjection; | |
| namespace Xeno.StateMachine.Extensions | |
| { | |
| public static class DependencyExtension | |
| { | |
| /// <summary>Auto-wire state machine actors, directors, or coordinators.</summary> | |
| /// <param name="service">MS IOC service.</param> |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <!-- | |
| REPLACE: "MyApp" with your app name | |
| Logging Help: | |
| Base log level is set by, 'internalLogLevel'. ASP.NET can override via, 'appsettings.json' | |
| Log Levels: Off|Trace|Debug|Info|Warn|Error|Fatal | |
| --> | |
| <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
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
| // <copyright file="IJsonService.cs" company="Xeno Innovations, Inc."> | |
| // Copyright (c) 2022 Xeno Innovations, Inc. All rights reserved. | |
| // | |
| // Reproduction or transmission in whole or in part, in | |
| // any form or by any means, electronic, mechanical, or otherwise, is | |
| // prohibited without the prior written consent of the copyright owner. | |
| // </copyright> | |
| // <author>Damian Suess</author> | |
| using System.Threading.Tasks; |
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
| <UserControl xmlns="https://github.com/avaloniaui" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| MaxHeight="{Binding MaxHeight}" | |
| MaxWidth="{Binding MaxWidth}" | |
| mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="150" | |
| x:Class="SampleApp.Views.MessageDialogView"> | |
| <UserControl.Styles> | |
| <Style Selector="TextBox"> |
Scenerio, you have an awaitable object and you want to await it with a timeout. How would you build that?
What you can do is use a when_any-like function in combination with a timeout coroutine. For C# this would be something like
await Task.WhenAny(