TextDocument document = textEditor.Document;
DocumentLine start = document.GetLineByOffset(textEditor.SelectionStart);
DocumentLine end = document.GetLineByOffset(textEditor.SelectionStart + textEditor.SelectionLength);
using (document.RunUpdate()) {
for (DocumentLine line = start; line != end; line = line.NextLine)
{
document.Insert(line.Offset, "// ");
}
}
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
<!-- Source: https://stackoverflow.com/questions/36483179/scaling-complex-svg-paths-in-wpf-xaml --> | |
<StackPanel> | |
<Viewbox Height="20" Margin="5"> | |
<Canvas Width="213.333" Height="213.333" Clip="F1 M 0,0L 213.333,0L 213.333,213.333L 0,213.333L 0,0" UseLayoutRounding="False"> | |
<Canvas Canvas.Left="0" Canvas.Top="0"> | |
<Path Width="213.333" Height="213.333" Canvas.Left="0" Canvas.Top="3.05176e-005" Stretch="Fill" Fill="#FFEDEDED" Data="F1 M 213.333,106.667C 213.333,165.579 165.579,213.333 106.667,213.333C 47.7547,213.333 0,165.579 0,106.667C 0,47.7547 47.7547,3.05176e-005 106.667,3.05176e-005C 165.579,3.05176e-005 213.333,47.7547 213.333,106.667 Z "/> | |
<Canvas Width="92.2653" Height="115.307" Canvas.Left="60.588" Canvas.Top="46.828"> | |
<Path Width="57.6053" Height="40.3173" Canvas.Left="17.276" Canvas.Top="0" Stretch="Fill" Fill="#FF424242" Data="F1 M 46.0787,0C 30.1827,0 17.276,13.0107 17.276,28.7973L 17.276,40.3173L 2 |
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.Resources> | |
<Style TargetType="{x:Type CheckBox}" | |
BasedOn="{StaticResource {x:Type CheckBox}}"> | |
<Style.Triggers> | |
<Trigger Property="Grid.Column" Value="0"> | |
<Setter Property="HorizontalAlignment" Value="Center" /> | |
<Setter Property="VerticalAlignment" Value="Center" /> | |
</Trigger> | |
</Style.Triggers> | |
</Style> |
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
// This is an example of configuring Microsoft DI to auto-wire classes with the suffix, 'Actor'. | |
// Usage: | |
// In your ASP.NET Core's Startup.cs method, ConfigureServices, add the following line | |
// ``services.AddActors();`` | |
// The system will then scan for all classes which end with the name, 'Actor' and register | |
// them as singletons. | |
public static class DependencyExtension | |
{ | |
/// <summary>Auto-wire state machine actors, directors, or coordinators.</summary> |
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
// Sample 1 - Non-Helper Function Method | |
public bool HardReset() | |
{ | |
return HardResetAsync().GetAwaiter().GetResult(); | |
} | |
public async Task<bool> HardResetAsync() | |
{ | |
// Real code goes here | |
await Task.Yield(); |
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 Xeno Innovations, Inc. 2020 | |
* Date: 2020-8-30 | |
* File: DictionaryJsonConverter.cs | |
* Description: | |
* Dictionary JSON Converter | |
* | |
* Reference: | |
* - https://github.com/dotnet/runtime/blob/master/src/libraries/System.Text.Json/tests/Serialization/CustomConverterTests/CustomConverterTests.DictionaryGuidConverter.cs | |
* - https://github.com/dotnet/runtime/issues/30524 | |
*/ |
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.Text; | |
using System.Linq; | |
using System.Security.Cryptography; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var request = "322424946172;69760;24051943;000001;69760;000182B0CC538B1C5F1EFB31CDA1FB01A15D62AC380F38A6EDB6"; |
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 class ListExtension | |
{ | |
public static void Add<T>(this List<T> list, T value, out List<T> newInstance) | |
{ | |
if (list == null) list = new List<T>(); | |
list?.Add(value); | |
newInstance = list; | |
} | |
} |
Borrowed from very nice work on StackOverflow by, Vahid.
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
Here is SmsReceiver class in Android project:
Note iOS doesnt allow reading SMS so here's android only.