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 work done by Acehigh | |
// Modified by Jon de Nor | |
const callback = (html, event) => ({ | |
value: html.find('input').val() || '0', | |
action: event?.currentTarget.dataset.button ?? 'normal', | |
}); | |
const buttons = { | |
dblbane: { label: "Double Bane", callback }, |
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
Console.WriteLine("Starting on thread ".PadLeft(26) + Thread.CurrentThread.ManagedThreadId.ToString()); | |
Func<Unit> writeLineAndReturnUnit = () => | |
{ | |
Console.WriteLine($"Inside Return on thread ".PadLeft(26) + Thread.CurrentThread.ManagedThreadId.ToString()); | |
return Unit.Default; | |
}; | |
Observable.Return(writeLineAndReturnUnit(), TaskPoolScheduler.Default) | |
.Do(_ => Console.WriteLine("Passing through on thread ".PadLeft(26) + Thread.CurrentThread.ManagedThreadId.ToString())) | |
.Subscribe(_ => Console.WriteLine($"Received on thread ".PadLeft(26) + Thread.CurrentThread.ManagedThreadId)); |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
namespace SupportTool.Controls | |
{ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>Property with INPC</Title> | |
<Author>Jon Stødle</Author> | |
<Description>Inserts a property which implements INotifyPropertyChanged</Description> |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Windows.Foundation; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
namespace KodeFisk.Panels |
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
protected override Size ArrangeOverride(Size finalSize) | |
{ | |
var posY = 0d; | |
var currentRow = new List<UIElement>(); | |
var rowHeight = 0d; | |
foreach (var child in Children) | |
{ | |
if (currentRow.Sum(x => x.DesiredSize.Width) + child.DesiredSize.Width <= finalSize.Width) |
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
protected override Size MeasureOverride(Size availableSize) | |
{ | |
var finalSize = new Size { Width = availableSize.Width }; | |
var rowHeight = 0d; | |
var posX = 0d; | |
foreach (var child in Children) | |
{ | |
child.Measure(availableSize); |
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.Collections.Generic; | |
using System.Linq; | |
using Windows.Foundation; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
namespace KodeFisk | |
{ | |
public class AutoUniformWidthWrapPanel : Panel |
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 Windows.Foundation; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
namespace KodeFisk | |
{ | |
public class UniformWidthWrapPanel : Panel | |
{ | |
public UniformWidthWrapPanel() |
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
protected override Size ArrangeOverride(Size finalSize) | |
{ | |
var columnWidth = finalSize.Width / MaximumColumns; | |
var posY = 0d; | |
var rowHeight = 0d; | |
var rowChildCount = 0; | |
foreach (var child in Children) | |
{ | |
if (rowChildCount >= MaximumColumns) |
NewerOlder