This file contains 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 LoggingExtensions | |
{ | |
/// <summary> | |
/// Quick way to return dictionary for logging scope. | |
/// </summary> | |
/// <param name="key">Key to use</param> | |
/// <param name="value">Value to use</param> | |
/// <returns>Dictionary of one key value pair</returns> | |
public static Dictionary<string, object> ScopeIt(this string key, object value) | |
=> new Dictionary<string, object> { [key] = value }; |
This file contains 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 a repistory of many differen extensions I use throughout multiple projects. | |
/// A location here for ultimate move to other named extensions. | |
public static class HTTPExtensions | |
{ | |
/// <summary> | |
/// Allow one to build a URL from its parts, similar to Path.Combine. | |
/// </summary> | |
/// <remarks>HMTL Extensions</Remarks> | |
/// <param name="baseUrl">Initial bitof the url</param> |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Generic FK Create/Drop</Title> | |
<Shortcut>FKMSTS</Shortcut> | |
<Description>Code snippet for Foreign Key Creation and Dropping</Description> | |
<Author>William Wegerson</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
This file contains 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
private void MouseWheelScroll(object sender, MouseWheelEventArgs e) | |
{ | |
if (Keyboard.Modifiers != ModifierKeys.Control) | |
return; | |
var delta = (e.Delta > 0) ? 2 : -2; | |
var change = VM.MainFontSize + delta; | |
if (change < 8) | |
change = 8; | |
VM.MainFontSize = change; | |
} |
This file contains 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
private void DNDEnter(object sender, DragEventArgs e) | |
{ | |
if (!e.Data.GetDataPresent(DataFormats.FileDrop) || | |
sender == e.Source) | |
{ | |
e.Effects = DragDropEffects.None; | |
} | |
} | |
private void DNDFeedback(object sender, GiveFeedbackEventArgs e) |
This file contains 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 MRU | |
{ | |
public string Name { get; set; } | |
public string Address { get; set; } | |
public string Data { get; set; } | |
public bool IsValid => !string.IsNullOrWhiteSpace(Name); | |
public bool IsFile => !string.IsNullOrWhiteSpace(Address); |
This file contains 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
<Window.Resources> | |
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" /> <!-- System.Windows.Controls. --> | |
</Windown.Resources> | |
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="auto" /> | |
<RowDefinition Height="200*" /> | |
<RowDefinition Height="auto" /> | |
</Grid.RowDefinitions> |
This file contains 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
<Window.Resources> | |
<!--Vector Image Attribution: https://materialdesignicons.com/--> | |
<Path x:Key="ChasingCircles" Data="M12,6V9L16,5L12,1V4A8,8 0 0,0 4,12C4,13.57 4.46,15.03 5.24,16.26L6.7,14.8C6.25,13.97 6,13 6,12A6,6 0 0,1 12,6M18.76,7.74L17.3,9.2C17.74,10.04 18,11 18,12A6,6 0 0,1 12,18V15L8,19L12,23V20A8,8 0 0,0 20,12C20,10.43 19.54,8.97 18.76,7.74Z" /> | |
<Style x:Key="ChasingCircleStyle" | |
TargetType="{x:Type Path}"> | |
<Setter Property="Stretch" | |
Value="Uniform" /> | |
<Setter Property="Data" | |
Value="{Binding Data, Source={StaticResource ChasingCircles}}" /> | |
</Style> |
This file contains 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 OperationCommand : ICommand | |
{ | |
#region Variables | |
private Func<object, bool> CanExecuteHandler { get; set; } | |
private Action<object> ExecuteActionHandler { get; set; } | |
public bool InSeparateThread { get; set; } | |
#endregion |
This file contains 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 People : List<Person> { } | |
public class Person | |
{ | |
public string First { get; set; } | |
public string Last { get; set; } | |
public string Phone { get; set; } | |
} |
NewerOlder