Skip to content

Instantly share code, notes, and snippets.

View mconnew's full-sized avatar

Matt Connew mconnew

View GitHub Profile
@mconnew
mconnew / GenericHashTable.cs
Created November 15, 2022 21:38
Generic Hashtable implementation which implements IDictionary<TKey, TValue>
internal class GenericHashTable<TKey, TValue> : IDictionary<TKey, TValue>
{
private Hashtable _hashtable;
public GenericHashTable()
{
_hashtable = Hashtable.Synchronized(new Hashtable());
}
public TValue this[TKey key] {
get
@mconnew
mconnew / Resources.txt
Created November 14, 2020 01:02
IdentityModel String Resources
;=================================================================
; User Interface Message strings
;=================================================================
SspiLoginPromptHeaderMessage=Login with your credentials.
;==================================================================
; Argument range exceptions
;==================================================================
ValueMustBeNonNegative=The value of this argument must be non-negative.
ValueMustBeInRange=The value of this argument must fall within the range {0} to {1}.
ValueMustBeOne=The value of this argument must be 1.
@mconnew
mconnew / gist:77f609186b88614d4f3b1bff503c8ab2
Last active August 27, 2020 22:05
COREWCF FEATURE PRIORITIES
Bindings
• BasicHttpBinding / BasicHttpsBinding
• WsHttpBinding
• NetTcpBinding
• NetNamedPipeBinding
• NetMsmqBinding (Flexibility of any cloud service provided queues)
• WSFederationHttpBinding
* UdpBinding
• WebHttpBinding
Message Exchange
static void Main(string[] args)
{
var client = new SimpleServiceClient();
client.OpenAsync().GetAwaiter().GetResult();
client.DelayedResponseAsync(2000).GetAwaiter().GetResult();
var channel = client.InnerChannel;
var httpChannelFactory = client.InnerChannel.GetProperty<IChannelFactory>();
var cacheField = httpChannelFactory.GetType().GetField("_httpClientCache", BindingFlags.NonPublic | BindingFlags.Instance);
var httpClientCache = cacheField.GetValue(httpChannelFactory);
var cacheDictionaryField = httpClientCache.GetType().GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance);