Sdílet prostřednictvím


NodeShape.AbsoluteBoundsDomainPropertyId – pole

Identifikátor GUID pro identifikaci vlastnost domain AbsoluteBounds.

Obor názvů:  Microsoft.VisualStudio.Modeling.Diagrams
Sestavení:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (v Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll)

Syntaxe

'Deklarace
Public Shared ReadOnly AbsoluteBoundsDomainPropertyId As Guid
public static readonly Guid AbsoluteBoundsDomainPropertyId

Poznámky

Použijte v ChangeRule reagovat na změny v absolutní hranice.Změnit pravidlo provádí uvnitř transakce, která aktivovala pravidlo, obvykle těsně před koncem transakce.

Příklady

  // 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;
    }
  }

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

NodeShape Třída

Microsoft.VisualStudio.Modeling.Diagrams – obor názvů

Další zdroje

Reagovat na a šíření změn