"景先生毕设|www.jxszl.com

C# ArrayContainer类代码示例

2023-12-29 17:05编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中ArrayContainer类的典型用法代码示例。如果您正苦于以下问题:C#ArrayContainer类的具体用法?C#ArrayContainer怎么用?C#ArrayContainer使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:ArrayToIList // //Fromaone-dimensionalarray-typeS[]toSystem.Collections.IListandbase //interfacesofthisinterface,providedthereisanimplicitreferenceconversion //fromStoT. // staticboolArrayToIList(ArrayContainerarray,TypeSpeclist,boolisExplicit) { if(array.Rank!=1||!list.IsGeneric) returnfalse; varopen_version=list.GetDefinition(); if((open_version!=TypeManager.generic_ilist_type)&& (open_version!=TypeManager.generic_icollection_type)&& (open_version!=TypeManager.generic_ienumerable_type)) returnfalse; vararg_type=list.TypeArguments[0]; if(array.Element==arg_type) returntrue; if(isExplicit) returnExplicitReferenceConversionExists(array.Element,arg_type); if(MyEmptyExpr==null) MyEmptyExpr=newEmptyExpression(array.Element); else MyEmptyExpr.SetType(array.Element); returnImplicitReferenceConversionExists(MyEmptyExpr,arg_type); }
原文链接:http://www.jxszl.com/biancheng/C/556573.html