コード例 #1
0
ファイル: CastConverter.cs プロジェクト: luozhiping1987/dot42
        private static string GetCollectionConvertMethodName(XTypeReference targetType)
        {
            if (targetType.IsSystemCollectionsIEnumerable())
            {
                return("Enumerable");
            }
            if (targetType.IsSystemCollectionsIEnumerableT())
            {
                return("EnumerableOfObject");
            }
            if (targetType.IsSystemCollectionsICollection())
            {
                return("Collection");
            }
            if (targetType.IsSystemCollectionsICollectionT())
            {
                return("CollectionOfObject");
            }
            if (targetType.IsSystemCollectionsIList())
            {
                return("List");
            }
            if (targetType.IsSystemCollectionsIListT())
            {
                return("ListOfObject");
            }

            return(null);
        }