Better whitespace changes
This commit is contained in:
parent
28d8c145b5
commit
6b1e193c90
@ -261,7 +261,8 @@ public record class Recorded<T> : Versioned<T> where T : Recorded<T>
|
|||||||
if( ReferenceEquals( current, next ) )
|
if( ReferenceEquals( current, next ) )
|
||||||
return current;
|
return current;
|
||||||
|
|
||||||
var newMeta = current.Meta with {
|
var newMeta = current.Meta with
|
||||||
|
{
|
||||||
Version = current.Meta.Version + 1,
|
Version = current.Meta.Version + 1,
|
||||||
Reason = reason,
|
Reason = reason,
|
||||||
MemberName = dbgName,
|
MemberName = dbgName,
|
||||||
|
|||||||
@ -186,7 +186,8 @@ namespace lib
|
|||||||
|
|
||||||
doc.Load( reader );
|
doc.Load( reader );
|
||||||
|
|
||||||
if( doc.DocumentElement == null ) return null;
|
if( doc.DocumentElement == null )
|
||||||
|
return null;
|
||||||
|
|
||||||
if( t == null )
|
if( t == null )
|
||||||
return Deserialize( doc.DocumentElement );
|
return Deserialize( doc.DocumentElement );
|
||||||
@ -256,7 +257,8 @@ namespace lib
|
|||||||
{
|
{
|
||||||
TypeCode typeCode = Type.GetTypeCode( type );
|
TypeCode typeCode = Type.GetTypeCode( type );
|
||||||
|
|
||||||
if( _cfg.VerboseLogging ) log.info( $"{type.FriendlyName()}.{name} {existing} {mi?.Name}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"{type.FriendlyName()}.{name} {existing} {mi?.Name}" );
|
||||||
|
|
||||||
if( typeCode != TypeCode.Object )
|
if( typeCode != TypeCode.Object )
|
||||||
{
|
{
|
||||||
@ -276,7 +278,8 @@ namespace lib
|
|||||||
|
|
||||||
if( obj is ser.I_Serialize iser )
|
if( obj is ser.I_Serialize iser )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"" );
|
||||||
obj = iser.OnDeserialize( null );
|
obj = iser.OnDeserialize( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +317,8 @@ namespace lib
|
|||||||
|
|
||||||
private object DeserializeConcrete( XmlElement elem, MemberInfo mi, string name, Type type )
|
private object DeserializeConcrete( XmlElement elem, MemberInfo mi, string name, Type type )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"" );
|
||||||
|
|
||||||
string val = "";
|
string val = "";
|
||||||
|
|
||||||
@ -398,7 +402,8 @@ namespace lib
|
|||||||
|
|
||||||
private object HydrateObject( XmlElement elem, MemberInfo mi, Type finalType, object obj )
|
private object HydrateObject( XmlElement elem, MemberInfo mi, Type finalType, object obj )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"" );
|
||||||
|
|
||||||
if( obj is IList )
|
if( obj is IList )
|
||||||
{
|
{
|
||||||
@ -488,7 +493,8 @@ namespace lib
|
|||||||
|
|
||||||
private object HydrateObjectOfNarrowType( XmlElement elem, MemberInfo mi, Type narrowType, object obj )
|
private object HydrateObjectOfNarrowType( XmlElement elem, MemberInfo mi, Type narrowType, object obj )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"" );
|
||||||
|
|
||||||
var isImm = typeof( io.Obj ).IsAssignableFrom( narrowType );
|
var isImm = typeof( io.Obj ).IsAssignableFrom( narrowType );
|
||||||
|
|
||||||
@ -686,7 +692,8 @@ namespace lib
|
|||||||
|
|
||||||
int refInt = refString.Length > 0 ? Convert.ToInt32( refString ) : -1;
|
int refInt = refString.Length > 0 ? Convert.ToInt32( refString ) : -1;
|
||||||
|
|
||||||
if( _cfg.VerboseLogging ) log.info( $"{finalType?.FriendlyName()}({type?.FriendlyName()}) refInt {refInt} exitingObj = {obj?.ToString()}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"{finalType?.FriendlyName()}({type?.FriendlyName()}) refInt {refInt} exitingObj = {obj?.ToString()}" );
|
||||||
|
|
||||||
obj = createObject( elem, finalType, refInt, obj );
|
obj = createObject( elem, finalType, refInt, obj );
|
||||||
|
|
||||||
@ -695,7 +702,8 @@ namespace lib
|
|||||||
|
|
||||||
private object DeserializeList( XmlElement elem, MemberInfo mi, Type type, IList list )
|
private object DeserializeList( XmlElement elem, MemberInfo mi, Type type, IList list )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"" );
|
||||||
|
|
||||||
XmlNodeList arrNodeList = elem.ChildNodes;
|
XmlNodeList arrNodeList = elem.ChildNodes;
|
||||||
|
|
||||||
@ -731,7 +739,8 @@ namespace lib
|
|||||||
typeElem = typeof( KeyValuePair<,> ).MakeGenericType( type.GenericTypeArguments );
|
typeElem = typeof( KeyValuePair<,> ).MakeGenericType( type.GenericTypeArguments );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _cfg.VerboseLogging ) log.info( $"DserCol {type.GetType().FriendlyName()} {typeElem.Name} into reflT {mi.ReflectedType.FriendlyName()} declT {mi.DeclaringType.FriendlyName()} {mi.Name}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"DserCol {type.GetType().FriendlyName()} {typeElem.Name} into reflT {mi.ReflectedType.FriendlyName()} declT {mi.DeclaringType.FriendlyName()} {mi.Name}" );
|
||||||
|
|
||||||
string refString = elem.GetAttribute( "ref" );
|
string refString = elem.GetAttribute( "ref" );
|
||||||
int refInt = refString.Length > 0 ? Convert.ToInt32( refString ) : -1;
|
int refInt = refString.Length > 0 ? Convert.ToInt32( refString ) : -1;
|
||||||
@ -776,7 +785,8 @@ namespace lib
|
|||||||
|
|
||||||
var typeGen = Type.MakeGenericSignatureType( type );
|
var typeGen = Type.MakeGenericSignatureType( type );
|
||||||
|
|
||||||
if( _cfg.VerboseLogging ) log.info( $"TypeGen: {typeGen.FriendlyName()}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"TypeGen: {typeGen.FriendlyName()}" );
|
||||||
|
|
||||||
if( type == typeof( ImmutableArray<> ).MakeGenericType( typeElem ) )
|
if( type == typeof( ImmutableArray<> ).MakeGenericType( typeElem ) )
|
||||||
{
|
{
|
||||||
@ -833,7 +843,8 @@ namespace lib
|
|||||||
|
|
||||||
private object DeserializeArray( XmlElement elem, MemberInfo mi, Type type )
|
private object DeserializeArray( XmlElement elem, MemberInfo mi, Type type )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"" );
|
||||||
|
|
||||||
Type typeElem = type.GetElementType();
|
Type typeElem = type.GetElementType();
|
||||||
|
|
||||||
@ -883,7 +894,8 @@ namespace lib
|
|||||||
|
|
||||||
if( _cfg.datastructure == Datastructure.Graph && refInt > 0 && m_alreadySerialized.ContainsKey( refInt ) )
|
if( _cfg.datastructure == Datastructure.Graph && refInt > 0 && m_alreadySerialized.ContainsKey( refInt ) )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"Reuse object" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"Reuse object" );
|
||||||
return m_alreadySerialized[refInt];
|
return m_alreadySerialized[refInt];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -893,7 +905,8 @@ namespace lib
|
|||||||
|
|
||||||
if( isProxy )
|
if( isProxy )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"use Proxy" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"use Proxy" );
|
||||||
object obj = null;
|
object obj = null;
|
||||||
|
|
||||||
var tryType = type;
|
var tryType = type;
|
||||||
@ -937,7 +950,8 @@ namespace lib
|
|||||||
|
|
||||||
if( isSubclass )
|
if( isSubclass )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"Using existing obj {existingObj?.ToString()}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"Using existing obj {existingObj?.ToString()}" );
|
||||||
return existingObj;
|
return existingObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -953,12 +967,14 @@ namespace lib
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"For {type.FriendlyName()} check for constructors" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"For {type.FriendlyName()} check for constructors" );
|
||||||
|
|
||||||
var cons = type.GetConstructor( Type.EmptyTypes );
|
var cons = type.GetConstructor( Type.EmptyTypes );
|
||||||
if( cons != null )
|
if( cons != null )
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"Activator.CreateInstance" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"Activator.CreateInstance" );
|
||||||
obj = Activator.CreateInstance( type );
|
obj = Activator.CreateInstance( type );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -967,15 +983,18 @@ namespace lib
|
|||||||
obj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject( type );
|
obj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject( type );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _cfg.VerboseLogging ) log.info( $"Got obj {obj?.ToString()}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"Got obj {obj?.ToString()}" );
|
||||||
}
|
}
|
||||||
catch( Exception )
|
catch( Exception )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if( _cfg.VerboseLogging ) log.info( $"GetUninitializedObject" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"GetUninitializedObject" );
|
||||||
obj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject( type );
|
obj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject( type );
|
||||||
if( _cfg.VerboseLogging ) log.info( $"Got obj {obj?.ToString()}" );
|
if( _cfg.VerboseLogging )
|
||||||
|
log.info( $"Got obj {obj?.ToString()}" );
|
||||||
}
|
}
|
||||||
catch( Exception exInner )
|
catch( Exception exInner )
|
||||||
{
|
{
|
||||||
@ -1323,8 +1342,10 @@ namespace lib
|
|||||||
|
|
||||||
if( isImm )
|
if( isImm )
|
||||||
{
|
{
|
||||||
if( name == "MetaStorage" ) continue;
|
if( name == "MetaStorage" )
|
||||||
if( name == "Fn" ) continue;
|
continue;
|
||||||
|
if( name == "Fn" )
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !doAtt.Any() && FilterField( filterFields, doImpls, whitelistFields, childFi as MemberInfo, name ) )
|
if( !doAtt.Any() && FilterField( filterFields, doImpls, whitelistFields, childFi as MemberInfo, name ) )
|
||||||
@ -1365,8 +1386,10 @@ namespace lib
|
|||||||
|
|
||||||
if( isImm )
|
if( isImm )
|
||||||
{
|
{
|
||||||
if( name == "MetaStorage" ) continue;
|
if( name == "MetaStorage" )
|
||||||
if( name == "Fn" ) continue;
|
continue;
|
||||||
|
if( name == "Fn" )
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( FilterField( filterProps, doImpls, whitelistProps, childPi as MemberInfo, name ) )
|
if( FilterField( filterProps, doImpls, whitelistProps, childPi as MemberInfo, name ) )
|
||||||
@ -1413,8 +1436,10 @@ namespace lib
|
|||||||
Type type = root.GetType();
|
Type type = root.GetType();
|
||||||
|
|
||||||
Type typeOfMember = typeof( object );
|
Type typeOfMember = typeof( object );
|
||||||
if( mi is FieldInfo fi ) typeOfMember = fi.FieldType;
|
if( mi is FieldInfo fi )
|
||||||
if( mi is PropertyInfo pi ) typeOfMember = pi.PropertyType;
|
typeOfMember = fi.FieldType;
|
||||||
|
if( mi is PropertyInfo pi )
|
||||||
|
typeOfMember = pi.PropertyType;
|
||||||
if( typeOfMember != type )
|
if( typeOfMember != type )
|
||||||
{
|
{
|
||||||
log.info( $"SerArr {typeOfMember.FriendlyName()} {mi?.Name} != {type.FriendlyName()}" );
|
log.info( $"SerArr {typeOfMember.FriendlyName()} {mi?.Name} != {type.FriendlyName()}" );
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.5.002.0
|
VisualStudioVersion = 17.5.002.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user