Class Snippet
- Namespace
- GtkSource
- Assembly
- GtkSource-5.dll
public class Snippet : Object, IDisposable, NativeObject, GTypeProvider, InstanceFactory
- Inheritance
-
Snippet
- Implements
- Inherited Members
Constructors
Snippet(params ConstructArgument[])
[Obsolete("Regular C# constructors on native classes will be removed in a future version. Please see the linked documentation for more details. It contains scenarios and possible solutions to prepare for the upcoming changes.", DiagnosticId = "GirCore1007", UrlFormat = "https://gircore.github.io/docs/integration/diagnostic/1007.html")]
public Snippet(params ConstructArgument[] constructArguments)
Parameters
constructArgumentsConstructArgument[]
Snippet(CreationData)
[Obsolete("This constructor is a workaround to keep legacy APIs alive. Do not use it.")]
protected Snippet(CreationData data)
Parameters
dataCreationData
Snippet(SnippetHandle)
protected Snippet(SnippetHandle handle)
Parameters
handleSnippetHandle
Fields
BufferPropertyDefinition
public static readonly Property<TextBuffer?, Snippet> BufferPropertyDefinition
Field Value
DescriptionPropertyDefinition
public static readonly Property<string?, Snippet> DescriptionPropertyDefinition
Field Value
FocusPositionPropertyDefinition
public static readonly Property<int, Snippet> FocusPositionPropertyDefinition
Field Value
LanguageIdPropertyDefinition
public static readonly Property<string?, Snippet> LanguageIdPropertyDefinition
Field Value
NamePropertyDefinition
public static readonly Property<string?, Snippet> NamePropertyDefinition
Field Value
TriggerPropertyDefinition
public static readonly Property<string?, Snippet> TriggerPropertyDefinition
Field Value
Properties
Buffer
public TextBuffer? Buffer { get; }
Property Value
Description
public string? Description { get; set; }
Property Value
FocusPosition
public int FocusPosition { get; }
Property Value
LanguageId
public string? LanguageId { get; set; }
Property Value
Name
public string? Name { get; set; }
Property Value
Trigger
public string? Trigger { get; set; }
Property Value
Methods
AddChunk(SnippetChunk)
public void AddChunk(SnippetChunk chunk)
Parameters
chunkSnippetChunk
Copy()
public Snippet Copy()
Returns
GetContext()
public SnippetContext? GetContext()
Returns
GetDescription()
public string GetDescription()
Returns
GetFocusPosition()
public int GetFocusPosition()
Returns
GetGType()
public static Type GetGType()
Returns
GetLanguageId()
public string GetLanguageId()
Returns
GetNChunks()
public uint GetNChunks()
Returns
GetName()
public string GetName()
Returns
GetNthChunk(uint)
public SnippetChunk GetNthChunk(uint nth)
Parameters
nthuint
Returns
GetTrigger()
public string? GetTrigger()
Returns
New(string?, string?)
public static Snippet New(string? trigger, string? languageId)
Parameters
Returns
NewFromPointer(nint, bool)
Creates a new managed Snippet instance for a given pointer.
public static Snippet NewFromPointer(nint ptr, bool ownsHandle)
Parameters
Returns
NewParsed(string)
[Version("5.6")]
public static Snippet NewParsed(string text)
Parameters
textstring
Returns
NewWithProperties(ConstructArgument[])
Creates a new Snippet and sets the properties specified by the construct arguments.
public static Snippet NewWithProperties(ConstructArgument[] constructArguments)
Parameters
constructArgumentsConstructArgument[]The properties to set.
Returns
SetDescription(string)
public void SetDescription(string description)
Parameters
descriptionstring
SetLanguageId(string)
public void SetLanguageId(string languageId)
Parameters
languageIdstring
SetName(string)
public void SetName(string name)
Parameters
namestring
SetTrigger(string)
public void SetTrigger(string trigger)
Parameters
triggerstring