Class TypeNameChangedAttribute
This attribute is for when a class or struct name changes, so that the SerializableType module can find the type in this scenario. If a type name is changed without this attribute, then there may be errors.
Namespace: Mechatronics.SystemGraph
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true)]
public class TypeNameChangedAttribute : Attribute, _Attribute
Constructors
TypeNameChangedAttribute(String, String)
Initializes the attribute
Declaration
public TypeNameChangedAttribute(string formerName, string formerNameSpace = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | formerName | What this type used to be known as, use the typename without any namespace |
| String | formerNameSpace | The name of the OLD namespace, only required if the residing namespace changed. |
Fields
formerTypeNameString
The former type name string
Declaration
protected string formerTypeNameString
Field Value
| Type | Description |
|---|---|
| String |
prefix
The prefix
Declaration
protected string prefix
Field Value
| Type | Description |
|---|---|
| String |
Methods
GetFullName(String)
Given the current full name, returns the full old full name.
Declaration
public string GetFullName(string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | newName | Current full name for the type. |
Returns
| Type | Description |
|---|---|
| String | If the type has not changed namespaces, then simply appends the type name to the given namespace. Otherwise gets full name with new namespace. |