To see all commits for this version, click here.
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.ComponentModel; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
public static T GetEnumFromDescription<T>(string description) | |
{ | |
T result; |
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; | |
class Program | |
{ | |
enum PetType | |
{ | |
None, | |
Cat = 1, | |
Dog = 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
//some long running code - circa 12/13 seconds | |
for (int i = 0; i < 10_000_000; i++) | |
{ | |
DateTime.Now.ToString(); | |
} |
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
// Set up (full example at https://github.com/GregTrevellick/AutoFindReplace) | |
IServiceContainer serviceContainer = this as IServiceContainer; | |
DTE dte = serviceContainer.GetService(typeof(SDTE)) as DTE; | |
var projs = new List<string>(); | |
// Let's assume we have a solution containing three projects | |
// The following will crash | |
for (int i = 0; i < dte.Solution.Projects.Count; i++) // Projects.Count is '3' as we'd expect | |
{ |
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
//[Route("api/v1/Something")] | |
[ApiVersion("1.0")] | |
[Route("api/v{version:apiVersion}/[controller]")] |
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
tfx extension create --manifest-globs vss-extension.json | |
tfx extension create --rev-version --manifest-globs vss-extension.json | |
//An extension/integration's version must be incremented on every update. | |
//If you haven't incremented your extension/integration in the manifest, you should pass the --rev-version command line switch. | |
//This will increment the patch version number of your extension and save the new version to your manifest. |
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
//GET: | |
var client = new RestClient("192.168.0.1"); | |
var request = new RestRequest("api/item/", Method.GET); | |
var queryResult = client.Execute<List<Items>>(request).Data; | |
//POST: | |
var client = new RestClient("http://192.168.0.1"); | |
var request = new RestRequest("api/item/", Method.POST); | |
request.RequestFormat = DataFormat.Json; | |
request.AddBody(new Item |
2018-06-12
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
//Debug code (pause for 3 secs) | |
await new Promise(resolve => setTimeout(resolve, 3000)); |
OlderNewer