StructureTag 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
StructureTag(ITextSnapshot, Nullable<Span>, Nullable<Span>, Nullable<Span>, Nullable<Int32>, String, Boolean, Boolean, Boolean, Object, Object)
建構 IStructureTag的執行個體。
public StructureTag (Microsoft.VisualStudio.Text.ITextSnapshot snapshot, Microsoft.VisualStudio.Text.Span? outliningSpan = default, Microsoft.VisualStudio.Text.Span? headerSpan = default, Microsoft.VisualStudio.Text.Span? guideLineSpan = default, int? guideLineHorizontalAnchor = default, string type = default, bool isCollapsible = false, bool isDefaultCollapsed = false, bool isImplementation = false, object collapsedForm = default, object collapsedHintForm = default);
public StructureTag (Microsoft.VisualStudio.Text.ITextSnapshot snapshot, Microsoft.VisualStudio.Text.Span? outliningSpan, Microsoft.VisualStudio.Text.Span? headerSpan, Microsoft.VisualStudio.Text.Span? guideLineSpan, int? guideLineHorizontalAnchor, string type, bool isCollapsible, bool isDefaultCollapsed, bool isImplementation, object collapsedForm, object collapsedHintForm);
new Microsoft.VisualStudio.Text.Tagging.StructureTag : Microsoft.VisualStudio.Text.ITextSnapshot * Nullable<Microsoft.VisualStudio.Text.Span> * Nullable<Microsoft.VisualStudio.Text.Span> * Nullable<Microsoft.VisualStudio.Text.Span> * Nullable<int> * string * bool * bool * bool * obj * obj -> Microsoft.VisualStudio.Text.Tagging.StructureTag
Public Sub New (snapshot As ITextSnapshot, Optional outliningSpan As Nullable(Of Span) = Nothing, Optional headerSpan As Nullable(Of Span) = Nothing, Optional guideLineSpan As Nullable(Of Span) = Nothing, Optional guideLineHorizontalAnchor As Nullable(Of Integer) = Nothing, Optional type As String = Nothing, Optional isCollapsible As Boolean = false, Optional isDefaultCollapsed As Boolean = false, Optional isImplementation As Boolean = false, Optional collapsedForm As Object = Nothing, Optional collapsedHintForm As Object = Nothing)
Public Sub New (snapshot As ITextSnapshot, outliningSpan As Nullable(Of Span), headerSpan As Nullable(Of Span), guideLineSpan As Nullable(Of Span), guideLineHorizontalAnchor As Nullable(Of Integer), type As String, isCollapsible As Boolean, isDefaultCollapsed As Boolean, isImplementation As Boolean, collapsedForm As Object, collapsedHintForm As Object)
參數
- snapshot
- ITextSnapshot
用來產生這個 StructureTag 的快照集。
擷取繪製參考線水準位移的點。 如果省略此成員,則會透過啟發學習法從 HeaderSpan 和 OutliningSpan 計算。
- type
- String
區塊的結構類型。
- isCollapsible
- Boolean
如果為 true,區塊將會有區塊裝飾。
- isDefaultCollapsed
- Boolean
如果為 true,則預設會折疊區塊。
- isImplementation
- Boolean
定義區塊是否定義函式宣告之後的區域。
- collapsedForm
- Object
當折疊時,區塊會出現窗體。
- collapsedHintForm
- Object
折疊區域工具提示的格式。
備註
StructureTag 提供區塊結構裝飾的明確控制。 這個類別會以隨用隨付原則運作,在該原則中,它可讓您只使用字段子集來建立標籤,但如果字段遺失,則會嘗試從其擁有的信息中猜測遺漏的字段。 最實用的範例是省略 GuideLineSpan 和 GuideLineHorizontalAnchorPoint,讓 API 從 HeaderSpan 和 StatementSpan 縮排中猜測它們。 如果遺漏足夠的資訊,標籤就不會執行任何動作。
適用於
StructureTag(ITextSnapshot, Nullable<Span>, Nullable<Span>, Nullable<Span>, Nullable<Int32>, String, Boolean, Boolean, Boolean, Object, Object, Nullable<Span>)
建構 IStructureTag的執行個體。
public StructureTag (Microsoft.VisualStudio.Text.ITextSnapshot snapshot, Microsoft.VisualStudio.Text.Span? outliningSpan = default, Microsoft.VisualStudio.Text.Span? headerSpan = default, Microsoft.VisualStudio.Text.Span? guideLineSpan = default, int? guideLineHorizontalAnchor = default, string type = default, bool isCollapsible = false, bool isDefaultCollapsed = false, bool isImplementation = false, object collapsedForm = default, object collapsedHintForm = default, Microsoft.VisualStudio.Text.Span? primaryHeaderSpan = default);
new Microsoft.VisualStudio.Text.Tagging.StructureTag : Microsoft.VisualStudio.Text.ITextSnapshot * Nullable<Microsoft.VisualStudio.Text.Span> * Nullable<Microsoft.VisualStudio.Text.Span> * Nullable<Microsoft.VisualStudio.Text.Span> * Nullable<int> * string * bool * bool * bool * obj * obj * Nullable<Microsoft.VisualStudio.Text.Span> -> Microsoft.VisualStudio.Text.Tagging.StructureTag
Public Sub New (snapshot As ITextSnapshot, Optional outliningSpan As Nullable(Of Span) = Nothing, Optional headerSpan As Nullable(Of Span) = Nothing, Optional guideLineSpan As Nullable(Of Span) = Nothing, Optional guideLineHorizontalAnchor As Nullable(Of Integer) = Nothing, Optional type As String = Nothing, Optional isCollapsible As Boolean = false, Optional isDefaultCollapsed As Boolean = false, Optional isImplementation As Boolean = false, Optional collapsedForm As Object = Nothing, Optional collapsedHintForm As Object = Nothing, Optional primaryHeaderSpan As Nullable(Of Span) = Nothing)
參數
- snapshot
- ITextSnapshot
用來產生這個 StructureTag 的快照集。
擷取繪製參考線水準位移的點。 如果省略此成員,則會透過啟發學習法從 HeaderSpan 和 OutliningSpan 計算。
- type
- String
區塊的結構類型。
- isCollapsible
- Boolean
如果為 true,區塊將會有區塊裝飾。
- isDefaultCollapsed
- Boolean
如果為 true,則預設會折疊區塊。
- isImplementation
- Boolean
定義區塊是否定義函式宣告之後的區域。
- collapsedForm
- Object
當折疊時,區塊會出現窗體。
- collapsedHintForm
- Object
折疊區域工具提示的格式。
備註
StructureTag 提供區塊結構裝飾的明確控制。 這個類別會以隨用隨付原則運作,在該原則中,它可讓您只使用字段子集來建立標籤,但如果字段遺失,則會嘗試從其擁有的信息中猜測遺漏的字段。 最實用的範例是省略 GuideLineSpan 和 GuideLineHorizontalAnchorPoint,讓 API 從 HeaderSpan 和 StatementSpan 縮排中猜測它們。 如果遺漏足夠的資訊,標籤就不會執行任何動作。