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
| // 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.
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
| <# | |
| Git Helpers for PowerShell | |
| Author: Damian Suess | |
| Revision: 2.b - 2018-07-30 (2018-10-03) | |
| TODO: | |
| - GitCheckIn $message (check-in/push) | |
| - GitPush - Set branch tracking or no tracking | |
| Change Log: |
| Title | Lanugage | Category |
|---|---|---|
| C# Environment.SpecialFolder | C# | Generic |
| Tomboy - Trac Plugin | C# | Mono.Addins |
| Log4Net Standup | C# | Log4Net |
| GUI Thread-Safe Updates | C# | Threadding |
The following is an example of how to search SQL Jobs for text using TSQL
-- SQL 2005-2008 - Search all Jobs
SELECT j.job_id, s.srvname, j.name, js.step_id, js.command, j.enabled
FROM msdb.dbo.sysjobs j
JOIN msdb.dbo.sysjobsteps js ON js.job_id = j.job_id
JOIN master.dbo.sysservers s ON s.srvid = j.originating_server_id
WHERE js.command LIKE N'%...%'