Ejemplo n.º 1
0
        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);
        }