GridCellLengthAttribute 類別
此類別會建立方格窗格中的儲存格大小與 MEF 匯出的關聯。
繼承階層架構
Object
Attribute
Microsoft.VisualStudio.Utilities.SingletonBaseMetadataAttribute
Microsoft.VisualStudio.Text.Editor.GridCellLengthAttribute
命名空間: Microsoft.VisualStudio.Text.Editor
組件: Microsoft.VisualStudio.Text.UI.Wpf (在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)
語法
'宣告
<MetadataAttributeAttribute> _
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple := False)> _
Public NotInheritable Class GridCellLengthAttribute _
Inherits SingletonBaseMetadataAttribute
[MetadataAttributeAttribute]
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class GridCellLengthAttribute : SingletonBaseMetadataAttribute
[MetadataAttributeAttribute]
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Method|AttributeTargets::Property|AttributeTargets::Field, AllowMultiple = false)]
public ref class GridCellLengthAttribute sealed : public SingletonBaseMetadataAttribute
[<Sealed>]
[<MetadataAttributeAttribute>]
[<AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)>]
type GridCellLengthAttribute =
class
inherit SingletonBaseMetadataAttribute
end
public final class GridCellLengthAttribute extends SingletonBaseMetadataAttribute
GridCellLengthAttribute 類型會公開下列成員。
建構函式
名稱 | 描述 | |
---|---|---|
![]() |
GridCellLengthAttribute | 初始化 GridCellLengthAttribute 的新執行個體。 |
回頁首
屬性
名稱 | 描述 | |
---|---|---|
![]() |
GridCellLength | 取得儲存格的長度。 |
![]() |
TypeId | 在衍生類別中實作時,取得這個 Attribute 的唯一識別項。 (繼承自 Attribute)。 |
回頁首
方法
名稱 | 描述 | |
---|---|---|
![]() |
Equals | 基礎架構。 傳回數值,表示這個執行個體是否等於指定的物件。 (繼承自 Attribute)。 |
![]() |
GetHashCode | 傳回這個執行個體的雜湊碼。 (繼承自 Attribute)。 |
![]() |
GetType | 取得目前實例 Type 的屬性。 (繼承自 Object)。 |
![]() |
IsDefaultAttribute | 在衍生類別中覆寫時,表示這個執行個體的值是否為衍生類別的預設值。 (繼承自 Attribute)。 |
![]() |
Match | 在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。 (繼承自 Attribute)。 |
![]() |
ToString | 傳回代表目前物件的字串。 (繼承自 Object)。 |
回頁首
明確介面實作
名稱 | 描述 | |
---|---|---|
![]() ![]() |
System#Runtime#InteropServices#_Attribute#GetIDsOfNames | 將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。 (繼承自 Attribute)。 |
![]() ![]() |
System#Runtime#InteropServices#_Attribute#GetTypeInfo | 擷取物件的型別資訊,可以用來取得介面的型別資訊。 (繼承自 Attribute)。 |
![]() ![]() |
System#Runtime#InteropServices#_Attribute#GetTypeInfoCount | 擷取物件提供的型別資訊介面數目 (0 或 1)。 (繼承自 Attribute)。 |
![]() ![]() |
System#Runtime#InteropServices#_Attribute#Invoke | 提供物件所公開的屬性和方法的存取權。 (繼承自 Attribute)。 |
回頁首
備註
這個屬性的值是消費者,用來決定匯出物件的呈現行為。 呈現行為則與相符 (例如在 WPF 類別中定義的行為 Grid) 的互動GridLength。 這個類別用來結合GridUnitTypeAttribute來建立GridLength中之儲存格Grid。
範例
[Export(typeof(IWpfTextViewMarginProvider))]
[Name(PredefinedMarginNames.VerticalScrollBar)]
[MarginContainer(PredefinedMarginNames.VerticalScrollBarContainerMargin)]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Interactive)]
[GridUnitType(GridUnitType.Pixel)] //this size is expressed as a pixel using the GridCellLength attribute
[GridCellLength(15)] //15 pixels wide
internal sealed class VerticalScrollBarMarginProvider : IWpfTextViewMarginProvider { */ implementation /* }
執行緒安全
這個類型的任何 Public static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員是安全執行緒。