My Project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
RoslynCSharp.ScriptAssembly Class Referenceabstract
Inheritance diagram for RoslynCSharp.ScriptAssembly:
RoslynCSharp.Compiler.IMetadataReferenceProvider

Public Member Functions

override string ToString ()
 
bool SecurityCheckAssembly (CodeSecurityRestrictions restrictions)
 Run security verification on this assembly using the specified security restrictions.
 
virtual bool SecurityCheckAssembly (CodeSecurityRestrictions restrictions, out CodeSecurityReport report)
 Run security verification on this assembly using the specified security restrictions and output a security report.
 
virtual bool HasType (string name)
 Returns true if this ScriptAssembly defines a type with the specified name. Depending upon settings, name comparison may or may not be case sensitive.
 
virtual bool HasSubTypeOf (Type subType)
 Returns true if this ScriptAssembly defines one or more types that inherit from the specified type. The specified type may be a base class or interface type.
 
bool HasSubTypeOf< T > ()
 Returns true if this ScriptAssembly defined one or more types that inherit from the specified generic type. The specified generic type may be a base class or interface type.
 
virtual bool HasSubTypeOf (Type subType, string name)
 Returns true if this ScriptAssembly defines a type that inherits from the specified type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.
 
bool HasSubTypeOf< T > (string name)
 Returns true if this ScriptAssembly defines a type that inherits from the specified genric type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.
 
virtual ScriptType FindType (string name)
 Attempts to find a type defined in this ScriptAssembly with the specified name. Depending upon settings, name comparison may or may not be case sensitive.
 
virtual ScriptType FindType (Type type)
 Attempts to find a type defined in this ScriptAssembly from the specified system type.
 
