共用方式為


ElementOperations 類別

提供一群模型元素上執行動作的一般作業。

繼承階層架構

System.Object
  Microsoft.VisualStudio.Modeling.ElementOperations
    Microsoft.VisualStudio.Modeling.Diagrams.DesignSurfaceElementOperations

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

語法

'宣告
Public Class ElementOperations
public class ElementOperations

ElementOperations 型別會公開下列成員。

建構函式

  名稱 說明
受保護的方法 ElementOperations(IServiceProvider) 初始化 ElementOperations 類別的新執行個體。
公用方法 ElementOperations(IServiceProvider, Partition) 初始化 ElementOperations 類別的新執行個體。
公用方法 ElementOperations(IServiceProvider, Store) 已過時。初始化 ElementOperations 類別的新執行個體。

回頁首

屬性

  名稱 說明
受保護的屬性 Partition
受保護的屬性 ServiceProvider
受保護的屬性 Store

回頁首

方法

  名稱 說明
受保護的方法 AddCustomFormat 加入指定的 IDataObject 使用指定的 ModelElements 集合中的一或多個自訂的資料格式。
受保護的方法 AddElementGroupFormat(IDataObject, ICollection<ModelElement>, ClosureType) 加入指定的 IDataObject 使用指定的 ModelElements 集合中的 ElementGroupPrototype 格式。這個方法會呼叫下列 3 可覆寫的方法 (依順序)。CreateElementGroup b。MarkRootElements c。CreateElementGroupPrototype It 再 stashes 建立的 ElementGroupPrototype 中的資料參數。
受保護的方法 AddElementGroupFormat(IDataObject, ICollection<ModelElement>, ClosureType, Boolean) 加入指定的 IDataObject 使用指定的 ModelElements 集合中的 ElementGroupPrototype 格式。可呼叫從衍生的類別,以強制要求載入的項目連結,以建立模型項目的集合。
受保護的方法 CanAddCustomFormat 傳回值,指出 ModelElement 集合可用來建立自訂的格式。
受保護的方法 CanAddElementGroupFormat 傳回值,指出 ModelElement 集合可用來建立以 ElementGroupPrototype 格式。
公用方法 CanCopy(ICollection<ModelElement>) 取得值,指出是否可以將 ModelElements 的集合複製到 IDataObject。
公用方法 CanCopy(ICollection<ModelElement>, ClosureType) 取得值,指出是否可以將 ModelElements 的集合複製到 IDataObject。呼叫以進行作業的 CanCopyCore。
受保護的方法 CanCopyCore 取得值,指出是否可以將 ModelElements 的集合複製到 IDataObject。
公用方法 CanDelete(ModelElement, array<Guid[]) 查詢是否可以刪除指定的項目,納入考量任何 IMS 鎖定適用於任何項目中刪除關閉的項目。
公用方法 CanDelete(IEnumerable<ModelElement>, array<Guid[]) 查詢是否可以刪除指定的一組項目,鎖定適用於任何在完整的項目納入考量任何 IMS 刪除結案的項目。
公用方法 CanMerge 傳回值,指出是否可以合併來自 IDataObject ElementGroupPrototype (也就是貼上或卸除) 插入 ModelElement 的目標。
公用方法 CanMergeElementGroupPrototype(ModelElement, ElementGroupPrototype) 傳回值,指出是否可以執行 MergeElementGroupPrototype。
受保護的方法 CanMergeElementGroupPrototype(ModelElement, ProtoElementBase, ElementGroupPrototype) 取得值,指出是否可以指定特定的升降機和項目群組原型執行 MergeElementGroupPrototype。
公用方法 CanMove 取得值,指出是否可移動的 ModelElements 集合。
公用方法 ChooseMergeTarget(ModelElement, ElementGroup) 指定建議的 targetElement 合併,取得目標項目。根據預設,這個方法會提供目標項目有機會變更預期的目標。
公用方法 ChooseMergeTarget(ModelElement, ElementGroupPrototype) 指定建議的 targetElement 合併,取得目標項目。這讓 ElementOperations 有機會變更預期的目標,進行合併。根據預設,這個方法會提供目標項目有機會變更預期的目標。
公用方法 Copy(IDataObject, ICollection<ModelElement>) 將 ModelElements 的集合複製到指定的 IDataObject 一或多個資料格式。
公用方法 Copy(IDataObject, ICollection<ModelElement>, ClosureType) 將 ModelElements 的集合複製到指定的 IDataObject 一或多個資料格式。
公用方法 Copy(IDataObject, ICollection<ModelElement>, PointF) 將 ModelElements 的集合複製到指定的 IDataObject 一或多個資料格式。
公用方法 Copy(IDataObject, ICollection<ModelElement>, ClosureType, PointF) 將 ModelElements 的集合複製到指定的 IDataObject 一或多個資料格式。
受保護的方法 CreateElementGroup 會建立 ClosureElementGroup
受保護的方法 CreateElementGroupPrototype
公用方法 Equals 判斷指定的物件是否等於目前物件。 (繼承自 Object)。
受保護的方法 Finalize 允許物件在記憶體回收進行回收之前,嘗試釋放資源並執行其他清除作業。 (繼承自 Object)。
公用方法靜態成員 GetClipboardDataObject 傳回 IDataObject 從剪貼簿如果其中包含我們的 ElementGroupPrototype 格式,否則為 null。
公用方法靜態成員 GetElementGroupPrototype 如果有的話,則請從資料物件中取得 ElementGroupPrototype。
公用方法 GetHashCode 做為特定型別的雜湊函式。 (繼承自 Object)。
受保護的方法靜態成員 GetModelingToolboxItemDisplayName 如果 IDataObject 包含 ModelingToolboxItem,這會傳回其顯示名稱,否則為 null。
公用方法 GetType 取得目前執行個體的 Type。 (繼承自 Object)。
公用方法靜態成員 IsElementGroupPrototypeFormatAvailable 如果 ElementGroupPrototype 剪貼簿格式並出現在 [剪貼簿],否則為 false,則傳回 true。
受保護的方法 MarkRootElements ElementGroup 參數中的標記 RootElements。
受保護的方法 MemberwiseClone 建立目前 Object 的淺層複本 (Shallow Copy)。 (繼承自 Object)。
公用方法 Merge 合併 (也就是貼上或垂直距離) 從 IDataObject ElementGroupPrototype,ModelElement 的目標。
公用方法 MergeElementGroup 合併來源 ElementGroup 與 ModelElement 指定的目標。
公用方法 MergeElementGroupPrototype 合併來源 ElementGroupPrototype 與 ModelElement 指定的目標。
受保護的方法 OnElementsReconstituted ElementGroupPrototype 中的項目已還原之後,但在之前在連線到其他的模型,請立即呼叫 MergeElementGroupPrototype。
受保護的方法 OnMerged 由 MergeElementGroupPrototype 前,立即呼叫本機交易被認可。規則在本機的交易排入佇列,以及交易認可時引發。本機交易包裝 reconstituting,並連接項目。
受保護的方法 OnMerging 目標項目已選擇立即之後,但在 ElementGroupPrototype 中的項目已重新建置之前呼叫 MergeElementGroupPrototype。
受保護的方法 PropagateElementGroupContextToTransaction 傳播存在於目前作用中的最上層交易中的項目群組的內容。
公用方法 ToString 傳回表示目前物件的字串。 (繼承自 Object)。

