NodeShape.AbsoluteBoundsDomainPropertyId フィールド
AbsoluteBounds ドメイン プロパティを識別するために使用される GUID。
名前空間: Microsoft.VisualStudio.Modeling.Diagrams
アセンブリ: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll 内)
構文
'宣言
Public Shared ReadOnly AbsoluteBoundsDomainPropertyId As Guid
public static readonly Guid AbsoluteBoundsDomainPropertyId
解説
絶対境界の変更に応答するのに ChangeRule でこれを使用します。 変更の規則が規則をトリガー トランザクションの最後の直前のトランザクション内で、通常実行されます。
例
// This rule responds to changes in location and size of MyShape,
// which is declared in DSL Definition.
[RuleOn(typeof(MyShape))]
public sealed class MyShapeMoveRule : ChangeRule
{
public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)
{
MyShape shape = e.ModelElement as MyShape;
if (shape == null) return;
if (shape.Store.InSerializationTransaction) return;
if (!shape.IsNestedChild) return;
if (e.DomainProperty.Id == NodeShape.AbsoluteBoundsDomainPropertyId)
{
shape.ParentShape.NestedChildShapes.Move(shape,
shape.ParentShape.NestedChildShapes.Count - 1);
// this.Diagram.NeedsRenumber should be set after
// re-ordering the child shapes. It should also be
// set after the user invokes Undo or Redo; but
// the rule is not called in Undo or Redo.
// So instead, we will put the NeedsRenumber call
// in an override of OnAbsoluteBoundsChanged, which
// is always called.
}
}
}
// Register the rule.
partial class InstanceDiagramsDomainModel
{
protected override Type[] GetCustomDomainModelTypes()
{
List<Type> types = new List<Type>(base.GetCustomDomainModelTypes());
types.Add(typeof(MyShapeMoveRule));
return types.ToArray();
}
}
partial class MyShape // Declared in DSL Definition
{
// Called even in Undo or Redo.
public override void OnAbsoluteBoundsChanged(AbsoluteBoundsChangedEventArgs e)
{
base.OnAbsoluteBoundsChanged(e);
this.Diagram.NeedsRenumber = true;
}
}
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。
参照
関連項目
Microsoft.VisualStudio.Modeling.Diagrams 名前空間