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
// C# 6 return complex types | |
public class result | |
{ | |
public int Sum {get;set;} | |
public int Count {get;set;} | |
} | |
public result Total(int[] values) | |
{ | |
return new 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
<FlipView Width="320" | |
Height="480" | |
RelativePanel.AlignHorizontalCenterWithPanel="True" | |
RelativePanel.AlignVerticalCenterWithPanel="True"> | |
<FlipView.ItemTemplate> | |
<DataTemplate> | |
<Image Source="{Binding}" /> | |
</DataTemplate> | |
</FlipView.ItemTemplate> | |
<FlipView.Items> |
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 SqliteDAL | |
{ | |
public static class Database | |
{ | |
public static string FileName { get; set; } = "Storage.sqlite"; | |
public static StorageFolder Folder { get; set; } = ApplicationData.Current.LocalFolder; | |
public static async Task DropAsync(string path = null) | |
{ |
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
/// <summary> | |
/// This is a very simple example of a DI/IoC container. | |
/// </summary> | |
public sealed class SimpleContainer | |
{ | |
readonly Dictionary<Type, Func<object>> registeredCreators = new Dictionary<Type, Func<object>>(); | |
/// <summary> | |
/// Register a type with the container. This is only necessary if the | |
/// type has a non-default constructor or needs to be customized in some fashion. |
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 WunderlistHelper | |
{ | |
private static Template10.Services.NetworkAvailableService.NetworkAvailableService _NetworkService = new NetworkAvailableService(); | |
private static Template10.Services.SecretService.SecretService _SecretService = new SecretService(); | |
private static Template10.Services.HttpService.HttpHelper _HttpHelper = new HttpHelper(); | |
private WunderlistSettings _settings; | |
public WunderlistHelper(WunderlistSettings settings) | |
{ | |
_settings = settings; |
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.Threading.Tasks; | |
using Windows.Web.Http; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using Windows.Networking.BackgroundTransfer; | |
using System.Diagnostics; | |
using Windows.Storage; | |
using Windows.Security.Credentials; | |
using Windows.UI.Notifications; |
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 ButtonEx : Button | |
{ | |
public ButtonEx() : base() | |
{ | |
ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.System; | |
ManipulationCompleted += (s, e) => ShouldExcuteCommand2(Math.Abs(e.Cumulative.Translation.X)); | |
Tapped += (s, e) => ShouldExcuteCommand2(DateTime.Now); | |
} | |
private void ShouldExcuteCommand2(double distanceX) |
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
#Prep | |
Update-ExecutionPolicy Unrestricted | |
Disable-UAC | |
#Win Config | |
Set-TaskbarOptions -Size Small -Lock -Dock Top | |
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Disable-InternetExplorerESC |
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
namespace Analogy | |
{ | |
/// <summary> | |
/// This example shows that a library that needs access to target .NET Standard 1.3 | |
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
/// </summary>INetCoreApp10 | |
class Example1 | |
{ | |
public void Net45Application(INetFramework45 platform) |
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
namespace Analogy | |
{ | |
/// <summary> | |
/// This example shows that a library that needs access to target .NET Standard 1.3 | |
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
/// </summary>INetCoreApp10 | |
class Example1 | |
{ | |
public void Net45Application(INetFramework45 platform) |
OlderNewer