virtual ScriptType FindSubTypeOf (Type subType, bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find a type defined in this ScriptAssembly that inherits from the specified base type. If there is more than one type that inherits from the specified base type, then the first matching type will be returned. If you want to find all types then use FindAllSubTypesOf(Type, bool).
 
ScriptType FindSubTypeOf< T > (bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find a type defined in this ScriptAssembly that inherits from the specified generic type. If there is more than one type that inherits from the specified generic type, then the first matching type will be returned. If you want to find all types then use FindAllSubTypesOf<T>(bool).
 
virtual ScriptType FindSubTypeOf (Type subType, string name)
 Attempts to find a type defined in this ScriptAssembly that inherits from the specified base type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.
 
ScriptType FindSubTypeOf< T > (string name)
 Attempts to find a type defined in this ScriptAssembly that inherits from the specified generic type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.
 
virtual ScriptType[] FindAllSubTypesOf (Type subType, bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find all types defined in this ScriptAssembly that inherits from the specified type. If there are no types that inherit from the specified type then the return value will be an empty array.
 
ScriptType[] FindAllSubTypesOf< T > (bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find all types defined in this ScriptAssembly that inherit from the specified generic type. If there are no types that inherit from the specified type then the return value will be an empty array.
 
virtual ScriptType[] FindAllTypes (bool includeNonPublic=true, bool findNestedTypes=true)
 Returns an array of all defined types in this ScriptAssembly.
 
ScriptType[] FindAllUnityTypes (bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find all types defined in this ScriptAssembly that inherit from UnityEngine.Object.
If there are no types that inherit from UnityEngine.Object then the return value will be an empty array.
 
ScriptType[] FindAllMonoBehaviourTypes (bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find all types defined in this ScriptAssembly that inherit from UnityEngine.MonoBehaviour.
If there are no types that inherit from UnityEngine.MonoBehaviour then the return value will be an empty array.
 
ScriptType[] FindAllScriptableObjectTypes (bool includeNonPublic=true, bool findNestedTypes=true)
 Attempts to find all types defined in this ScriptAssembly that inherit from UnityEngine.ScriptableObject.
If there are no types that inherit from UnityEngine.ScriptableObject then the return value will be an empty array.
 
virtual IEnumerable< ScriptTypeEnumerateAllSubTypesOf (Type subType, bool includeNonPublic=true, bool enumerateNestedTypes=true)
 Enumerate all types defined in this ScriptAssembly that inherits from the specified type.
 
IEnumerable< ScriptTypeEnumerateAllSubTypesOf< T > (bool includeNonPublic=true, bool enumerateNestedTypes=true)
 Enumerate all types defined in this ScriptAssembly that inherit from the specified generic type.
 
virtual IEnumerable< ScriptTypeEnumerateAllTypes (bool includeNonPublic=true, bool enumerateNestedTypes=true)
 Enumerate all defined types in this ScriptAssembly.
 
IEnumerable< ScriptTypeEnumerateAllUnityTypes (bool includeNonPublic=true, bool enumerateNestedTypes=true)
 Enumerate all types defined in this ScriptAssembly that inherit from UnityEngine.Object.

 
IEnumerable< ScriptTypeEnumerateAllMonoBehaviourTypes (bool includeNonPublic=true, bool enumerateNestedTypes=true)
 Enumerate all types defined in this ScriptAssembly that inherit from UnityEngine.MonoBehaviour.

 
IEnumerable< ScriptTypeEnumerateAllScriptableObjectTypes (bool includeNonPublic=true, bool enumerateNestedTypes=true)
 Enumerate all types defined in this ScriptAssembly that inherit from UnityEngine.ScriptableObject.

 

Static Public Member Functions

static T CreateScriptAssembly< T > (ScriptDomain domain, Assembly systemAssembly, string assemblyPath=null, string assemblySymbolsPath=null, byte[] assemblyImage=null, byte[] assemblySymbolsImage=null, CompilationResult compileResult=null)
 

Protected Member Functions

abstract void ConstructInstance (ScriptDomain domain, Assembly systemAssembly)
 
virtual CodeSecurityEngine CreateSecurityEngine ()
 Create a code security engine that will be used to security verify the assembly code.
 
abstract ScriptType CreateRootScriptType (Type systemType)
 

Protected Attributes

string assemblyPath = null
 
string assemblySymbolsPath = null
 
byte[] assemblyImage = null
 
byte[] assemblySymbolsImage = null
 

Properties

abstract ScriptDomain Domain [get]
 Get the ScriptDomain that this ScriptAssembly is currently loaded in.

 
abstract Assembly SystemAssembly [get]
 Get the Assembly that this ScriptAssembly wraps.

 
virtual ScriptType MainType [get]
 Gets the main type for the assembly. This will usually return the first defined class type in the assembly which is especially useful for assemblies that only define a single type.
 
virtual string Name [get]
 Get the name of the wrapped assembly.
 
virtual string FullName [get]
 Get the full name of the wrapped assembly.
 
virtual Version Version [get]
 Get the version of the wrapped assembly.
 
virtual string AssemblyPath [get]
 Get the location of the loaded system assembly.
 
virtual string AssemblySymbolsPath [get]
 Get the location of the loaded debug symbols file.
 
virtual byte[] AssemblyImage [get]
 Get the raw assembly image data of the loaded system assembly.
 
virtual byte[] AssemblySymbolsImage [get]
 Get the raw debug symbols image data for the loaded assembly.
 
virtual MetadataReference CompilerReference [get]
 Get the metadata reference that can be used to add this assembly as a compiler reference.
 
abstract bool IsRuntimeCompiled [get]
 Returns true if this assembly was compiled at runtime by the Roslyn compiler service.
 
abstract DateTime RuntimeCompiledTime [get]
 Get the DateTime when this assembly was runtime compiled.
 
abstract CompilationResult CompileResult [get]
 Get the compilation result for the assembly if it was runtime compiled.
 
virtual bool IsSecurityValidated [get]
 Returns true if this assembly has passed security verification.
 
virtual CodeSecurityReport SecurityReport [get]
 Get the code security report for this assembly if it was security verified.
 

Member Function Documentation

◆ CreateScriptAssembly< T >()

static T RoslynCSharp.ScriptAssembly.CreateScriptAssembly< T > ( ScriptDomain  domain,
Assembly  systemAssembly,
string  assemblyPath = null,
string  assemblySymbolsPath = null,
byte[]  assemblyImage = null,
byte[]  assemblySymbolsImage = null,
CompilationResult  compileResult = null 
)
inlinestatic
Type Constraints
T :ScriptAssembly 
T :new() 

◆ CreateSecurityEngine()

virtual CodeSecurityEngine RoslynCSharp.ScriptAssembly.CreateSecurityEngine ( )
inlineprotectedvirtual

Create a code security engine that will be used to security verify the assembly code.

Returns

◆ EnumerateAllMonoBehaviourTypes()

IEnumerable< ScriptType > RoslynCSharp.ScriptAssembly.EnumerateAllMonoBehaviourTypes ( bool  includeNonPublic = true,
bool  enumerateNestedTypes = true 
)
inline

Enumerate all types defined in this ScriptAssembly that inherit from UnityEngine.MonoBehaviour.

Returns
Enumerable of matching results

◆ EnumerateAllScriptableObjectTypes()

IEnumerable< ScriptType > RoslynCSharp.ScriptAssembly.EnumerateAllScriptableObjectTypes ( bool  includeNonPublic = true,
bool  enumerateNestedTypes = true 
)
inline

Enumerate all types defined in this ScriptAssembly that inherit from UnityEngine.ScriptableObject.

Returns
Enumerable of matching results

◆ EnumerateAllSubTypesOf()

virtual IEnumerable< ScriptType > RoslynCSharp.ScriptAssembly.EnumerateAllSubTypesOf ( Type  subType,
bool  includeNonPublic = true,
bool  enumerateNestedTypes = true 
)
inlinevirtual

Enumerate all types defined in this ScriptAssembly that inherits from the specified type.

Parameters
subTypeThe type to check for in the inheritance chain
includeNonPublicShould the search include non public types
Returns
Enumerable of matching results

◆ EnumerateAllSubTypesOf< T >()

IEnumerable< ScriptType > RoslynCSharp.ScriptAssembly.EnumerateAllSubTypesOf< T > ( bool  includeNonPublic = true,
bool  enumerateNestedTypes = true 
)
inline

Enumerate all types defined in this ScriptAssembly that inherit from the specified generic type.

Template Parameters
TThe generic type to check for in the inheritance chain
Returns
Enumerable of matching results

◆ EnumerateAllTypes()

virtual IEnumerable< ScriptType > RoslynCSharp.ScriptAssembly.EnumerateAllTypes ( bool  includeNonPublic = true,
bool  enumerateNestedTypes = true 
)
inlinevirtual

Enumerate all defined types in this ScriptAssembly.

Returns
Enumerable of all results

◆ EnumerateAllUnityTypes()

IEnumerable< ScriptType > RoslynCSharp.ScriptAssembly.EnumerateAllUnityTypes ( bool  includeNonPublic = true,
bool  enumerateNestedTypes = true 
)
inline

Enumerate all types defined in this ScriptAssembly that inherit from UnityEngine.Object.

Returns
Enumerable of matching results

◆ FindAllMonoBehaviourTypes()

ScriptType[] RoslynCSharp.ScriptAssembly.FindAllMonoBehaviourTypes ( bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inline

Attempts to find all types defined in this ScriptAssembly that inherit from UnityEngine.MonoBehaviour.
If there are no types that inherit from UnityEngine.MonoBehaviour then the return value will be an empty array.

Returns
(Not Null) An array of ScriptType or an empty array if no matching type was found

◆ FindAllScriptableObjectTypes()

ScriptType[] RoslynCSharp.ScriptAssembly.FindAllScriptableObjectTypes ( bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inline

Attempts to find all types defined in this ScriptAssembly that inherit from UnityEngine.ScriptableObject.
If there are no types that inherit from UnityEngine.ScriptableObject then the return value will be an empty array.

Returns
(Not Null) An array of ScriptType or an empty array if no matching type was found

◆ FindAllSubTypesOf()

virtual ScriptType[] RoslynCSharp.ScriptAssembly.FindAllSubTypesOf ( Type  subType,
bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inlinevirtual

Attempts to find all types defined in this ScriptAssembly that inherits from the specified type. If there are no types that inherit from the specified type then the return value will be an empty array.

Parameters
subTypeThe type to check for in the inheritance chain
includeNonPublicShould the search include non public types
Returns
(Not Null) An array of ScriptType or an empty array if no matching type was found

◆ FindAllSubTypesOf< T >()

ScriptType[] RoslynCSharp.ScriptAssembly.FindAllSubTypesOf< T > ( bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inline

Attempts to find all types defined in this ScriptAssembly that inherit from the specified generic type. If there are no types that inherit from the specified type then the return value will be an empty array.

Template Parameters
TThe generic type to check for in the inheritance chain
Returns
(Not Null) An array of ScriptType or an empty array if no matching type was found

◆ FindAllTypes()

virtual ScriptType[] RoslynCSharp.ScriptAssembly.FindAllTypes ( bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inlinevirtual

Returns an array of all defined types in this ScriptAssembly.

Returns
An array of ScriptType representing all types defined in this ScriptAssembly

◆ FindAllUnityTypes()

ScriptType[] RoslynCSharp.ScriptAssembly.FindAllUnityTypes ( bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inline

Attempts to find all types defined in this ScriptAssembly that inherit from UnityEngine.Object.
If there are no types that inherit from UnityEngine.Object then the return value will be an empty array.

Returns
(Not Null) An array of ScriptType or an empty array if no matching type was found

◆ FindSubTypeOf() [1/2]

virtual ScriptType RoslynCSharp.ScriptAssembly.FindSubTypeOf ( Type  subType,
bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inlinevirtual

Attempts to find a type defined in this ScriptAssembly that inherits from the specified base type. If there is more than one type that inherits from the specified base type, then the first matching type will be returned. If you want to find all types then use FindAllSubTypesOf(Type, bool).

Parameters
subTypeThe type to check for in the inheritance chain
includeNonPublicShould the search include non public types
Returns
An instance of ScriptType representing the found type or null if the type could not be found

◆ FindSubTypeOf() [2/2]

virtual ScriptType RoslynCSharp.ScriptAssembly.FindSubTypeOf ( Type  subType,
string  name 
)
inlinevirtual

Attempts to find a type defined in this ScriptAssembly that inherits from the specified base type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.

Parameters
subTypeThe type to check for in the inheritance chain
nameThe name of the type to look for
Returns
An instance of ScriptType representing the found type or null if the type could not be found

◆ FindSubTypeOf< T >() [1/2]

ScriptType RoslynCSharp.ScriptAssembly.FindSubTypeOf< T > ( bool  includeNonPublic = true,
bool  findNestedTypes = true 
)
inline

Attempts to find a type defined in this ScriptAssembly that inherits from the specified generic type. If there is more than one type that inherits from the specified generic type, then the first matching type will be returned. If you want to find all types then use FindAllSubTypesOf<T>(bool).

Parameters
includeNonPublicShould the search include non public types
Template Parameters
TThe generic type to check for in the inheritance chain
Returns
An instance of ScriptType representing the found type or null if the type could not be found

◆ FindSubTypeOf< T >() [2/2]

Attempts to find a type defined in this ScriptAssembly that inherits from the specified generic type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.

Template Parameters
TThe generic type to check for in the inheritance chain
Parameters
nameThe name of the type to look for
Returns
An instance of ScriptType representing the found type or null if the type could not be found

◆ FindType() [1/2]

virtual ScriptType RoslynCSharp.ScriptAssembly.FindType ( string  name)
inlinevirtual

Attempts to find a type defined in this ScriptAssembly with the specified name. Depending upon settings, name comparison may or may not be case sensitive.

Parameters
nameThe name of the type to look for
Returns
An instance of ScriptType representing the found type or null if the type could not be found

◆ FindType() [2/2]

virtual ScriptType RoslynCSharp.ScriptAssembly.FindType ( Type  type)
inlinevirtual

Attempts to find a type defined in this ScriptAssembly from the specified system type.

Parameters
typeThe system type to look for
Returns
An instance of ScriptType representing the found type or null if the type could not be found

◆ HasSubTypeOf() [1/2]

virtual bool RoslynCSharp.ScriptAssembly.HasSubTypeOf ( Type  subType)
inlinevirtual

Returns true if this ScriptAssembly defines one or more types that inherit from the specified type. The specified type may be a base class or interface type.

Parameters
subTypeThe type to check for in the inheritace chain
Returns
True if there are one or more defined types that inherit from the specified type

◆ HasSubTypeOf() [2/2]

virtual bool RoslynCSharp.ScriptAssembly.HasSubTypeOf ( Type  subType,
string  name 
)
inlinevirtual

Returns true if this ScriptAssembly defines a type that inherits from the specified type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.

Parameters
subTypeThe type to check for in the inheritance chain
nameThe name of the type to look for
Returns
True if a type that inherits from the specified type and has the specified name is defined

◆ HasSubTypeOf< T >() [1/2]

Returns true if this ScriptAssembly defined one or more types that inherit from the specified generic type. The specified generic type may be a base class or interface type.

Template Parameters
TThe generic type to check for in the inheritance chain
Returns
True if there are one or more defined types that inherit from the specified generic type

◆ HasSubTypeOf< T >() [2/2]

bool RoslynCSharp.ScriptAssembly.HasSubTypeOf< T > ( string  name)
inline

Returns true if this ScriptAssembly defines a type that inherits from the specified genric type and matches the specified name. Depending upon settings, name comparison may or may not be case sensitive.

Template Parameters
TThe generic type to check for in the inheritance chain
Parameters
nameThe name of the type to look for
Returns
True if a type that inherits from the specified type and has the specified name is defined

◆ HasType()

virtual bool RoslynCSharp.ScriptAssembly.HasType ( string  name)
inlinevirtual

Returns true if this ScriptAssembly defines a type with the specified name. Depending upon settings, name comparison may or may not be case sensitive.

Parameters
nameThe name of the type to look for
Returns
True if a type with the specified name is defined

◆ SecurityCheckAssembly() [1/2]

bool RoslynCSharp.ScriptAssembly.SecurityCheckAssembly ( CodeSecurityRestrictions  restrictions)
inline

Run security verification on this assembly using the specified security restrictions.

Parameters
restrictionsThe restrictions used to verify the assembly
Returns
True if the assembly passes security verification or false if it fails

◆ SecurityCheckAssembly() [2/2]

virtual bool RoslynCSharp.ScriptAssembly.SecurityCheckAssembly ( CodeSecurityRestrictions  restrictions,
out CodeSecurityReport  report 
)
inlinevirtual

Run security verification on this assembly using the specified security restrictions and output a security report.

Parameters
restrictionsThe restrictions used to verify the assembly
reportThe security report generated by the assembly checker
Returns
True if the assembly passes security verification or false if it fails

Property Documentation

◆ CompilerReference

virtual MetadataReference RoslynCSharp.ScriptAssembly.CompilerReference
get

Get the metadata reference that can be used to add this assembly as a compiler reference.

Implements RoslynCSharp.Compiler.IMetadataReferenceProvider.


The documentation for this class was generated from the following file: