public delegate void somedelegate(int somevariable);
public static void somefunction(int somevariable)
Console.WriteLine("somevalue: {0}", somevariable);
public struct somestructone
public somedelegate somedelegate;
public static void Main(string[] args)
var @delegate = Delegate.CreateDelegate(typeof(somedelegate), typeof(someclass).GetMethod("somefunction"));
var somestructoneinstance = new somestructone();
var field = typeof(somestructone).GetField("somedelegate");
field.SetValue(somestructoneinstance, @delegate);
Console.WriteLine(somestructoneinstance.somedelegate == null);