- Presentation.WPF - Main path in presentation layer for WPF
- Views - Views xaml to be located here
- Controls - Page xaml like things here
- Converters - UI Converters here
- Validators - Validation code here
- Windows - Window xaml files here
- ViewModels - ViewModels matching names of views/windows here
- Themes - Global themes to be uesd in Views and reused
- Views - Views xaml to be located here
- Resources - Files like StringResources.xaml, StringResources.fr-CA.xaml 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
[editor] | |
true-color = true | |
color-modes = true | |
[keys.insert] | |
C-s = ["normal_mode", ":w", "insert_mode"] | |
C-q = ":quit!" | |
C-S-up = "extend_line_up" | |
S-up = ["extend_line_up"] | |
C-S-down = ["extend_line_down"] |
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
$id = get-random | |
$maxSizeMB = 500 | |
$code = @" | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Collections.Generic; | |
namespace HelloWorld |
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 ShouldSerializeContractResolver : DefaultContractResolver | |
{ | |
public static readonly ShouldSerializeContractResolver Instance = new ShouldSerializeContractResolver(); | |
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) | |
{ | |
JsonProperty property = base.CreateProperty(member, memberSerialization); | |
if (property.PropertyType == typeof(string)) | |
return property; |
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# Comb Guid generation | |
// Found at http://stackoverflow.com/questions/665417/sequential-guid-in-linq-to-sql/2187898#2187898 | |
Guid GenerateComb() | |
{ | |
byte[] destinationArray = Guid.NewGuid().ToByteArray(); | |
DateTime time = new DateTime(0x76c, 1, 1); | |
DateTime now = DateTime.Now; | |
TimeSpan span = new TimeSpan(now.Ticks - time.Ticks); | |
TimeSpan timeOfDay = now.TimeOfDay; |
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
function wait-websiteup($testUrl, $timeoutSeconds){ | |
$webClient = new-object System.Net.WebClient | |
$webClient.Headers.Add(“user-agent”, “PowerShell Script”) | |
$startTime = get-date | |
while (1 -eq 1) { | |
$output = “” | |
try{ |
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
//API | |
public async Task<HttpResponseMessage> DeployPackage() | |
{ | |
if (!Request.Content.IsMimeMultipartContent("form-data")) | |
{ | |
throw new HttpResponseException(HttpStatusCode.BadRequest); | |
} |
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
In code: | |
<Button | |
Content="{DynamicResource Previous}" | |
Command="{Binding PrevView}" Grid.Column="0"/> | |
<Window.Resources> | |
<ResourceDictionary> | |
<!--<Selectors:ViewSelector x:Key="ViewSelector"> | |
</Selectors:ViewSelector>--> | |
<ResourceDictionary.MergedDictionaries> |
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
//http://stackoverflow.com/a/10407992/51841 | |
using System; | |
using System.Linq; | |
using System.Net; | |
using System.Web; | |
public class RequestHelpers | |
{ | |
public static string GetClientIpAddress(HttpRequestBase request) |
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
//original http://stackoverflow.com/a/7472334/518 | |
var cancellationTokenSource = new CancellationTokenSource(); | |
var task = Repeat.Interval( | |
TimeSpan.FromSeconds(15), | |
() => CheckDatabaseForNewReports(), cancellationTokenSource.Token); | |
internal static class Repeat | |
{ |
NewerOlder