Welcome to MSDN Blogs Sign in | Join | Help

Richard Cook

How VSTO will change your life (for the better, that is)

Browse by Tags

All Tags » Code   (RSS)
Multimethods in C# revisited - MultimethodFactory.cs
/// <summary> /// Generates multimethods corresponding to the specified method signature. /// </summary> /// <typeparam name="T"> Type of delegate specifying method signature </typeparam> public sealed class MultimethodFactory Read More...
Multiple dispatch in C# - MultimethodFactory class
using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; internal abstract class MultimethodFactory { private enum ParameterKind { In, Out, Ref } private sealed class Dispatcher { private readonly Delegate _function; Read More...
Multimethods in C#
I read a couple of interesting articles on the subject of multiple dispatch last night. The first, entitled Visitor Pattern Considered Useless , starts by describing the visitor design pattern with particular emphasis on how it can enable the definition Read More...
Dump out all installed products and components
Windows Installer APIs tamed in managed code: use this to dump out a list of all installed product codes and component IDs. Quick and easy. Good night everybody! Read More...
STL functors, scoped handles and how we can use them in Windows programming - example of usage
#include "stdafx.h" #include <iostream> #include "scoped_handle.h" using namespace std; // Implementation of "countof" obtained from http://blogs.msdn.com/the1/archive/2004/05/07/128242.aspx template < typename T, size_t N> char (&_ArraySizeHelper(T Read More...
STL functors, scoped handles and how we can use them in Windows programming - scoped_handle
#pragma once #include <memory> #include <cassert> template < typename HANDLE_TYPE, HANDLE_TYPE UNDEFINED_VALUE> class scoped_handle { private : class invoker_base { public : virtual ~invoker_base() {} public : virtual void invoke(HANDLE_TYPE Read More...
IConnectionPoint and .NET or: How I Learned to Stop Worrying and Love Managed Event Sinks (part 1): Sample 3
Sample 3 using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text; using System.Threading; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; Read More...
IConnectionPoint and .NET or: How I Learned to Stop Worrying and Love Managed Event Sinks (part 1): Sample 2
Sample 2 using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices.ComTypes; using System.Text; using System.Threading; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; using Office Read More...
IConnectionPoint and .NET or: How I Learned to Stop Worrying and Love Managed Event Sinks (part 1): Sample 1
Sample 1 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; using Office = Microsoft.Office.Core; namespace Sample1 { Read More...
Page view tracker