我有代表
delegate string Mathop<T,F>(T a,F b);
我宣布这样的事件。
event Mathop<T,F> someevent;
但是,我在这里正遇到一个错误。 它说,T无法找到。 我想请我的<代码>Mathop代表作为我的活动的执行者开展工作。
我在这里做的是错的。
我有代表
delegate string Mathop<T,F>(T a,F b);
我宣布这样的事件。
event Mathop<T,F> someevent;
但是,我在这里正遇到一个错误。 它说,T无法找到。 我想请我的<代码>Mathop代表作为我的活动的执行者开展工作。
我在这里做的是错的。
您需要将活动列入一类参数,例如:
class C<T, F>
{
event Mathop<T, F> someevent;
}
你可以赞同一个没有界定具体类型的活动——想象你能够这样做——只要有两个参数并返回一个str!
有了上述法典,你现在就应该能够做这样的事情。
new C<Int32, Int32>().someevent += MyMethod
密瑟德签署
String MyMethod(Int32 a, Int32 b);
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...