Added some read-only attributes to the cloner implementations

git-svn-id: file:///srv/devel/repo-conversion/nusu@266 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2012-03-06 13:45:33 +00:00
parent 21754b8e87
commit f3652ac4db
3 changed files with 15 additions and 8 deletions

View File

@ -299,7 +299,6 @@ namespace Nuclex.Support.Cloning {
variables.Add(clone);
int dimensionCount = clonedType.GetArrayRank();
int baseVariableIndex = variables.Count;
Type elementType = clonedType.GetElementType();
var lengths = new List<ParameterExpression>();

View File

@ -263,13 +263,21 @@ namespace Nuclex.Support.Cloning {
}
/// <summary>Compiled cloners that perform shallow clone operations</summary>
private static ConcurrentDictionary<Type, Func<object, object>> shallowFieldBasedCloners;
private static readonly ConcurrentDictionary<
Type, Func<object, object>
> shallowFieldBasedCloners;
/// <summary>Compiled cloners that perform deep clone operations</summary>
private static ConcurrentDictionary<Type, Func<object, object>> deepFieldBasedCloners;
private static readonly ConcurrentDictionary<
Type, Func<object, object>
> deepFieldBasedCloners;
/// <summary>Compiled cloners that perform shallow clone operations</summary>
private static ConcurrentDictionary<Type, Func<object, object>> shallowPropertyBasedCloners;
private static readonly ConcurrentDictionary<
Type, Func<object, object>
> shallowPropertyBasedCloners;
/// <summary>Compiled cloners that perform deep clone operations</summary>
private static ConcurrentDictionary<Type, Func<object, object>> deepPropertyBasedCloners;
private static readonly ConcurrentDictionary<
Type, Func<object, object>
> deepPropertyBasedCloners;
}

View File

@ -92,7 +92,7 @@ namespace Nuclex.Support.Cloning {
}
/// <summary>Surrogate the that will be selected for any non-primitive types</summary>
private ISerializationSurrogate staticSurrogate;
private readonly ISerializationSurrogate staticSurrogate;
/// <summary>Surrogate selector to escalate to if no surrogate can be provided</summary>
private ISurrogateSelector chainedSelector;
@ -321,9 +321,9 @@ namespace Nuclex.Support.Cloning {
}
/// <summary>Serializes objects by storing their fields</summary>
private static BinaryFormatter fieldBasedFormatter;
private static readonly BinaryFormatter fieldBasedFormatter;
/// <summary>Serializes objects by storing their properties</summary>
private static BinaryFormatter propertyBasedFormatter;
private static readonly BinaryFormatter propertyBasedFormatter;
}