We're updating the issue view to help you get more done. 

Auto-detect complete interface from composition base classes via a marker interface

Description

When a class implements IHasCompleteInterface<TInterface>, TInterface is registered as a complete interface for that class. IHasCompleteInterface<TInterface> is implemented by the ComposedObject base class (but can also be implemented by user-defined classes).

Complete interfaces are interfaces that comprise members implemented on a target class as well as members added by mixins to that target class. They can be used to access all members on a mixed instance without casting to mixin interfaces. Usually, complete interfaces are (declaratively) declared by applying a CompleteInterfaceAttribute (which specifies the associated target class) to the interface. IHasCompleteInterface<TInterface> can now be used instead of the CompleteInterfaceAttribute to a allow a class to declare its complete interface.

IHasCompleteInterface<TInterface> is automatically taken into account when the declarative mixin configuration is analyzed. When building a mixin configuration using the fluent mixin building APIs (Remotion.Mixins.MixinConfiguration.BuildNew()> and similar), it is not automatically taken into account. Register the interface by hand using Remotion.Mixins.Context.FluentBuilders.ClassContextBuilder.AddCompleteInterface<TInterface>().

IHasCompleteInterface<T> is a marker interface rather than an attribute so that it can be used by generic base classes, especially the ComposedObject class. (It is not possible, though, to have a generic target class with an associated complete interface.)

Assignee

Fabian Schmied

Reporter

Fabian Schmied

Labels

Time tracking

2h

Components

Fix versions

Priority

Normal
Configure