Decorator 類別

在衍生類別中覆寫時,則其所代表的裝飾的項目,在圖表中。

繼承階層架構

System.Object
  Microsoft.VisualStudio.Modeling.Diagrams.Decorator
    Microsoft.VisualStudio.Modeling.Diagrams.ConnectorDecorator
    Microsoft.VisualStudio.Modeling.Diagrams.ShapeDecorator

命名空間:  Microsoft.VisualStudio.Modeling.Diagrams
組件:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll 中)

語法

'宣告
Public MustInherit Class Decorator
public abstract class Decorator

Decorator 型別會公開下列成員。

建構函式

  名稱 說明
受保護的方法 Decorator(ShapeField, PointD) 初始化 Decorator 類別的新執行個體。
受保護的方法 Decorator(ShapeField, PointD, Boolean) 建構新的裝飾。

回頁首

屬性

  名稱 說明
公用屬性 CanMove 是否可以移動這個裝飾。只有當它以可移動具現化,而且也需要主應用程式,就可以移動裝飾。
受保護的屬性 DecoratorAnchorMargins 取得欄位周圍的邊界。裝飾可以將本身附加到此區域中的欄位。
公用屬性 Field 取得指派給裝飾的欄位。
公用屬性 Offset 取得或設定裝飾的預設位置會修改的位移。
公用屬性 RequiresHost 取得裝飾,並驗證它與圖形之間的位置是否需要在主圖形。

回頁首

方法

  名稱 說明
公用方法 AssociateValueWith(Store, AssociatedPropertyInfo) 關聯指派給圖形的存放區屬性裝飾。
公用方法 AssociateValueWith(Store, Guid) 關聯指派給圖形的存放區屬性裝飾。
公用方法 AssociateValueWith(Store, Guid, AssociatedPropertyInfo) 關聯指派給圖形的存放區屬性裝飾。
公用方法 AssociateVisibilityWith(Store, AssociatedPropertyInfo) 關聯指派給圖形的存放區屬性裝飾的可見性。
公用方法 AssociateVisibilityWith(Store, Guid) 關聯指派給圖形的存放區屬性裝飾的可見性。
公用方法 AssociateVisibilityWith(Store, Guid, AssociatedPropertyInfo) 關聯指派給圖形的存放區屬性裝飾的可見性。
公用方法 ConfigureHostShape 建立主圖形或設定現有的主圖形。
公用方法 Equals 判斷指定的物件是否等於目前物件。 (繼承自 Object)。
受保護的方法 Finalize 允許物件在記憶體回收進行回收之前,嘗試釋放資源並執行其他清除作業。 (繼承自 Object)。
公用方法 GetHashCode 做為特定型別的雜湊函式。 (繼承自 Object)。
公用方法 GetHostShape 取得主應用程式圖案。
公用方法 GetType 取得目前執行個體的 Type。 (繼承自 Object)。
公用方法 GetValue 取得裝飾與圖形之間的關聯。
公用方法 GetVisible 取得指派給圖形裝飾的可見性。
受保護的方法 MemberwiseClone 建立目前 Object 的淺層複本 (Shallow Copy)。 (繼承自 Object)。
受保護的方法 OnAfterOffsetChanged 可讓衍生的類別修改裝飾之後已變更的位移。
公用方法 RepositionHostShape 主圖形會重新調整位置並設定它的可見性。
公用方法 SetValue 設定關聯的圖案和裝飾。
公用方法 SetVisible 設定裝飾器指派給圖形的可見性。
公用方法 ToString 傳回表示目前物件的字串。 (繼承自 Object)。
公用方法 UpdateDecoratorHostShapes(ModelElement) 更新主圖形的範圍。
公用方法 UpdateDecoratorHostShapes(ModelElement, Guid) 更新主圖形的範圍。
公用方法 UpdateHostShapeVisibility 更新主圖形的可見性。

回頁首

備註

要將它們格式化圖表中的其他項目周圍包裝裝飾。

若要保證內部裝飾沒有重疊,應該鎖定這些圖表。若要錨定裝飾,請先覆寫[InitializeShapeFields]來呼叫基底。然後使用[FindShapeField]找不到您要套用的裝飾,並接著呼叫適當的鎖定方法 shape 功能變數。

範例

在下列範例中,名稱裝飾錨定至 Name2 裝飾的右側。

partial class WizardPageShape
{
    protected override void  InitializeShapeFields(IList<Microsoft.VisualStudio.Modeling.Diagrams.ShapeField> shapeFields)
        {
            base.InitializeShapeFields(shapeFields);
            ShapeField name = ShapeElement.FindShapeField(shapeFields, "Name");
            ShapeField name2 = ShapeElement.FindShapeField(shapeFields, "Name2");
            name.AnchoringBehavior.SetLeftAnchor(name2, AnchoringBehavior.Edge.Right, 0.01);
        }
}

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。不保證任何執行個體成員是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.Modeling.Diagrams 命名空間