GetTypes() public static method

public static GetTypes ( this assembly ) : IEnumerable
assembly this
return IEnumerable
Ejemplo n.º 1
0
        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="shapeRepo"></param>
        public AddShapeViewModel(IShapesRepository shapeRepo)
        {
            //get all types that implement IShape
            ShapeTypes =
                ReflectionExtensions.GetTypes(typeof(IShape).GetTypeInfo().Assembly)
                .Where(t => ReflectionExtensions.IsAssignableFrom(typeof(IShape), t) && t != typeof(IShape))
                .ToList();

            _ShapeRepo      = shapeRepo;
            AddShapeCommand = new MvxCommand <Type>(AddShape);
            CancelCommand   = new MvxCommand(Cancel);
        }