Exemplo n.º 1
0
        protected override void OnCompleteTypeSet(
            ITypeCompletionContext context,
            UnionTypeDefinition definition,
            ISet <ObjectType> typeSet)
        {
            base.OnCompleteTypeSet(context, definition, typeSet);

            Type markerType = definition.RuntimeType;

            if (markerType != typeof(object))
            {
                foreach (ObjectType type in context.GetTypes <ObjectType>())
                {
                    if (type.RuntimeType != typeof(object) &&
                        markerType.IsAssignableFrom(type.RuntimeType))
                    {
                        typeSet.Add(type);
                    }
                }
            }
        }