private IList CreateItemsSource() { IList list = null; if (ItemsSourceType != null) { ConstructorInfo constructor = ItemsSourceType.GetConstructor(Type.EmptyTypes); list = (IList)constructor.Invoke(null); } return(list); }
private IEnumerable CreateItemsSource() { IEnumerable collection = null; if (ItemsSourceType != null) { var constructor = ItemsSourceType.GetConstructor(Type.EmptyTypes); if (constructor != null) { collection = (IEnumerable)constructor.Invoke(null); } } return(collection); }
private IList CreateItemsSource() { IList list = null; if (ItemsSourceType != null && !ItemsSourceType.IsArray) { ConstructorInfo constructor = ItemsSourceType.GetConstructor(Type.EmptyTypes); list = (IList)constructor.Invoke(null); } else if (ItemsSourceType != null) { list = new ArrayList(); } return(list); }
private IEnumerable CreateItemsSource() { IEnumerable collection = null; if (ItemsSourceType != null) { var constructor = ItemsSourceType.GetConstructor(Type.EmptyTypes); if (constructor != null) { collection = ( IEnumerable )constructor.Invoke(null); } else if (ItemsSourceType.IsArray) { collection = Array.CreateInstance(ItemsSourceType.GetElementType(), Items.Count); } } return(collection); }