C# Класс Scriban.Runtime.ScriptObjectExtensions

Extensions attached to an IScriptObject.
Показать файл Открыть проект

Открытые методы

Метод Описание
GetScriptObject ( this @this ) : ScriptObject

Gets the script object attached to the specified instance.

Import ( this @this, IScriptObject other ) : void

Imports the specified ScriptObject into this instance by copying the member values into this object.

Import ( this script, object obj ) : void

Imports the specified object intto this ScriptObject context. See remarks.

  • If obj is a System.Type, this method will import only the static field/properties of the specified object.
  • If obj is a ScriptObject, this method will import the members of the specified object into the new object.
  • If obj is a plain object, this method will import the public fields/properties of the specified object into the ScriptObject.
Import ( this script, object obj, ScriptMemberImportFlags flags, FilterMemberDelegate filter = null, IMemberRenamer renamer = null ) : void

Imports the specified object.

Import ( this script, string member, Delegate function ) : void

Imports the delegate to the specified member.

ImportMember ( this script, object obj, string memberName, string exportName = null ) : void

Imports a specific member from the specified object.

TrySetValue ( this @this, string member, object value, bool readOnly ) : bool

Tries to set the value and readonly state of the specified member.

Описание методов

GetScriptObject() публичный статический Метод

Gets the script object attached to the specified instance.
Expecting ScriptObject or ScriptArray instance
public static GetScriptObject ( this @this ) : ScriptObject
@this this
Результат ScriptObject

Import() публичный статический Метод

Imports the specified ScriptObject into this instance by copying the member values into this object.
public static Import ( this @this, IScriptObject other ) : void
@this this
other IScriptObject The other .
Результат void

Import() публичный статический Метод

Imports the specified object intto this ScriptObject context. See remarks.
  • If obj is a System.Type, this method will import only the static field/properties of the specified object.
  • If obj is a ScriptObject, this method will import the members of the specified object into the new object.
  • If obj is a plain object, this method will import the public fields/properties of the specified object into the ScriptObject.
public static Import ( this script, object obj ) : void
script this
obj object The object.
Результат void

Import() публичный статический Метод

Imports the specified object.
public static Import ( this script, object obj, ScriptMemberImportFlags flags, FilterMemberDelegate filter = null, IMemberRenamer renamer = null ) : void
script this
obj object The object.
flags ScriptMemberImportFlags The import flags.
filter FilterMemberDelegate A filter applied on each member
renamer IMemberRenamer The member renamer.
Результат void

Import() публичный статический Метод

Imports the delegate to the specified member.
if member or function are null
public static Import ( this script, string member, Delegate function ) : void
script this
member string The member.
function System.Delegate The function delegate.
Результат void

ImportMember() публичный статический Метод

Imports a specific member from the specified object.
public static ImportMember ( this script, object obj, string memberName, string exportName = null ) : void
script this
obj object The object.
memberName string Name of the member.
exportName string Name of the member name replacement. If null, use the default renamer will be used.
Результат void

TrySetValue() публичный статический Метод

Tries to set the value and readonly state of the specified member.
public static TrySetValue ( this @this, string member, object value, bool readOnly ) : bool
@this this
member string The member.
value object The value.
readOnly bool if set to true the value will be read only.
Результат bool