Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 2.17 KB

File metadata and controls

51 lines (36 loc) · 2.17 KB

ConsistencyCheckExtension<TCheckedStructure> class

Base class for an extension that introduces new consistency errors (warnings) for specific model elements.

public abstract class ConsistencyCheckExtension<TCheckedStructure> : ExtensionBase
    where TCheckedStructure : IStructure
parameter description
TCheckedStructure Type of the IStructure to check.

Public Members

name description
abstract Check(…) Should be overriden in a derived class to perform consistency checks for a TCheckedStructure.

Protected Members

name description
ConsistencyCheckExtension() The default constructor.

Remarks

Consistency check extensions are loaded in Studio Pro and MxBuild and hence must not use any gui-specific APIs, like UI. Note that the consistency check process can be interrupted and restarted at any point. It also can also be split across multiple threads, or multiple check processes can be ran simultaneously (on the same or different threads). Avoid holding any state in your ConsistencyCheckExtension implementation. Extension must be marked with ExportAttribute as [Export(typeof(ConsistencyCheckExtension<>))], otherwise it will not be loaded.

Examples

You can implement extension as following:

[Export(typeof(ConsistencyCheckExtension<>))]
public class MyExtension : ConsistencyCheckExtension<IEntity>
{
    public override IEnumerable<ConsistencyError> Check(IEntity entity, IModel model)
    {
        // returns any consistency errors for the entity
    }
}

See Also