var x = 1;
// same as string.Format("A {0} B", x)
var y1 = $"A {x} B"; // y == "A 1 B"
// $@ for multiline
var y2 = $@"A
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
// ******** WinUI3 Window management ******** // | |
using Microsoft.Maui.LifecycleEvents; | |
#if WINDOWS | |
using Microsoft.UI; | |
using Microsoft.UI.Windowing; | |
using Windows.Graphics; | |
#endif | |
namespace MyApp.Maui |
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 EnumerableExtensions | |
{ | |
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> enumerable, Func<TSource, TSource, bool> comparer) | |
{ | |
return enumerable.Distinct(new LambdaComparer<TSource>(comparer)); | |
} | |
public static IEnumerable<TSource> Except<TSource>(this IEnumerable<TSource> enumerable, IEnumerable<TSource> comparison, Func<TSource, TSource, bool> comparer) | |
{ | |
return enumerable.Except(comparison, new LambdaComparer<TSource>(comparer)); |
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 LambdaComparer<T> : IEqualityComparer<T> | |
{ | |
private readonly Func<T, T, bool> _lambdaComparer; | |
private readonly Func<T, int> _lambdaHash; | |
public LambdaComparer(Func<T, T, bool> lambdaComparer) : | |
this(lambdaComparer, o => 0) | |
{ | |
} |
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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version): | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, |
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
Michael Crump | |
@mbcrump | |
michael.crump@telerik.com | |
------------- | |
All Source Code (WPF, WP8, Win 8) | |
http://bit.ly/HTwKWD | |
RadControl Bits Required | |
WPF/SL |
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
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
$rss = (new-object net.webclient) | |
#Set the username for windows auth proxy | |
#$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials | |
#http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/rss/mp4high/?sort=sequential&direction=desc&term=&r=Developer+Tools+%26+Application+Lifecycle+Management&r=Windows+Azure+Application+Development&y=Breakout&Media=true#fbid=FDnmapgI5Hf | |
#http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/RSS/mp4high | |
#http://channel9.msdn.com/Events/Build/2013/RSS/mp4high#theSessions | |
#http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/rss/mp4high/?sort=sequential&direction=desc&term=&r=Developer+Tools+%26+Application+Lifecycle+Management&r=Windows+Azure+Application+Development&y=Breakout&Media=true#fbid=FDnmapgI5Hf | |
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/2013/RSS/mp4high#theSessions")) | |
$a.rss.channel.item | foreach{ |