Skip to content

Instantly share code, notes, and snippets.

@weitzhandler
weitzhandler / IdentityStores.cs
Last active July 5, 2017 15:49
Microsoft.AspNetCore.Identity.EntityFramework
using System;
using System.Data.Entity;
using System.Threading;
using System.Threading.Tasks;
using static Microsoft.AspNetCore.Identity.EntityFramework.BaseMethodWrapper;
namespace Microsoft.AspNetCore.Identity.EntityFramework
{
public interface IKeyConverter<TKey>
{
@weitzhandler
weitzhandler / DeviceTimer.cs
Last active July 23, 2017 19:41
Device.Timer wrapper for Xamarin with Prism DI support
using System;
using System.Linq;
using System.Collections.Generic;
using Prism.Services;
namespace Xamarin.Forms
{
public class DeviceTimer
{
readonly Action _Task;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Reflection;
namespace System.Collections.Specialized
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace TrackableEntities.Client
{
namespace Xamarin.Forms
{
public class AutoSizeBehavior : Behavior<ListView>
{
ListView _ListView;
protected override void OnAttachedTo(ListView bindable)
{
_ListView = bindable;
bindable.HeightRequest = 0;
namespace System.Collections.ObjectModel
{
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
@weitzhandler
weitzhandler / MultiValueDictionary.cs
Last active September 17, 2021 14:23
MultiValueDictionary<TKey, TValue>
namespace System.Collections.ObjectModel
{
using System.Collections.Generic;
using System.Linq;
public class MultiValueDictionary<TKey, TElement>
: Collection<TElement>, ILookup<TKey, TElement>
{
public MultiValueDictionary(Func<TElement, TKey> keyExtractor)
: base(new Collection(keyExtractor))
// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using ReactiveUI;
@weitzhandler
weitzhandler / ColumnReference.cs
Last active November 27, 2019 15:52
ColumnReference - easy way to convert between Excel column index and column letter
internal struct ColumnReference
{
readonly uint _ColumnIndex;
const int AsciiTrim = 'A' - 1;
const int LastChar = 'Z' - AsciiTrim;
ColumnReference(uint columnIndex)
{
_ColumnIndex = columnIndex;
}
namespace System.Windows.Controls
{
using System;
using System.Collections;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Controls;