Photon Server API
Public Member Functions | Static Public Member Functions | List of all members
Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper Class Reference

Provides methods to get and set objects fields and properties per reflection. More...

Public Member Functions

delegate bool TryConvertDelegate< TAttribute > (ObjectMemberInfo< TAttribute > targetMember, ref object value)
 The try convert delegate. More...
 

Static Public Member Functions

static Dictionary< byte, object > GetValues< TAttribute > (object source)
 The get values. More...
 
static Dictionary< string, object > GetValuesByName< TAttribute > (object source)
 Gets a data objects member values as a name value dictionary. More...
 
static bool TrySetValues< TAttribute > (object target, IDictionary< byte, object > values, TryConvertDelegate< TAttribute > convertMethod, out List< ObjectMemberInfo< TAttribute >> missingParams, out List< ObjectMemberInfo< TAttribute >> invalidParams)
 The try set values. More...
 
static bool TrySetValues< TAttribute > (object target, IDictionary< string, object > values, TryConvertDelegate< TAttribute > convertMethod, out List< ObjectMemberInfo< TAttribute >> missingParams, out List< ObjectMemberInfo< TAttribute >> invalidParams)
 The try set values. More...
 

Detailed Description

Provides methods to get and set objects fields and properties per reflection.

Member Function Documentation

static Dictionary<byte, object> Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper.GetValues< TAttribute > ( object  source)
inlinestatic

The get values.

Parameters
sourceThe source.
Template Parameters
TAttributeSearch type for fields of source .
Returns
A dictionary with the key/value pairs of error code 1 if a value is null.
Exceptions
ArgumentExceptionMandatory member of source is null.
Type Constraints
TAttribute :DataMemberAttribute 
static Dictionary<string, object> Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper.GetValuesByName< TAttribute > ( object  source)
inlinestatic

Gets a data objects member values as a name value dictionary.

Template Parameters
TAttributeThe type of the attribute.
Parameters
sourceThe data object source.
Returns
returns a dictionary containing the data objects member values.
Type Constraints
TAttribute :DataMemberAttribute 
delegate bool Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper.TryConvertDelegate< TAttribute > ( ObjectMemberInfo< TAttribute >  targetMember,
ref object  value 
)

The try convert delegate.

Parameters
targetMemberThe target member.
valueThe value.
Template Parameters
TAttributeThe attribute type
Returns
True if value is legal.
Type Constraints
TAttribute :DataMemberAttribute 
static bool Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper.TrySetValues< TAttribute > ( object  target,
IDictionary< byte, object >  values,
TryConvertDelegate< TAttribute >  convertMethod,
out List< ObjectMemberInfo< TAttribute >>  missingParams,
out List< ObjectMemberInfo< TAttribute >>  invalidParams 
)
inlinestatic

The try set values.

Parameters
targetThe target.
valuesThe values.
convertMethodThe convert method.
missingParamsThe missing params.
invalidParamsThe invalid params.
Template Parameters
TAttributethe attribute type
Returns
true if successful.
Type Constraints
TAttribute :DataMemberAttribute 
static bool Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper.TrySetValues< TAttribute > ( object  target,
IDictionary< string, object >  values,
TryConvertDelegate< TAttribute >  convertMethod,
out List< ObjectMemberInfo< TAttribute >>  missingParams,
out List< ObjectMemberInfo< TAttribute >>  invalidParams 
)
inlinestatic

The try set values.

Parameters
targetThe target.
valuesThe values.
convertMethodThe convert method.
missingParamsThe missing params.
invalidParamsThe invalid params.
Template Parameters
TAttributethe attribute type
Returns
true if successful.
Type Constraints
TAttribute :DataMemberAttribute