diff --git a/.gitignore b/.gitignore index 317965c..8d57790 100644 --- a/.gitignore +++ b/.gitignore @@ -149,4 +149,6 @@ $RECYCLE.BIN/ # NuGet Packages lib/Packages/ -src/packages/ \ No newline at end of file +src/packages/ + +.idea/ \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..691c9ec --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,16 @@ + + + 2.0.0.0 + 2.0.0 + $(Version) + Thong Nguyen + + Platform.NET + Copyright 2003-$([System.DateTime]::Now.Year) Thong Nguyen + BSD-3-Clause + https://github.com/platformdotnet/Platform + + + + + \ No newline at end of file diff --git a/src/Platform.Xml.Serialization/Attributes/XmlSerializationAttribute.cs b/src/Platform.Xml.Serialization/Attributes/XmlSerializationAttribute.cs deleted file mode 100644 index e781353..0000000 --- a/src/Platform.Xml.Serialization/Attributes/XmlSerializationAttribute.cs +++ /dev/null @@ -1,317 +0,0 @@ -using System; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)] - public class XmlTreatAsNullIfEmptyAttribute - : XmlSerializationAttribute - { - } - - public class XmlSerializeBaseAttribute - : XmlSerializationAttribute - { - /// - /// - /// - public bool SerializeBase - { - get - { - return m_SerializeBase; - } - - set - { - m_SerializeBase = value; - } - } - /// - /// - /// - private bool m_SerializeBase; - - public XmlSerializeBaseAttribute() - { - } - - public XmlSerializeBaseAttribute(bool serializeBase) - { - m_SerializeBase = serializeBase; - } - } - - public class XmlSerializationAttribute - : Attribute - { - public XmlSerializationAttribute() - { - } - - /// - /// - /// - public string ConditionName - { - get - { - return m_ConditionName; - } - - set - { - m_ConditionName = value; - } - } - /// - /// - /// - private string m_ConditionName = ""; - - /// - /// - /// - public object ConditionValue - { - get - { - return m_ConditionValue; - } - - set - { - m_ConditionValue = value; - } - } - /// - /// - /// - private object m_ConditionValue; - - /// - /// Tests if this attribute should be applied/considered when serializing. - /// - /// - /// - public virtual bool Applies(SerializerOptions options) - { - if (m_ConditionName.Length > 0) - { - object o = options[m_ConditionName]; - - if (o == null) - { - return false; - } - - if (!o.Equals(m_ConditionValue)) - { - return false; - } - } - - return true; - } - } - - [ - AttributeUsage - ( - AttributeTargets.Class | AttributeTargets.Struct | - AttributeTargets.Interface | AttributeTargets.Field | - AttributeTargets.Property, - Inherited = true, AllowMultiple = true - ) - ] - public abstract class XmlApproachAttribute - : XmlSerializationAttribute - { - /// - /// The name to serialize the member as. - /// - public virtual string Name - { - get - { - return m_Name; - } - - set - { - m_Name = value; - } - } - /// - /// - /// - protected string m_Name = ""; - - /// - /// The type of the member. - /// - /// - /// If this property is null then the declared type of the member is used. - /// - public virtual Type Type - { - get - { - return m_Type; - } - - set - { - m_Type = value; - } - } - /// - /// - /// - protected Type m_Type; - - /// - /// Property TypeSerializerType (Type) - /// - public virtual Type TypeSerializerType - { - get - { - return this.m_TypeSerializerType; - } - set - { - this.m_TypeSerializerType = value; - } - } - /// - /// - /// - protected Type m_TypeSerializerType; - - public XmlApproachAttribute() - { - } - - public XmlApproachAttribute(Type type) - : this("", type) - { - } - - public XmlApproachAttribute(string name) - { - m_Name = name; - } - - public XmlApproachAttribute(string name, Type type) - { - m_Type = type; - m_Name = name; - } - } - - [ - AttributeUsage - ( - AttributeTargets.Class | AttributeTargets.Struct | - AttributeTargets.Interface | AttributeTargets.Field | - AttributeTargets.Property, - Inherited = true, AllowMultiple = true - ) - ] - public class XmlAttributeAttribute - : XmlApproachAttribute - { - public XmlAttributeAttribute() - { - } - - public XmlAttributeAttribute(Type type) - : base(type) - { - } - - public XmlAttributeAttribute(string name) - : base(name) - { - } - - public XmlAttributeAttribute(string name, Type type) - : base(name, type) - { - } - } - - [ - AttributeUsage - ( - AttributeTargets.Class | AttributeTargets.Struct | - AttributeTargets.Interface | AttributeTargets.Field | - AttributeTargets.Property, - Inherited = true, AllowMultiple = true - ) - ] - public class XmlElementAttribute - : XmlApproachAttribute - { - public XmlElementAttribute() - { - } - - public XmlElementAttribute(Type type) - : base(type) - { - } - - public XmlElementAttribute(string name) - : base(name) - { - } - - public XmlElementAttribute(string name, Type type) - : base(name, type) - { - } - } - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = true)] - public class XmlCDataAttribute - : XmlSerializationAttribute - { - /// - /// - /// - public bool Enabled - { - get - { - return m_Enabled; - } - - set - { - m_Enabled = value; - } - } - /// - /// - /// - private bool m_Enabled; - - public XmlCDataAttribute() - { - m_Enabled = true; - } - - public XmlCDataAttribute(bool enabled) - { - m_Enabled = enabled; - } - } - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = true)] - public class XmlTextAttribute - : XmlSerializationAttribute - { - } -} diff --git a/src/Platform.Xml.Serialization/Attributes/XmlTypeSerializerTypeAttribute.cs b/src/Platform.Xml.Serialization/Attributes/XmlTypeSerializerTypeAttribute.cs deleted file mode 100644 index d00855c..0000000 --- a/src/Platform.Xml.Serialization/Attributes/XmlTypeSerializerTypeAttribute.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - public class XmlTypeSerializerTypeAttribute - : XmlSerializationAttribute - { - /// - /// - /// - public Type SerializerType - { - get - { - return m_SerializerType; - } - - set - { - m_SerializerType = value; - } - } - /// - /// - /// - private Type m_SerializerType; - - /// - /// - /// - /// - public XmlTypeSerializerTypeAttribute(Type serializerType) - { - m_SerializerType = serializerType; - } - } -} diff --git a/src/Platform.Xml.Serialization/ColorSerializer.cs b/src/Platform.Xml.Serialization/ColorSerializer.cs deleted file mode 100644 index b2832ce..0000000 --- a/src/Platform.Xml.Serialization/ColorSerializer.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Drawing; - -namespace Platform.Xml.Serialization -{ - public class ColorSerializer - : StringableTypeSerializer - { - public ColorSerializer(Type type, SerializationMemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - : base(type, memberInfo, cache,options) - { - } - - public override string Serialize(object obj, SerializationContext state) - { - if (obj == null) - { - return ""; - } - - if (((Color)obj).ToKnownColor() != 0) - { - return ((Color)obj).Name; - } - else - { - return ColorTranslator.ToHtml((Color)obj); - } - } - - /// - /// - /// - public override object Deserialize(string value, SerializationContext state) - { - try - { - return ColorTranslator.FromHtml(value); - } - catch (Exception) - { - return Color.FromName(value); - } - } - } -} \ No newline at end of file diff --git a/src/Platform.Xml.Serialization/ISerializationStateListener.cs b/src/Platform.Xml.Serialization/ISerializationStateListener.cs deleted file mode 100644 index e6cd9c5..0000000 --- a/src/Platform.Xml.Serialization/ISerializationStateListener.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - /// - /// Interface for objects that want to know when they're being serialized by - /// an XmlSerializer. - /// - public interface ISerializationStateListener - { - /// - /// Called when the object is about to be serialized. - /// - /// - /// This method is called on an object before its properties have been serilized. - /// - /// - void SerializationStart(SerializationParameters parameters); - - /// - /// Called when an object has been serialized. - /// - /// - /// This method is called on an object after its properties have been serialized. - /// - /// - void SerializationEnd(SerializationParameters parameters); - - /// - /// Called when an object is about to be deserialized. - /// - /// - /// This method is called on an object after it has been constructed but - /// before its properties have been set. - /// - /// - void DeserializationStart(SerializationParameters parameters); - - /// - /// Called when an object has been deseriazlied. - /// - /// - /// This method is called on an object after its properties have been set. - /// - /// - void DeserializationEnd(SerializationParameters parameters); - } -} \ No newline at end of file diff --git a/src/Platform.Xml.Serialization/ISerializationUnknownNodeListener.cs b/src/Platform.Xml.Serialization/ISerializationUnknownNodeListener.cs deleted file mode 100644 index 7f2aca2..0000000 --- a/src/Platform.Xml.Serialization/ISerializationUnknownNodeListener.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Xml; - -namespace Platform.Xml.Serialization -{ - /// - /// - public interface ISerializationUnhandledMarkupListener - { - void UnhandledAttribute(string name, string value); - void UnhandledOther(string markup); - } -} diff --git a/src/Platform.Xml.Serialization/Platform.Xml.Serialization.csproj b/src/Platform.Xml.Serialization/Platform.Xml.Serialization.csproj index 62dec03..018a738 100644 --- a/src/Platform.Xml.Serialization/Platform.Xml.Serialization.csproj +++ b/src/Platform.Xml.Serialization/Platform.Xml.Serialization.csproj @@ -1,284 +1,21 @@ - - - - Local - 9.0.21022 - 2.0 - {CBB73076-7381-4FDD-907F-7097A8AB04E6} - Debug - AnyCPU - - - - - Platform.Xml.Serialization - - - JScript - Grid - IE50 - false - Library - Platform.Xml.Serialization - OnBuildSuccess - - - - - 3.5 - - - false - v4.5.2 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - false - ManagedMinimumRules.ruleset - 6 - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - true - 4096 - false - - - true - false - false - false - 4 - false - full - - - - System - ..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll - - - System.Data - ..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll - - - - System.XML - ..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll - - - - - - Code - - - - - - - - - - - - - - Code - - - Code - - - - - True - True - TextResources.resx - - - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - - - - - - - - - - - Code - - - - - Code - - - - Code - - - Code - - - Code - - - Code - - - - - Code - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - ResXFileCodeGenerator - TextResources.Designer.cs - Designer - - - - - {31199c34-a7f0-4d69-b2cf-e9ce05262618} - Platform - - - - - - - - - + + + + netstandard2.0 + + Platform.Xml.Serialization + Platform.NET XmlSerialization Library + A cross-platform, clean and extensible XML serializer for .NET + platform xml serialization serializer + + + + + + + + + + + \ No newline at end of file diff --git a/src/Platform.Xml.Serialization/Properties/AssemblyInfo.cs b/src/Platform.Xml.Serialization/Properties/AssemblyInfo.cs deleted file mode 100644 index ca1de5c..0000000 --- a/src/Platform.Xml.Serialization/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Reflection; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("Platform.Xml.Serialization")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Copyright © 2005-2013 Thong Nguyen (tumtumtum@gmail.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/src/Platform.Xml.Serialization/StandardTypeSerializerFactory.cs b/src/Platform.Xml.Serialization/StandardTypeSerializerFactory.cs index 3d3eb09..9da50fd 100644 --- a/src/Platform.Xml.Serialization/StandardTypeSerializerFactory.cs +++ b/src/Platform.Xml.Serialization/StandardTypeSerializerFactory.cs @@ -48,10 +48,6 @@ public override TypeSerializer NewTypeSerializerBySupportedType(Type supportedTy { return new GuidSerializer(supportedType, memberInfo, cache, options); } - else if (supportedType == typeof(Color)) - { - return new ColorSerializer(supportedType, memberInfo, cache, options); - } else if (supportedType == typeof(DateTime)) { return new DateTimeTypeSerializer(memberInfo, cache, options); @@ -74,7 +70,7 @@ public override TypeSerializer NewTypeSerializerBySupportedType(Type supportedTy implementsGenericList = supportedType.FindInterfaces ( - (type, criterea) => type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IList<>), + (type, criteria) => type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IList<>), null ).Length > 0; diff --git a/src/Platform.Xml.Serialization/TypeSerializers/AnyTypeTypeSerializer.cs b/src/Platform.Xml.Serialization/TypeSerializers/AnyTypeTypeSerializer.cs deleted file mode 100644 index d761885..0000000 --- a/src/Platform.Xml.Serialization/TypeSerializers/AnyTypeTypeSerializer.cs +++ /dev/null @@ -1,361 +0,0 @@ -using System; -using System.Xml; -using System.Reflection; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - /// - /// - /// - public class AnyTypeTypeSerializer - : TypeSerializer - { - private sealed class LightSerializationMember - { - public MemberGetter Getter; - public MemberSetter Setter; - public TypeSerializer Serializer; - public bool SerializeAsCData; - public MemberInfo MemberInfo; - public string SerializedName; - public bool XmlTreatAsNullIfEmpty; - public Type LogicalType; - - public LightSerializationMember(SerializationMemberInfo memberInfo) - { - this.Getter = memberInfo.Getter; - this.Setter = memberInfo.Setter; - this.Serializer = memberInfo.Serializer; - this.MemberInfo = memberInfo.MemberInfo; - this.SerializedName = memberInfo.GetSerializedName(); - this.SerializeAsCData = memberInfo.SerializeAsCData; - this.XmlTreatAsNullIfEmpty = memberInfo.HasApplicableAttribute(typeof(XmlTreatAsNullIfEmptyAttribute)); - this.LogicalType = memberInfo.LogicalType; - } - - public object GetValue(object obj) - { - return Getter(MemberInfo, obj); - } - - public void SetValue(object obj, object value) - { - Setter(MemberInfo, obj, value); - } - } - - /// - /// - /// - protected IDictionary m_ElementMembersMap; - - /// - /// - /// - protected IDictionary m_AttributeMembersMap; - - /// - /// - /// - public override Type SupportedType - { - get - { - return m_Type; - } - } - private Type m_Type; - - /// - /// - /// - /// - /// - /// - public AnyTypeTypeSerializer(Type type, TypeSerializerCache cache, SerializerOptions options) - { - m_Type = type; - - m_ElementMembersMap = new SortedList(0x10); - m_AttributeMembersMap = new SortedList(0x10); - - cache.Add(this); - - Scan(cache, options); - } - - /// - /// - /// - /// - /// - private void Scan(TypeSerializerCache cache, SerializerOptions options) - { - Type type; - FieldInfo[] fields; - PropertyInfo[] properties; - - type = m_Type; - - while (type != typeof(object) && type != null) - { - fields = m_Type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - properties = m_Type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - - foreach (FieldInfo field in fields) - { - AddMember(field, cache, options); - } - - foreach (PropertyInfo property in properties) - { - AddMember(property, cache, options); - } - - object[] attribs; - bool serializeBase = true; - - attribs = type.GetCustomAttributes(typeof(XmlSerializeBaseAttribute), false); - - foreach (XmlSerializeBaseAttribute attrib in attribs) - { - if (attrib.Applies(options)) - { - if (attrib.SerializeBase) - { - serializeBase = true; - } - } - } - - if (!serializeBase) - { - break; - } - - type = type.BaseType; - } - } - - /// - /// - /// - /// - /// - /// - private void AddMember(MemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - SerializationMemberInfo serializationMemberInfo; - - serializationMemberInfo = new SerializationMemberInfo(memberInfo, options, cache); - - if (serializationMemberInfo.SerializedNodeType == XmlNodeType.Element) - { - m_ElementMembersMap[serializationMemberInfo.GetSerializedName()] = new LightSerializationMember(serializationMemberInfo); - - return; - } - else if (serializationMemberInfo.SerializedNodeType == XmlNodeType.Attribute) - { - if (!(serializationMemberInfo.Serializer is TypeSerializerWithSimpleTextSupport)) - { - throw new InvalidOperationException("Serializer for member doesn't support serializing to an attribute."); - } - - m_AttributeMembersMap[serializationMemberInfo.GetSerializedName()] = new LightSerializationMember(serializationMemberInfo); - } - } - - /// - /// - /// - /// - /// - /// - public override void Serialize(object obj, XmlWriter writer, SerializationState state) - { - TypeSerializerWithSimpleTextSupport simpleSerializer; - - state.SerializationStart(obj); - - try - { - // Serialize attributes... - - foreach (LightSerializationMember smi in m_AttributeMembersMap.Values) - { - object val; - - val = smi.GetValue(obj); - - if (smi.XmlTreatAsNullIfEmpty) - { - if (smi.LogicalType.IsValueType) - { - if (Activator.CreateInstance(smi.LogicalType).Equals(obj)) - { - val = null; - } - } - } - - if (state.ShouldSerialize(val)) - { - simpleSerializer = (TypeSerializerWithSimpleTextSupport)smi.Serializer; - - writer.WriteStartAttribute(smi.SerializedName, ""); - writer.WriteString(simpleSerializer.Serialize(val, state)); - writer.WriteEndAttribute(); - } - } - - // Serialize elements... - - foreach (LightSerializationMember smi in m_ElementMembersMap.Values) - { - object val; - - val = smi.GetValue(obj); - - if (smi.XmlTreatAsNullIfEmpty) - { - if (smi.LogicalType.IsValueType) - { - if (Activator.CreateInstance(smi.LogicalType).Equals(val)) - { - val = null; - } - } - } - - if (smi.SerializeAsCData) - { - simpleSerializer = smi.Serializer as TypeSerializerWithSimpleTextSupport; - } - else - { - simpleSerializer = null; - } - - if (state.ShouldSerialize(val)) - { - writer.WriteStartElement(smi.SerializedName, ""); - - if (simpleSerializer != null) - { - writer.WriteCData(simpleSerializer.Serialize(val, state)); - } - else - { - smi.Serializer.Serialize(val, writer, state); - } - - writer.WriteEndElement(); - } - } - - } - finally - { - state.SerializationEnd(obj); - } - } - - /// - /// - /// - /// - /// - /// - public override object Deserialize(XmlReader reader, SerializationState state) - { - object retval; - LightSerializationMember serializationMember; - ISerializationUnhandledMarkupListener uhm; - - retval = Activator.CreateInstance(m_Type); - - state.DeserializationStart(retval); - - uhm = retval as ISerializationUnhandledMarkupListener; - - if (reader.AttributeCount > 0) - { - for (int i = 0; i < reader.AttributeCount; i++) - { - reader.MoveToAttribute(i); - - serializationMember = (LightSerializationMember)m_AttributeMembersMap[reader.Name]; - - if (serializationMember == null) - { - // Unknown attribute. - - if (uhm != null) - { - uhm.UnhandledAttribute(reader.Name, reader.Value); - } - } - else - { - serializationMember.SetValue(retval, serializationMember.Serializer.Deserialize(reader, state)); - } - } - - reader.MoveToElement(); - } - - if (reader.IsEmptyElement) - { - reader.ReadStartElement(); - - return retval; - } - - reader.ReadStartElement(); - - // Read elements - - while (true) - { - XmlReaderHelper.ReadUntilAnyTypesReached(reader, - new XmlNodeType[] { XmlNodeType.Element, XmlNodeType.EndElement}); - - if (reader.NodeType == XmlNodeType.Element) - { - serializationMember = (LightSerializationMember)m_ElementMembersMap[reader.Name]; - - if (serializationMember == null) - { - // Unknown element. - } - else - { - serializationMember.SetValue(retval, serializationMember.Serializer.Deserialize(reader, state)); - } - } - else - { - if (reader.NodeType == XmlNodeType.EndElement) - { - reader.ReadEndElement(); - } - else - { - if (uhm != null) - { - uhm.UnhandledOther(reader.ReadOuterXml()); - } - } - - break; - } - } - - state.DeserializationEnd(retval); - - return retval; - } - } -} diff --git a/src/Platform.Xml.Serialization/TypeSerializers/ComplexTypeTypeSerializer.cs b/src/Platform.Xml.Serialization/TypeSerializers/ComplexTypeTypeSerializer.cs deleted file mode 100644 index 0b4bab0..0000000 --- a/src/Platform.Xml.Serialization/TypeSerializers/ComplexTypeTypeSerializer.cs +++ /dev/null @@ -1,380 +0,0 @@ -using System; -using System.Xml; -using System.Reflection; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - /// - /// - /// - public class ComplexTypeTypeSerializer - : TypeSerializer - { - /// - /// - /// - protected IDictionary m_ElementMembersMap; - - /// - /// - /// - protected IDictionary m_AttributeMembersMap; - - /// - /// - /// - public override Type SupportedType - { - get - { - return m_Type; - } - } - private Type m_Type; - - /// - /// - /// - /// - /// - /// - public ComplexTypeTypeSerializer(Type type, TypeSerializerCache cache, SerializerOptions options) - { - m_Type = type; - - m_ElementMembersMap = new Hashtable(0x10); - m_AttributeMembersMap = new Hashtable(0x10); - - cache.Add(this); - - Scan(cache, options); - } - - /// - /// - /// - /// - /// - private void Scan(TypeSerializerCache cache, SerializerOptions options) - { - Type type; - FieldInfo[] fields; - PropertyInfo[] properties; - - type = m_Type; - - while (type != typeof(object) && type != null) - { - fields = m_Type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - properties = m_Type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - - foreach (FieldInfo field in fields) - { - AddMember(field, cache, options); - } - - foreach (PropertyInfo property in properties) - { - AddMember(property, cache, options); - } - - object[] attribs; - bool serializeBase = true; - - attribs = type.GetCustomAttributes(typeof(XmlSerializeBaseAttribute), false); - - foreach (XmlSerializeBaseAttribute attrib in attribs) - { - if (attrib.Applies(options)) - { - if (attrib.SerializeBase) - { - serializeBase = true; - } - } - } - - if (!serializeBase) - { - break; - } - - type = type.BaseType; - } - } - - /// - /// - /// - /// - /// - /// - private void AddMember(MemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - SerializationMemberInfo serializationMemberInfo; - - serializationMemberInfo = new SerializationMemberInfo(memberInfo, options, cache); - - if (serializationMemberInfo.SerializedNodeType == XmlNodeType.Element) - { - if (serializationMemberInfo.Namespace.Length > 0) - { - m_ElementMembersMap[serializationMemberInfo.Namespace + (char)0xff + serializationMemberInfo.SerializedName] = serializationMemberInfo; - } - else - { - m_ElementMembersMap[serializationMemberInfo.SerializedName] = serializationMemberInfo; - } - - return; - } - else if (serializationMemberInfo.SerializedNodeType == XmlNodeType.Attribute) - { - if (!(serializationMemberInfo.Serializer is TypeSerializerWithSimpleTextSupport)) - { - throw new InvalidOperationException("Serializer for member doesn't support serializing to an attribute."); - } - - if (serializationMemberInfo.Namespace.Length > 0) - { - m_AttributeMembersMap[serializationMemberInfo.Namespace + (char)0xff + serializationMemberInfo.SerializedName] = serializationMemberInfo; - } - else - { - m_AttributeMembersMap[serializationMemberInfo.SerializedName] = serializationMemberInfo; - } - } - } - - /// - /// - /// - /// - /// - /// - public override void Serialize(object obj, XmlWriter writer, SerializationState state) - { - TypeSerializerWithSimpleTextSupport simpleSerializer; - - state.SerializationStart(obj); - - try - { - // Serialize attributes... - - foreach (SerializationMemberInfo smi in m_AttributeMembersMap.Values) - { - object val; - - val = smi.GetValue(obj); - - if (smi.TreatAsNullIfEmpty) - { - if (smi.LogicalType.IsValueType) - { - if (Activator.CreateInstance(smi.LogicalType).Equals(obj)) - { - val = null; - } - } - } - - if (state.ShouldSerialize(val)) - { - simpleSerializer = (TypeSerializerWithSimpleTextSupport)smi.Serializer; - - writer.WriteStartAttribute(smi.SerializedName, ""); - writer.WriteString(simpleSerializer.Serialize(val, state)); - writer.WriteEndAttribute(); - } - } - - // Serialize elements... - - foreach (SerializationMemberInfo smi in m_ElementMembersMap.Values) - { - object val; - - val = smi.GetValue(obj); - - if (smi.TreatAsNullIfEmpty) - { - if (smi.LogicalType.IsValueType) - { - if (Activator.CreateInstance(smi.LogicalType).Equals(val)) - { - val = null; - } - } - } - - simpleSerializer = smi.Serializer as TypeSerializerWithSimpleTextSupport; - - if (state.ShouldSerialize(val)) - { - if (smi.Namespace.Length > 0) - { - writer.WriteStartElement(state.Parameters.Namespaces.GetPrefix(smi.Namespace), smi.SerializedName, smi.Namespace); - } - else - { - writer.WriteStartElement(smi.SerializedName, ""); - } - - if (smi.SerializeAsValueNodeAttributeName != null) - { - writer.WriteAttributeString(smi.SerializeAsValueNodeAttributeName, val.ToString()); - } - else if (smi.SerializeAsCData) - { - writer.WriteCData(simpleSerializer.Serialize(val, state)); - } - else - { - smi.Serializer.Serialize(val, writer, state); - } - - writer.WriteEndElement(); - } - } - - } - finally - { - state.SerializationEnd(obj); - } - } - - /// - /// - /// - /// - /// - /// - public override object Deserialize(XmlReader reader, SerializationState state) - { - object retval; - SerializationMemberInfo serializationMember; - ISerializationUnhandledMarkupListener uhm; - - retval = Activator.CreateInstance(m_Type); - - state.DeserializationStart(retval); - - uhm = retval as ISerializationUnhandledMarkupListener; - - if (reader.AttributeCount > 0) - { - for (int i = 0; i < reader.AttributeCount; i++) - { - reader.MoveToAttribute(i); - - if (reader.Prefix == "xmlns") - { - continue; - } - - if (reader.Prefix.Length > 0) - { - serializationMember = (SerializationMemberInfo)m_AttributeMembersMap[state.Parameters.Namespaces.GetNamespace(reader.Prefix) + (char)0xff + reader.LocalName]; - } - else - { - serializationMember = (SerializationMemberInfo)m_AttributeMembersMap[reader.Name]; - } - - if (serializationMember == null) - { - // Unknown attribute. - - if (uhm != null) - { - uhm.UnhandledAttribute(reader.Name, reader.Value); - } - } - else - { - serializationMember.SetValue(retval, serializationMember.Serializer.Deserialize(reader, state)); - } - } - - reader.MoveToElement(); - } - - if (reader.IsEmptyElement) - { - reader.ReadStartElement(); - - return retval; - } - - reader.ReadStartElement(); - - // Read elements - - while (true) - { - XmlReaderHelper.ReadUntilAnyTypesReached(reader, - new XmlNodeType[] { XmlNodeType.Element, XmlNodeType.EndElement}); - - if (reader.NodeType == XmlNodeType.Element) - { - if (reader.Prefix.Length > 0) - { - serializationMember = (SerializationMemberInfo)m_ElementMembersMap[state.Parameters.Namespaces.GetNamespace(reader.Prefix) + (char)0xff + reader.LocalName]; - } - else - { - serializationMember = (SerializationMemberInfo)m_ElementMembersMap[reader.LocalName]; - } - - if (serializationMember == null) - { - // Unknown element. - reader.Read(); - XmlReaderHelper.ReadAndApproachMatchingEndElement(reader); - } - else - { - if (serializationMember.SerializeAsValueNodeAttributeName != null - && serializationMember.Serializer is TypeSerializerWithSimpleTextSupport) - { - string s; - - s = reader.GetAttribute(serializationMember.SerializeAsValueNodeAttributeName); - - serializationMember.SetValue(retval, ((TypeSerializerWithSimpleTextSupport)(serializationMember.Serializer)).Deserialize(s, state)); - - XmlReaderHelper.ReadAndConsumeMatchingEndElement(reader); - } - else - { - serializationMember.SetValue(retval, serializationMember.Serializer.Deserialize(reader, state)); - } - } - } - else - { - if (reader.NodeType == XmlNodeType.EndElement) - { - reader.ReadEndElement(); - } - else - { - if (uhm != null) - { - uhm.UnhandledOther(reader.ReadOuterXml()); - } - } - - break; - } - } - - state.DeserializationEnd(retval); - - return retval; - } - } -} diff --git a/src/Platform.Xml.Serialization/TypeSerializers/DateTimeTypeSerializer.cs b/src/Platform.Xml.Serialization/TypeSerializers/DateTimeTypeSerializer.cs deleted file mode 100644 index b60f1df..0000000 --- a/src/Platform.Xml.Serialization/TypeSerializers/DateTimeTypeSerializer.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Xml; -using System.Reflection; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - #region DateTime attributes - /// - /// - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = true)] - public class XmlDateTimeFormatAttribute - : XmlSerializationAttribute - { - /// - /// - /// - public string Format - { - get - { - return m_Format; - } - - set - { - m_Format = value; - } - } - /// - /// - /// - private string m_Format; - - public XmlDateTimeFormatAttribute(string format) - { - m_Format = format; - } - } - #endregion - - /// - /// - /// - /// - public class DateTimeTypeSerializer - : TypeSerializerWithSimpleTextSupport - { - private bool m_FormatSpecified = false; - - /// - /// - /// - private XmlDateTimeFormatAttribute m_FormatAttribute; - - /// - /// - /// - public override bool MemberBound - { - get - { - return true; - } - } - - /// - /// - /// - public override Type SupportedType - { - get - { - return typeof(DateTime); - } - } - - /// - /// - /// - /// - /// - /// - public DateTimeTypeSerializer(SerializationMemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - m_FormatAttribute = (XmlDateTimeFormatAttribute)memberInfo.GetFirstApplicableAttribute(typeof(XmlDateTimeFormatAttribute)); - - if (m_FormatAttribute == null) - { - m_FormatAttribute = new XmlDateTimeFormatAttribute("G"); - m_FormatSpecified = false; - } - } - - /// - /// - /// - public override string Serialize(object obj, SerializationState state) - { - return ((DateTime)obj).ToString(m_FormatAttribute.Format); - } - - /// - /// - /// - public override object Deserialize(string value, SerializationState state) - { - if (m_FormatSpecified) - { - try - { - // Try parsing using the specified format. - - return DateTime.ParseExact(value, m_FormatAttribute.Format, System.Globalization.CultureInfo.CurrentCulture); - } - catch - { - } - } - - // Try parsing with the system supplied strategy. - - return DateTime.Parse(value); - } - } -} \ No newline at end of file diff --git a/src/Platform.Xml.Serialization/TypeSerializers/DictionaryTypeSerializer.cs b/src/Platform.Xml.Serialization/TypeSerializers/DictionaryTypeSerializer.cs deleted file mode 100644 index 6f7e561..0000000 --- a/src/Platform.Xml.Serialization/TypeSerializers/DictionaryTypeSerializer.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Xml; -using System.Reflection; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - public class DictionaryElementTypeAttribute - : XmlSerializationAttribute - { - } - - /// - /// Type serializer that supports serialization of objects supporting IDictionary. - /// - /// - /// - /// public class Pig - /// { - /// [XmlElement] - /// public string Name = "piglet" - /// } - /// - /// public class Cow - /// { - /// [XmlAttribute] - /// public string Name = "daisy" - /// } - /// - /// public class Farm - /// { - /// [DictionaryElementType(typeof(Pig), "pig")] - /// [DictionaryElementType(typeof(Cow), "cow")] - /// public IDictionary Animals; - /// - /// public Farm() - /// { - /// IDictionary dictionary = new Hashtable(); - /// dictionary["Piglet"] = new Pig(); - /// dictionary["Daisy"] = new Cow(); - /// } - /// } - /// - /// - /// Serialized output of Farm: - /// - /// - /// - /// - /// piglet - /// - /// - /// - /// - /// If only one DictionaryElementAttribute is present, the dictionary is assumed to only - /// contain the type specified by that attribute. The typealias is therefore not needed - /// and will be omitted from the serialized output. - /// - public class DictionaryTypeSerializer - : TypeSerializer - { - /// - /// Returns true. - /// - public override bool MemberBound - { - get - { - return true; - } - } - - /// - /// Returns typeof(IDictionary). - /// - public override Type SupportedType - { - get - { - return typeof(IDictionary); - } - } - - /// - /// - /// - /// - /// - /// - public DictionaryTypeSerializer(SerializationMemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - } - - /// - /// - /// - public override void Serialize(object obj, XmlWriter writer, SerializationState state) - { - } - - /// - /// - /// - public override object Deserialize(XmlReader reader, SerializationState state) - { - return null; - } - } -} diff --git a/src/Platform.Xml.Serialization/TypeSerializers/EnumTypeSerializer.cs b/src/Platform.Xml.Serialization/TypeSerializers/EnumTypeSerializer.cs deleted file mode 100644 index 13dffe7..0000000 --- a/src/Platform.Xml.Serialization/TypeSerializers/EnumTypeSerializer.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; - -namespace Platform.Xml.Serialization -{ - /// - /// Summary description for EnumTypeSerializer. - /// - public class EnumTypeSerializer - : TypeSerializerWithSimpleTextSupport - { - /// - /// - /// - public override Type SupportedType - { - get - { - return m_Type; - } - } - - private Type m_Type; - - public EnumTypeSerializer(SerializationMemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - m_Type = memberInfo.LogicalType; - - if (!typeof(Enum).IsAssignableFrom(m_Type)) - { - throw new ArgumentException(this.GetType().Name + " only works with Enum types"); - } - } - - public override string Serialize(object obj, SerializationState state) - { - return Enum.GetName(m_Type, obj); - } - - public override object Deserialize(string value, SerializationState state) - { - return Enum.Parse(m_Type, value, true); - } - } -} diff --git a/src/Platform.Xml.Serialization/TypeSerializers/ListTypeSerializer.cs b/src/Platform.Xml.Serialization/TypeSerializers/ListTypeSerializer.cs deleted file mode 100644 index 64e8396..0000000 --- a/src/Platform.Xml.Serialization/TypeSerializers/ListTypeSerializer.cs +++ /dev/null @@ -1,351 +0,0 @@ -using System; -using System.Xml; -using System.Reflection; -using System.Collections; - -namespace Platform.Xml.Serialization -{ - /// - /// Describes the types of the items in a list to be serialized. - /// - /// - ///

