CodeBlock Class

Represents a segment of source code with details about its programming language and line number.

Definition

Namespace: GenerativeAI.Core
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class CodeBlock
Inheritance
Object    CodeBlock

Constructors

CodeBlock(String, String) Represents a block of code with its corresponding programming language and line number information.
CodeBlock(String, String, Int32) Represents a block of code with its corresponding programming language and line number information.

Properties

Code Gets or sets the content of the code block as a string.
Language Gets or sets the programming language associated with the code block.
LineNumber Gets or sets the line number where the code block appears in the source text.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToString Returns a string representation of the CodeBlock object, including the programming language and the corresponding code in a formatted manner.
(Overrides ObjectToString)

See Also