C# 클래스 Scriban.Runtime.ScriptObjectExtensions

Extensions attached to an IScriptObject.
파일 보기 프로젝트 열기: lunet-io/scriban

공개 메소드들

메소드 설명
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