情報: VS2010、DSL ツールキット、C#
ドメイン クラスの 1 つに、いくつかの子要素を追加するカスタム コンストラクターがあります。ダイアグラムが開かれるたびにではなく(コンストラクターを呼び出す)、ドメインクラス要素が作成されたときにのみこれを実行したいので、問題があります
public Entity(Partition partition, params PropertyAssignment[] propertyAssignments)
: base(partition, propertyAssignments)
{
if (SOMETHING_TO_STOP_IT_RUNNING_EACH_TIME)
{
using (Transaction tx = Store.TransactionManager.BeginTransaction("Add Property"))
{
Property property = new Property(partition);
property.Name = "Class";
property.Type = "System.String";
this.Properties.Add(property);
this.Version = "1.0.0.0"; // TODO: Implement Correctly
tx.Commit();
}
}
}