回頁首

事件

  名稱 說明
公用事件 ElementsReconstituted ElementGroupPrototype 中的項目已還原之後,但在之前在連線到其他的模型,請立即呼叫 MergeElementGroupPrototype。
公用事件 Merged 由 MergeElementGroupPrototype 前,立即呼叫本機交易被認可。規則在本機的交易排入佇列,以及交易認可時引發。本機交易包裝 reconstituting,並連接項目。
公用事件 Merging 目標項目已選擇立即之後,但在 ElementGroupPrototype 中的項目已重新建置之前呼叫 MergeElementGroupPrototype。

回頁首

備註

衍生自這個類別建立自訂的資料格式進行複製和貼上作業。 在您圖表的類別中覆寫ElementOperations傳回的執行個體您ElementOperations子類別。 您應該會傳回相同的執行個體,在每個呼叫。

如需詳細資訊,請參閱 HOW TO:程式複製和貼上行為 - 重新導向

範例

using Microsoft.VisualStudio.Modeling;
using Microsoft.VisualStudio.Modeling.Diagrams;
using Microsoft.VisualStudio.Modeling.Diagrams.ExtensionEnablement;

  public partial class MyDslDiagram
  {
    public override DesignSurfaceElementOperations ElementOperations
    {
      get
      {
        if (this.elementOperations == null)
        {
          this.elementOperations = new MyElementOperations(this.Store as IServiceProvider, this);
        }
        return this.elementOperations;
      }
    }
    private MyElementOperations elementOperations = null;
  }

  public class MyElementOperations : DesignSurfaceElementOperations
  {
    public MyElementOperations(IServiceProvider serviceProvider, MyDslDiagram diagram)
      : base(serviceProvider, diagram)
    { }
    // Overridden methods follow
  }

執行緒安全

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

請參閱

參考

Microsoft.VisualStudio.Modeling 命名空間