# Reflective

### Reflective

Reflective Class

Base class which provides for simple reflection of methods through a given interface.

### Syntax

public class **Reflective**

### Member Details

#### Reflective Constructor

> Default constructor.
>
> #### Syntax
>
> protected **Reflective** ()
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### AllowedContexts Property

> Internal Use Only. Overridden by subclasses to return only those contexts requested which are allowed for that type of script.
>
> #### Syntax
>
> **Value**
>
> > Documentation for this section has not yet been entered.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### AsInterface Generic Method

> Returns a TInterface object if one can be created, null otherwise
>
> #### Syntax
>
> \[Sansar.Script.NonReflective]\
> public *TInterface* **AsInterface** ()\
> where TInterface : class
>
> **Type Parameters**
>
> > *TInterface*
> >
> > The interface describing the methods and properties desired.
>
> **Returns**
>
> > A TInterface instance if this object is compatible. An object is compatible if it implements the interface or has public methods and properties which match TInterface.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### FullInterface Method

> Generates a string which shows all the members which can be reflected.
>
> #### Syntax
>
> \[Sansar.Script.NonReflective]\
> public [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **FullInterface** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) interfaceName)
>
> **Parameters**
>
> > *interfaceName*
> >
> > The name to give the generated interface class in the output.
>
> **Returns**
>
> > The generated string. If no members can be reflected, returns the empty string
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ReflectiveContexts Property

> Override ReflectiveContexts to limit which contexts this Reflective interface is available in when registered with.
>
> #### Syntax
>
> \[Sansar.Script.NonReflective]\
> protected virtual [Reflective.Context](https://help.sansar.com/hc/en-us/articles/360022662192) **ReflectiveContexts** { get; }
>
> **Value**
>
> > Documentation for this section has not yet been entered.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ReflectiveName Property

> Override ReflectiveName to change which name this class will be registered as in the Reflective system.
>
> #### Syntax
>
> \[Sansar.Script.NonReflective]\
> protected virtual [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **ReflectiveName** { get; }
>
> **Value**
>
> > Documentation for this section has not yet been entered.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Register Method

> #### Syntax
>
> \[Sansar.Script.NonReflective]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Register** ()
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Unregister Method

> #### Syntax
>
> \[Sansar.Script.NonReflective]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Unregister** ()
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

### Reflective+Context

### Reflective.Context Enum

Use with [Sansar.Script.RegisterReflectiveAttribute](https://help.sansar.com/hc/en-us/articles/115005730166) and [Reflective.Register(Sansar.Script.Reflective.Context)](https://help.sansar.com/hc/en-us/articles/115005308183#M:Sansar.Script.Reflective.Register\(Sansar.Script.Reflective.Context\)) to specify specific access context for the registered reflective class.

### Syntax

\[System.Flags]\
public enum **Reflective.Context**

### Remarks

Documentation for this section has not yet been entered.

### Members

| Member Name       | Description                                                                                                    |
| ----------------- | -------------------------------------------------------------------------------------------------------------- |
| **All**           | All contexts.                                                                                                  |
| **None**          | Not discoverable via FindReflective or FindScript                                                              |
| **ObjectPrivate** | Works only for running scripts, makes them findable in ObjectPrivate.FindScript and ObjectPrivate.FindScripts. |
| **ScenePrivate**  | Findable in ScenePrivate.FindReflective                                                                        |
| **ScenePublic**   | Findable in ScenePublic.FindReflective                                                                         |

### Requirements

**Namespace:** Sansar.Script\
**Assembly:** Sansar.Script (in Sansar.Script.dll)\
**Assembly Versions:** 1.0.0.0

### Reflective.ReflectiveBase Class

Internal support class.

### Syntax

public class **Reflective.ReflectiveBase**

### Member Details

#### Reflective.ReflectiveBase Constructor

> Documentation for this section has not yet been entered.
>
> #### Syntax
>
> public **Reflective.ReflectiveBase** ()
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### originalObject Field

> Wrapped object.
>
> #### Syntax
>
> protected [object](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Object) **originalObject**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Script\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sansar.com/latest/script-api-docs/sansar-script-namespace/reflective.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
