Here is a sample from my model.
I have two Rules
[RuleOn(typeof(Connector), FireTime = TimeToFire.TopLevelCommit)] public sealed class MyAddRule : AddRule { public override void ElementAdded(ElementAddedEventArgs e) { if (e == null) throw new ArgumentNullException("e"); } }
[RuleOn(typeof(ElementShape), FireTime = TimeToFire.TopLevelCommit)] public sealed class ElementShapeAddRule : AddRule { public override void ElementAdded(ElementAddedEventArgs e) { if (e == null) throw new ArgumentNullException("e"); } }
And here is a way how to add them to a model
public partial class SwitchboardDomainModel { protected override Type[] GetCustomDomainModelTypes() { return new System.Type[] { typeof(MyAddRule), typeof(ElementShapeAddRule) }; } }
Ivana
|