Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# create delegate type at runtime

var tArgs = new List<Type>();
foreach (var param in method.GetParameters())
    tArgs.Add(param.ParameterType);
tArgs.Add(method.ReturnType);
var delDecltype = Expression.GetDelegateType(tArgs.ToArray());
return Delegate.CreateDelegate(delDecltype, method);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #delegate #type #runtime
ADD COMMENT
Topic
Name
7+3 =