信息:VS2010、DSL 工具包、C#
我的一个域类上有一个自定义构造函数,它添加了一些子元素。我有一个问题,因为我只希望在创建域类元素时运行它,而不是每次打开图表时(调用构造函数)
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();
}
}
}