Simplify load fix
This commit is contained in:
@@ -78,23 +78,15 @@ namespace SlaveMatrix
|
|||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
public Type ThisType;
|
public Type ThisType;
|
||||||
|
|
||||||
// Храним только имя типа (можно AQN)
|
//Some how fixes saves (thx GPT)
|
||||||
[OptionalField] private string _thisTypeName;
|
|
||||||
|
|
||||||
[OnSerializing]
|
//So how I am understend it (description)
|
||||||
private void OnSerializing(StreamingContext _)
|
//This Type is empty on deserialization because Type is not serializable
|
||||||
{
|
//We need just init it after deserialization
|
||||||
_thisTypeName = ThisType?.AssemblyQualifiedName
|
|
||||||
?? GetType().AssemblyQualifiedName;
|
|
||||||
}
|
|
||||||
|
|
||||||
[OnDeserialized]
|
[OnDeserialized]
|
||||||
private void OnDeserialized(StreamingContext _)
|
private void OnDeserialized(StreamingContext _) => ThisType = GetType();
|
||||||
{
|
|
||||||
ThisType = _thisTypeName != null
|
|
||||||
? Type.GetType(_thisTypeName, throwOnError: false) ?? GetType()
|
|
||||||
: GetType();
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
public virtual Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user