Class SerializedParam
An abstract base class for serializing and working with parameters/settings associated with items
Also implements System.ICloneable to ensure parameters can be copied and passed around as strings
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Utils
Assembly: Utils.dll
Syntax
[DataContract]
public abstract class SerializedParam : ICloneable
Methods
Clone()
Creates an entire new instance of this SerializedParam with all the same values as this one
Declaration
protected SerializedParam Clone()
Returns
Type | Description |
---|---|
SerializedParam | An entire new instance of a SerializedParam with all the same property values as this one |
CopyFromParam(SerializedParam)
Should be overridden by inheriting implementations to ensure all parameters values are copied from the specified source
Declaration
protected virtual void CopyFromParam(SerializedParam source)
Parameters
Type | Name | Description |
---|---|---|
SerializedParam | source | The source instance of a SerializedParam that is of the same type as this one to copy parameter values from |
Remarks
Used by the generic implementation of System.ICloneable.Clone
CreateNewParam()
Must be implemented by inheriting classes to provide a new instance of the current class type.
Used when cloning this SerializedParam to create a new instance of the same type
Declaration
protected abstract SerializedParam CreateNewParam()
Returns
Type | Description |
---|---|
SerializedParam | A new instance of the current SerializedParam type |
GetParam(Byte[])
Given a serialized byte array this deseralizes it and returns the instance as a SerializedParam
Declaration
public static SerializedParam GetParam(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The serialized byte array of this SerializedParam |
Returns
Type | Description |
---|---|
SerializedParam | A deserialized version of this SerializedParam |
GetParam(String)
Given a serialized string this deseralizes it and returns the instance as a SerializedParam
Declaration
public static SerializedParam GetParam(string param)
Parameters
Type | Name | Description |
---|---|---|
System.String | param | The serialized string of this SerializedParam |
Returns
Type | Description |
---|---|
SerializedParam | A deserialized version of this SerializedParam |
GetParam<T>(Byte[])
Given a serialized byte array this deseralizes it and returns the instance as a SerializedParam of type T
Declaration
public static T GetParam<T>(byte[] data)
where T : SerializedParam
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The serialized byte array of this SerializedParam |
Returns
Type | Description |
---|---|
T | A deserialized version of this SerializedParam as type |
Type Parameters
Name | Description |
---|---|
T | The type this serialized parameter resolves to (or one of its base types) |
GetParam<T>(String)
Given a serialized string this deseralizes it and returns the instance as a SerializedParam of type T
Declaration
public static T GetParam<T>(string param)
where T : SerializedParam
Parameters
Type | Name | Description |
---|---|---|
System.String | param | The serialized string of this SerializedParam |
Returns
Type | Description |
---|---|
T | A deserialized version of this SerializedParam as type |
Type Parameters
Name | Description |
---|---|
T | The type this serialized parameter resolves to (or one of its base types) |
ToSerializedBytes()
Serializes this SerializedParam class as a byte array
Declaration
public byte[] ToSerializedBytes()
Returns
Type | Description |
---|---|
System.Byte[] | A byte array serialization of this SerializedParam instance |
ToSerializedString()
Serializes this SerializedParam class as a string
Declaration
public string ToSerializedString()
Returns
Type | Description |
---|---|
System.String | A string serialization of this SerializedParam instance |
Explicit Interface Implementations
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
System.Object |
ICloneable.CopyFromSource(Object)
Declaration
void ICloneable.CopyFromSource(object source)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source |