English 中文(简体)
哪一类参数既接受清单,又接受数据检索,既可编入索引,又可编号?
原标题:what type of parameter accepts both List and DataRowCollection and is both indexable and numberable?

我想写一个参数,接受<代码>List<T>和DataRowCollection,作为价值,既可索引又可编号,但我不知道如何做到这一点。 是否可利用现有的班级和接口?

附录

问题回答

您不能具体说明诸如<代码>T>的一类制约因素:[],没有索引人财产的通用接口。 <代码>List and DataRowCollection both are IE amountable and ICollection,但我假定,ttt=已使你受益很多。 因此,不可能具体指明“A类需要是一种指数化收集”。

<>Update: 我刚刚看到,<代码>DataRowCollection有一个<代码>List,将收集工作作为<代码>ArrayList,该编码为。 因此,假定你想写一种延伸方法,你可以将其定为<代码>。 IList

<>Update 2 另一种选择:您可针对< 编码>IE 计数,并使用LinqElementAt(。 无法确定它是否将使用<代码>DataRowCollection的索引财产。

http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx” rel=“nofollow”List<T>DataRowlection/code><><>/code><<>>>>> 执行 因此,你可以根据这种方法需要做些什么加以利用。





相关问题
Anyone feel like passing it forward?

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. ...

NSArray s, Primitive types and Boxing Oh My!

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 ...

C# Marshal / Pinvoke CBitmap?

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 ...

How to Use Ghostscript DLL to convert PDF to PDF/A

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, ...

Linqy no matchy

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. ...