- /// You need to mark any IList field or property to be serialized with this attribute - /// at least once. The attribute is used to map an element name to the type - /// of object contained in the list. - ///

- ///
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = true)] - public class XmlListElementAttribute - : XmlElementAttribute - { - /// - /// - /// - public string Alias - { - get - { - return this.Name; - } - - set - { - this.Name = value; - } - } - - /// - /// - /// - public Type ItemType - { - get - { - return this.Type; - } - - set - { - this.Type = value; - } - } - - /// - /// Specifies a list item's type. - /// - /// - /// The type's name will be used as the alias for all elements with the type. - /// If the type has been attributed with an XmlElement attribute then the alias - /// specified in that attribute will be used. - /// - /// The type of element the list can contain. - public XmlListElementAttribute(Type itemType) - : this(itemType, itemType.Name) - { - } - - /// - /// Specifies a list item's type. - /// - /// - /// The supplied alias will be used to map the actual element Type with - /// an XML element. - /// - /// - /// - public XmlListElementAttribute(Type itemType, string alias) - : base(alias, itemType) - { - } - } - - - /// - /// - /// - public class ListTypeSerializer - : TypeSerializer - { - public override bool MemberBound - { - get - { - return true; - } - } - - public override Type SupportedType - { - get - { - return typeof(IList); - } - } - - private IDictionary m_TypeToItemMap; - private IDictionary m_AliasToItemMap; - private Type m_ListType; - - public class ListItem - { - public string Alias; - public XmlListElementAttribute Attribute; - public TypeSerializer Serializer; - } - - public ListTypeSerializer(SerializationMemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - m_TypeToItemMap = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default); - m_AliasToItemMap = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default); - - Scan(memberInfo, cache, options); - } - - /// - /// - /// - /// - /// - /// - private void Scan(SerializationMemberInfo memberInfo, TypeSerializerCache cache, SerializerOptions options) - { - IList attributes; - SerializationMemberInfo smi; - XmlSerializationAttribute[] attribs; - - attributes = new ArrayList(10); - - // Get the ElementType attributes specified on the type itself as long - // as we're not the type itself! - - if (memberInfo.MemberInfo != memberInfo.LogicalType) - { - smi = new SerializationMemberInfo(memberInfo.LogicalType, options, cache); - - attribs = smi.GetApplicableAttributes(typeof(XmlListElementAttribute)); - - foreach (Attribute a in attribs) - { - attributes.Add(a); - } - } - - // Get the ElementType attributes specified on the member. - - attribs = memberInfo.GetApplicableAttributes(typeof(XmlListElementAttribute)); - - foreach (Attribute a in attribs) - { - attributes.Add(a); - } - - - foreach (XmlListElementAttribute attribute in attributes) - { - SerializationMemberInfo smi2; - ListItem listItem = new ListItem(); - - smi2 = new SerializationMemberInfo(attribute.ItemType, options, cache); - - if (attribute.Alias == null) - { - attribute.Alias = smi2.SerializedName; - } - - listItem.Attribute = attribute; - listItem.Alias = attribute.Alias; - - // Check if a specific type of serializer is specified. - - if (attribute.SerializerType == null) - { - // Figure out the serializer based on the type of the element. - - listItem.Serializer = cache.GetTypeSerializerBySupportedType(attribute.ItemType, smi2); - } - else - { - // Get the type of serializer they specify. - - listItem.Serializer = cache.GetTypeSerializerBySerializerType(attribute.SerializerType, smi2); - } - - m_TypeToItemMap[attribute.ItemType] = listItem; - m_AliasToItemMap[attribute.Alias] = listItem; - } - - if (m_TypeToItemMap.Count == 0) - { - if (memberInfo.LogicalType.IsArray) - { - ListItem listItem; - Type elementType; - - listItem = new ListItem(); - - elementType = memberInfo.LogicalType.GetElementType(); - listItem.Alias = elementType.Name; - - listItem.Serializer = cache.GetTypeSerializerBySupportedType(elementType, new SerializationMemberInfo(elementType, options, cache)); - - m_TypeToItemMap[elementType] = listItem; - m_AliasToItemMap[listItem.Alias] = listItem; - } - } - - if (m_TypeToItemMap.Count == 0) - { - throw new InvalidOperationException("Must specify at least one XmlListElementype."); - } - - m_ListType = memberInfo.LogicalType; - - if (m_ListType.IsAbstract) - { - m_ListType = typeof(ArrayList); - } - } - - /// - /// - /// - /// - /// - /// - public override void Serialize(object obj, XmlWriter writer, SerializationState state) - { - foreach (object item in (IList)obj) - { - ListItem listItem; - - listItem = (ListItem)m_TypeToItemMap[item.GetType()]; - - writer.WriteStartElement(listItem.Alias); - - if (listItem.Attribute != null - && listItem.Attribute.SerializeAsValueNode - && listItem.Attribute.ValueNodeAttributeName != null - && listItem.Serializer is TypeSerializerWithSimpleTextSupport) - { - writer.WriteAttributeString(listItem.Attribute.ValueNodeAttributeName, - ((TypeSerializerWithSimpleTextSupport)listItem.Serializer).Serialize(item, state)); - } - else - { - listItem.Serializer.Serialize(item, writer, state); - } - - writer.WriteEndElement(); - } - } - - /// - /// - /// - /// - /// - /// - public override object Deserialize(XmlReader reader, SerializationState state) - { - IList retval = null; - - if (m_ListType.IsArray) - { - retval = new ArrayList(); - } - else - { - retval = (IList)Activator.CreateInstance(m_ListType); - - state.DeserializationStart(retval); - } - - // Go thru all elements and deserialize each one. - - if (reader.IsEmptyElement) - { - reader.ReadStartElement(); - } - else - { - reader.ReadStartElement(); - - for (;;) - { - ListItem listItem; - - XmlReaderHelper.ReadUntilAnyTypesReached(reader, XmlReaderHelper.ElementOrEndElement); - - if (reader.NodeType == XmlNodeType.Element) - { - listItem = (ListItem)m_AliasToItemMap[reader.Name]; - - if (listItem.Attribute != null - && listItem.Attribute.SerializeAsValueNode - && listItem.Attribute.ValueNodeAttributeName != null - && listItem.Serializer is TypeSerializerWithSimpleTextSupport) - { - string s; - - s = reader.GetAttribute(listItem.Attribute.ValueNodeAttributeName); - - retval.Add(((TypeSerializerWithSimpleTextSupport)listItem.Serializer).Deserialize(s, state)); - - XmlReaderHelper.ReadAndConsumeMatchingEndElement(reader); - } - else - { - retval.Add(listItem.Serializer.Deserialize(reader, state)); - } - } - else - { - if (reader.NodeType == XmlNodeType.EndElement) - { - reader.ReadEndElement(); - } - - break; - } - } - } - - if (m_ListType.IsArray) - { - Array array = Array.CreateInstance(m_ListType.GetElementType(), retval.Count); - - state.DeserializationStart(retval); - - retval.CopyTo(array, 0); - - retval = array; - } - - state.DeserializationEnd(retval); - - return retval; - } - } -} - diff --git a/src/Platform/AssemblyInfo.cs b/src/Platform/AssemblyInfo.cs deleted file mode 100644 index a93fc4e..0000000 --- a/src/Platform/AssemblyInfo.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Reflection; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("Platform.NET")] -[assembly: AssemblyDescription("Cross Platform Object Oriented Library")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("(Thong Nguyen (tum@veridicus.com)")] -[assembly: AssemblyProduct("Platform.VirtualFileSystem")] -[assembly: AssemblyCopyright("Copyright (c) 2002 - 2004 Thong Nguyen")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("0.5.0")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/src/Platform/ICacheable.cs b/src/Platform/ICacheable.cs deleted file mode 100644 index cc955c6..0000000 --- a/src/Platform/ICacheable.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace Platform -{ - /// - /// Summary description for ICacheable. - /// - public interface ICacheable - { - event EventHandler CacheabilityChanged; - - /// - /// If this property is true then the object can be removed from the cache when it spills. This can be - /// used to keep the object alive even if there are no other references to the object. - /// If this property is false then the object may automatically be removed from the cache at any time. - /// - bool IsWeakCacheable - { - get; - } - } -} diff --git a/src/Platform/Linq/LambdaExpressionCompilerWithMemberPopulateSupport.cs b/src/Platform/Linq/LambdaExpressionCompilerWithMemberPopulateSupport.cs deleted file mode 100644 index ddd1bc0..0000000 --- a/src/Platform/Linq/LambdaExpressionCompilerWithMemberPopulateSupport.cs +++ /dev/null @@ -1,370 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Reflection.Emit; - -namespace Platform.Linq -{ - public class LambdaExpressionCompilerWithMemberPopulateSupport - : ExpressionVisitor - { - private readonly Type delegateType; - private readonly ILGenerator generator; - private readonly DynamicMethod dynamicMethod; - private readonly LambdaExpression lambdaExpression; - private readonly Dictionary parameterIndexes; - - public LambdaExpressionCompilerWithMemberPopulateSupport(LambdaExpression lambdaExpression) - { - this.lambdaExpression = lambdaExpression; - - switch (lambdaExpression.Parameters.Count) - { - case 0: - delegateType = typeof(Func<>); - break; - case 1: - delegateType = typeof(Func<,>); - break; - case 2: - delegateType = typeof(Func<,,>); - break; - case 3: - delegateType = typeof(Func<,,,>); - break; - case 4: - delegateType = typeof(Func<,,,,>); - break; - default: - throw new NotSupportedException("LambdaExpression has too many arguments"); - } - - delegateType = delegateType.MakeGenericType(lambdaExpression.Parameters.Select(c => c.Type).Append(lambdaExpression.Body.Type).ToArray()); - - dynamicMethod = new DynamicMethod("", lambdaExpression.Body.Type, lambdaExpression.Parameters.Select(c => c.Type).ToArray(), true); - generator = dynamicMethod.GetILGenerator(); - - parameterIndexes = new Dictionary(); - - for (int i = 0; i < lambdaExpression.Parameters.Count; i++) - { - parameterIndexes[lambdaExpression.Parameters[i]] = i; - } - } - - public virtual Delegate Compile() - { - this.Visit(this.lambdaExpression.Body); - - Console.WriteLine("Ret"); - generator.Emit(OpCodes.Ret); - - return dynamicMethod.CreateDelegate(delegateType); - } - - protected override Expression Visit(Expression expression) - { - if (expression == null) - { - return expression; - } - - switch (expression.NodeType) - { - case (ExpressionType)MemberPopulateExpression.MemberPopulateExpressionType: - return VisitMemberPopulate((MemberPopulateExpression)expression); - } - - return base.Visit(expression); - } - - protected virtual Expression VisitMemberPopulate(MemberPopulateExpression memberPopulateExpression) - { - this.Visit(memberPopulateExpression.Source); - - foreach (var memberBinding in memberPopulateExpression.Bindings) - { - Console.WriteLine("Dup"); - generator.Emit(OpCodes.Dup); - - this.VisitBinding(memberBinding); - } - - return memberPopulateExpression; - } - - public static Delegate Compile(LambdaExpression lambdaExpression) - { - var compiler = new LambdaExpressionCompilerWithMemberPopulateSupport(lambdaExpression); - - return compiler.Compile(); - } - - protected override NewExpression VisitNew(NewExpression expression) - { - this.VisitExpressionList(expression.Arguments); - - Console.WriteLine("NewObj " + expression.Type.GetConstructor(expression.Arguments.Select(c => c.Type).ToArray())); - generator.Emit(OpCodes.Newobj, expression.Type.GetConstructor(expression.Arguments.Select(c => c.Type).ToArray())); - - return expression; - } - - protected override Expression VisitUnary(UnaryExpression unaryExpression) - { - if (unaryExpression.NodeType == ExpressionType.Convert) - { - this.Visit(unaryExpression.Operand); - - if (unaryExpression.Operand.Type.IsValueType && unaryExpression.Type.IsClass) - { - Console.WriteLine("box " + unaryExpression.Operand.Type); - generator.Emit(OpCodes.Box, unaryExpression.Operand.Type); - - return unaryExpression; - } - - if (unaryExpression.Type.IsValueType && unaryExpression.Operand.Type.IsClass) - { - Console.WriteLine("unbox_any " + unaryExpression.Type); - generator.Emit(OpCodes.Unbox_Any, unaryExpression.Type); - - return unaryExpression; - } - - Console.WriteLine("castclass " + unaryExpression.Type); - generator.Emit(OpCodes.Castclass, unaryExpression.Type); - } - else - { - throw new NotSupportedException("UnaryExpression: " + unaryExpression.NodeType); - } - - return unaryExpression; - } - - protected override Expression VisitMemberInit(System.Linq.Expressions.MemberInitExpression expression) - { - this.VisitNew(expression.NewExpression); - - foreach (var memberBinding in expression.Bindings) - { - Console.WriteLine("Dup"); - generator.Emit(OpCodes.Dup); - - this.VisitBinding(memberBinding); - } - - return expression; - } - - protected override MemberBinding VisitBinding(MemberBinding binding) - { - switch (binding.BindingType) - { - case MemberBindingType.Assignment: - return VisitMemberAssignment((MemberAssignment)binding); - default: - throw new Exception(string.Format("Unhandled binding type '{0}'", binding.BindingType)); - } - } - - protected override Expression VisitParameter(ParameterExpression expression) - { - Console.WriteLine("ldarg " + parameterIndexes[expression]); - generator.Emit(OpCodes.Ldarg, parameterIndexes[expression]); - - return expression; - } - - protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) - { - if (!(methodCallExpression.Object == null - || (methodCallExpression.NodeType == ExpressionType.Constant && ((ConstantExpression)methodCallExpression.Object).Value == null))) - { - this.Visit(methodCallExpression.Object); - } - - foreach (Expression expression in methodCallExpression.Arguments) - { - this.Visit(expression); - } - - if (methodCallExpression.Method.IsStatic) - { - Console.WriteLine("call " + methodCallExpression.Method); - generator.Emit(OpCodes.Call, methodCallExpression.Method); - } - else - { - Console.WriteLine("callvirt " + methodCallExpression.Method + " from " + methodCallExpression.Method.DeclaringType); - - generator.Emit(OpCodes.Callvirt, methodCallExpression.Method); - } - - return methodCallExpression; - } - - private static readonly MethodInfo TypeGetTypeFromHandle = typeof(Type).GetMethod("GetTypeFromHandle", BindingFlags.Static | BindingFlags.Public, null, new[] { typeof(RuntimeTypeHandle) }, null); - - protected override Expression VisitConstant(ConstantExpression constantExpression) - { - switch (Type.GetTypeCode(constantExpression.Type)) - { - case TypeCode.Int16: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, (Int16)constantExpression.Value); - break; - case TypeCode.Int32: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, (Int32)constantExpression.Value); - break; - case TypeCode.Int64: - Console.WriteLine("ldc_i8 "); - generator.Emit(OpCodes.Ldc_I8, (Int64)constantExpression.Value); - break; - case TypeCode.String: - Console.WriteLine("Ldstr "); - generator.Emit(OpCodes.Ldstr, (string)constantExpression.Value); - break; - case TypeCode.UInt16: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, (UInt16)constantExpression.Value); - break; - case TypeCode.UInt32: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, (UInt32)constantExpression.Value); - break; - case TypeCode.UInt64: - Console.WriteLine("ldc_i8 "); - generator.Emit(OpCodes.Ldc_I8, (UInt64)constantExpression.Value); - break; - case TypeCode.Boolean: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, ((bool)constantExpression.Value) ? 1 : 0); - break; - case TypeCode.Byte: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, (byte)constantExpression.Value); - break; - case TypeCode.Char: - Console.WriteLine("ldc_i4 "); - generator.Emit(OpCodes.Ldc_I4, (char)constantExpression.Value); - break; - case TypeCode.Double: - Console.WriteLine("ldc_i8 "); - generator.Emit(OpCodes.Ldc_R8, (double)constantExpression.Value); - break; - case TypeCode.Single: - Console.WriteLine("ldc_r4 "); - generator.Emit(OpCodes.Ldc_R4, (float)constantExpression.Value); - break; - default: - if (typeof(Type).IsAssignableFrom(constantExpression.Type)) - { - Console.WriteLine("ldtoken " + ((Type)constantExpression.Value)); - generator.Emit(OpCodes.Ldtoken, ((Type)constantExpression.Value)); - Console.WriteLine("call GetTypeFromHandle"); - generator.Emit(OpCodes.Call, TypeGetTypeFromHandle); - - break; - } - - if (constantExpression.Value == null) - { - Console.WriteLine("ldnull"); - - generator.Emit(OpCodes.Ldnull); - - break; - } - - throw new NotSupportedException("ConstantExpression Type: " + constantExpression.Type); - } - - return constantExpression; - } - - protected override Expression VisitBinary(BinaryExpression binaryExpression) - { - if (binaryExpression.NodeType == ExpressionType.Equal) - { - this.Visit(binaryExpression.Left); - this.Visit(binaryExpression.Right); - - Console.WriteLine("ceq"); - generator.Emit(OpCodes.Ceq); - } - else - { - throw new NotSupportedException("BinaryExpression: " + binaryExpression.NodeType); - } - - return binaryExpression; - } - - protected override Expression VisitConditional(ConditionalExpression expression) - { - var falseLabel = generator.DefineLabel(); - var endLabel = generator.DefineLabel(); - - this.Visit(expression.Test); - Console.WriteLine("br.false"); - generator.Emit(OpCodes.Brfalse, falseLabel); - this.Visit(expression.IfTrue); - Console.WriteLine("br"); - generator.Emit(OpCodes.Br, endLabel); - generator.MarkLabel(falseLabel); - this.Visit(expression.IfFalse); - generator.MarkLabel(endLabel); - - return expression; - } - - protected override Expression VisitMemberAccess(MemberExpression memberExpression) - { - this.Visit(memberExpression.Expression); - - switch (memberExpression.Member.MemberType) - { - case MemberTypes.Field: - Console.WriteLine("ldfld " + memberExpression.Member); - generator.Emit(OpCodes.Ldfld, (FieldInfo)memberExpression.Member); - break; - case MemberTypes.Property: - var method = ((PropertyInfo)memberExpression.Member).GetGetMethod(); - Console.WriteLine("callvirt {0} {1}", method.DeclaringType.Name, method.Name); - generator.Emit(OpCodes.Callvirt, ((PropertyInfo)memberExpression.Member).GetGetMethod()); - break; - default: - throw new NotSupportedException("Unsupported member assignment type: " + memberExpression.Member.MemberType); - } - - return memberExpression; - } - - protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment) - { - this.Visit(assignment.Expression); - - switch (assignment.Member.MemberType) - { - case MemberTypes.Field: - Console.WriteLine("stfld " + assignment.Member); - generator.Emit(OpCodes.Stfld, (FieldInfo)assignment.Member); - break; - case MemberTypes.Property: - var method = ((PropertyInfo)assignment.Member).GetSetMethod(); - Console.WriteLine("callvirt {0} {1}", method.DeclaringType.Name, method.Name); - generator.Emit(OpCodes.Callvirt, ((PropertyInfo)assignment.Member).GetSetMethod()); - break; - default: - throw new NotSupportedException("Unsupported member assignment type: " + assignment.Member.MemberType); - } - - return assignment; - } - } -} diff --git a/src/Platform/Platform.csproj b/src/Platform/Platform.csproj index a5a3cc6..3c43be1 100644 --- a/src/Platform/Platform.csproj +++ b/src/Platform/Platform.csproj @@ -1,378 +1,25 @@ - - - - Local - 9.0.21022 - 2.0 - {31199C34-A7F0-4D69-B2CF-E9CE05262618} - Debug - AnyCPU - - - - - Platform - - - JScript - Grid - IE50 - false - Library - Platform - OnBuildSuccess - - - - - 3.5 - - - v4.5.2 - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - - bin\Debug\ - false - 285212672 - false - - - TRACE;DEBUG;NET40 - - - true - 4096 - false - - - false - false - false - false - 4 - false - false - ManagedMinimumRules.ruleset - 6 - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - true - 4096 - false - - - true - false - false - false - 4 - false - full - - - - System - ..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll - - - - 3.5 - - - System.Data - ..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll - - - - - System.XML - ..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - Code - - - - - - - - - - - - - - - - Code - - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - true - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - - - - - + + + + net461;netstandard2.0 + + Platform.NET + Platform.NET System Library + + Platform.NET + + A cross-platform library of useful classes and extensions for C# and .NET. + + task text utility string extensions base64 ntp invocationqueue utility weakreference meteringstream expressionvisitor linq ringbuffer fifobuffer circular + + + + + + + + + + + \ No newline at end of file diff --git a/src/Platform/Properties/AssemblyInfo.cs b/src/Platform/Properties/AssemblyInfo.cs deleted file mode 100644 index fc3c3f5..0000000 --- a/src/Platform/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Platform.NET System Library")] -[assembly: AssemblyDescription("A cross-platform libary with useful utility classes for .NET")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Thong Nguyen")] -[assembly: AssemblyProduct("Platform.NET")] -[assembly: AssemblyCopyright("Copyright © 2004-1013 Thong Nguyen (tumtumtum@gmail.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6638f832-0052-4238-a67e-43d6854df3c3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Platform/Reference.cs b/src/Platform/Reference.cs deleted file mode 100644 index 325a13a..0000000 --- a/src/Platform/Reference.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace Platform -{ - /// - /// Summary description for Reference. - /// - public abstract class Reference - { - public object Target - { - get - { - return m_Target; - } - set - { - m_Target = value; - } - } - private object m_Target; - - protected Reference(object target) - { - m_Target = target; - } - } -} diff --git a/src/Platform/SoftReference.cs b/src/Platform/SoftReference.cs deleted file mode 100644 index a0874f3..0000000 --- a/src/Platform/SoftReference.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Threading; - -namespace Platform -{ - /// - /// Summary description for SoftReference. - /// - public class SoftReference - : Reference - { - WeakReference weakTarget; - - public SoftReference(object target) - : base(target) - { - weakTarget = new WeakReference(target); - } - } -} diff --git a/tests/Platform.Tests/FifoBufferTests.cs b/tests/Platform.Tests/FifoBufferTests.cs index ec2d4de..17e40e0 100644 --- a/tests/Platform.Tests/FifoBufferTests.cs +++ b/tests/Platform.Tests/FifoBufferTests.cs @@ -37,19 +37,22 @@ public void Test_Last2() Assert.AreEqual('E', buffer.Last); } - [Test, ExpectedException(typeof(BufferUnderflowException))] + [Test] public void Test_Last3() { - var buffer = new CircularFifoBuffer(3); - - buffer.Write(Encoding.ASCII.GetBytes("ABC")); - buffer.Write(Encoding.ASCII.GetBytes("DE")); - buffer.Read(); - buffer.Read(); - buffer.Read(); - buffer.Read(); - buffer.Read(); - var x = buffer.Last; + Assert.Throws(() => + { + var buffer = new CircularFifoBuffer(3); + + buffer.Write(Encoding.ASCII.GetBytes("ABC")); + buffer.Write(Encoding.ASCII.GetBytes("DE")); + buffer.Read(); + buffer.Read(); + buffer.Read(); + buffer.Read(); + buffer.Read(); + var x = buffer.Last; + }); } [Test] @@ -135,21 +138,27 @@ public void Test_Simple_RingBuffer_Test_Read_Write_With_Drift2() } } - [Test, ExpectedException(typeof(BufferOverflowException))] + [Test] public void Test_Overflow() { - var ringBuffer = new BoundedFifoBuffer(5); + Assert.Throws(() => + { + var ringBuffer = new BoundedFifoBuffer(5); - ringBuffer.Write(GetBytes("ABC")); - ringBuffer.Write(GetBytes("DEF")); + ringBuffer.Write(GetBytes("ABC")); + ringBuffer.Write(GetBytes("DEF")); + }); } - [Test, ExpectedException(typeof(BufferOverflowException))] + [Test] public void Test_Overflow_On_Initial() { - var ringBuffer = new BoundedFifoBuffer(5); + Assert.Throws(() => + { + var ringBuffer = new BoundedFifoBuffer(5); - ringBuffer.Write(GetBytes("ABCDEF")); + ringBuffer.Write(GetBytes("ABCDEF")); + }); } [Test] diff --git a/tests/Platform.Tests/Platform.Tests.csproj b/tests/Platform.Tests/Platform.Tests.csproj index cc0d93f..80939dd 100644 --- a/tests/Platform.Tests/Platform.Tests.csproj +++ b/tests/Platform.Tests/Platform.Tests.csproj @@ -1,86 +1,29 @@ - - - + - Debug - AnyCPU - {48BBE7EA-88F9-4A46-9EED-ADFF60427BF5} + net6.0 Library - Properties - Platform.Tests - Platform.Tests - v4.5.2 - 512 ..\..\src\ true - + false - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 6 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + latestmajor - - False - ..\..\src\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - - - - + - - - - - - - - - - - - - - - + + + + + all + - - {31199C34-A7F0-4D69-B2CF-E9CE05262618} - Platform - + - + - - - \ No newline at end of file diff --git a/tests/Platform.Tests/Properties/AssemblyInfo.cs b/tests/Platform.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 378de63..0000000 --- a/tests/Platform.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Platform.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Platform.Tests")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("75f27090-5d79-4b55-9b34-fabb99943335")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tests/Platform.Tests/packages.config b/tests/Platform.Tests/packages.config deleted file mode 100644 index 5a3253f..0000000 --- a/tests/Platform.Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/Platform.Xml.Serialization.Tests/Platform.Xml.Serialization.Tests.csproj b/tests/Platform.Xml.Serialization.Tests/Platform.Xml.Serialization.Tests.csproj index 379b2dc..be16963 100644 --- a/tests/Platform.Xml.Serialization.Tests/Platform.Xml.Serialization.Tests.csproj +++ b/tests/Platform.Xml.Serialization.Tests/Platform.Xml.Serialization.Tests.csproj @@ -1,88 +1,30 @@ - - - + - Debug - AnyCPU - {8682A3CE-4664-4535-B31D-8A7FB7C04266} + net6.0 Library - Properties - Platform.Xml.Serialization.Tests - Platform.Xml.Serialization.Tests - v4.5.2 - 512 ..\..\src\ true - + false - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + latestmajor - - False - ..\..\src\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + all + - - {cbb73076-7381-4fdd-907f-7097a8ab04e6} - Platform.Xml.Serialization - - - {31199c34-a7f0-4d69-b2cf-e9ce05262618} - Platform - + - + - - - \ No newline at end of file diff --git a/tests/Platform.Xml.Serialization.Tests/Properties/AssemblyInfo.cs b/tests/Platform.Xml.Serialization.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 2d0955e..0000000 --- a/tests/Platform.Xml.Serialization.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Platform.Xml.Serialization.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Platform.Xml.Serialization.Tests")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("030f0c3f-70c5-4b22-92ae-8272a73ab65b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tests/Platform.Xml.Serialization.Tests/packages.config b/tests/Platform.Xml.Serialization.Tests/packages.config deleted file mode 100644 index d4e241a..0000000 --- a/tests/Platform.Xml.Serialization.Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file