Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TypeWithHashCode"/> class.
        /// </summary>
        /// <param name="typeName">Name of the type</param>
        public TypeWithHashCode(string typeName)
        {
            try
            {
                Type = System.Type.GetType(SerializedTypeResolver.RevertTypeReplacements(typeName), false);
            }
            catch (FileLoadException)
            {
                // specified type was not found
                // we ignore this error because this case is handled elsewhere
                Type = null;
            }

            if (Type != null)
            {
                ComputeSerializationHashCode();
                ComputeShortTypeName();
            }
        }
Exemplo n.º 2
0
 private void ComputeShortTypeName()
 {
     _shortTypeName = Type.AssemblyQualifiedName;
     _shortTypeName = SerializedTypeResolver.ApplyTypeReplacements(_shortTypeName);
 }