s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
TypeLibrary
chevron_left
Classes
class
TypeLibrary
search
Methods
functions
CheckValidationAttributes
functions
Create
functions
CreateProperty
functions
FindStaticMethods
functions
FromBytes
functions
GetAttribute
functions
GetAttributes
functions
GetEnumDescription
functions
GetGenericArguments
functions
GetGenericTypes
functions
GetMemberAttributes
functions
GetMemberByIdent
functions
GetMethodsWithAttribute
functions
GetPropertyDescriptions
functions
GetPropertyValue
functions
GetSerializedObject
functions
GetType
functions
GetTypeByIdent
functions
GetTypeIdent
functions
GetTypes
functions
GetTypesWithAttribute
functions
HasAttribute
functions
SetProperty
functions
ToBytes
functions
TryGetType
TypeLibrary
class
Sandbox.Internal
.
Sandbox.Reflection
functions
Methods
25
CheckValidationAttributes
(
obj
)
bool
Check if all properties of this class instance pass their System.ComponentModel.DataAnnotations.ValidationAttribute.
Create
(
name
,
targetType
,
args
)
object
Create a type instance by name and is assignable to given type, with optional arguments for its constructor.
CreateProperty
(
title
,
get
,
set
,
attributes
,
parent
)
SerializedProperty
FindStaticMethods
(
methodName
)
IEnumerable`1
Find all static methods with given name.
FromBytes
(
data
)
T
Deserialize this from bytes. If the type is unknown, T can be an object.
GetAttribute
(
t
)
T
Get single attribute of type, from type
GetAttributes
(
)
IReadOnlyList`1
Get all attributes of this type
GetEnumDescription
(
enumType
)
EnumDescription
Get a class describing the values of an enum
GetGenericArguments
(
genericType
)
Type[]
Performs System.Type.GetGenericArguments with access control checks. Will throw if any arguments aren't in the whitelist.
GetGenericTypes
(
type
,
types
)
IReadOnlyList`1
Get a list of types that implement this generic type
GetMemberAttributes
(
)
IEnumerable`1
Find all member attributes (instances) with given attribute type.
GetMemberByIdent
(
ident
)
MemberDescription
Find a Sandbox.MemberDescription by its Sandbox.MemberDescription.Identity
GetMethodsWithAttribute
(
onlyStatic
)
IReadOnlyList`1
Find all methods with given attribute, optionally non static
GetPropertyDescriptions
(
obj
,
onlyOwn
)
PropertyDescription[]
Get a list of properties on the target object. To do this we'll just call GetDescription( obj.GetType() ) and return .Properties. Will return an empty array if we can't access these properties.
GetPropertyValue
(
target
,
name
)
object
Try to get a value from a property on an object
GetSerializedObject
(
target
)
SerializedObject
Get a SerializedObject version of this object
GetType
(
type
)
TypeDescription
Get the description for a specific type. This will return null if you don't have whitelist access to the type. For constructed generic types, this will give you the description of the generic type definition.
GetTypeByIdent
(
ident
)
TypeDescription
Find a TypeDescription by name
GetTypeIdent
(
type
)
int
Get hash of a type.
GetTypes
(
type
)
IReadOnlyList`1
Get descriptions for all types that derive from T
GetTypesWithAttribute
(
)
IReadOnlyList`1
Get all attributes of this type. Returns the type description along with the attribute. This will also return types that inherit the attribute from base classes too.
HasAttribute
(
type
)
bool
Return true if this type contains this attribute
SetProperty
(
target
,
name
,
value
)
bool
Set a named property on given object. Will perform extra magic for string inputs and try to convert to target property type.
ToBytes
(
value
)
Byte[]
Serialize this value to bytes, where possible
TryGetType
(
t
,
typeDescription
)
bool
Find the description type
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.