Example #1
0
        protected override void OnCompleteTypeSet(
            ICompletionContext context,
            UnionTypeDefinition definition,
            ISet <ObjectType> typeSet)
        {
            base.OnCompleteTypeSet(context, definition, typeSet);

            Type markerType = definition.ClrType;

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