You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
@@ -1,51 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.CodeExporter.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez Gual (lluis@novell.com)
|
||||
//
|
||||
// Copyright (C) Novell, Inc., 2004
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
using System.CodeDom;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
public abstract class CodeExporter
|
||||
{
|
||||
internal MapCodeGenerator codeGenerator;
|
||||
|
||||
internal CodeExporter ()
|
||||
{
|
||||
}
|
||||
|
||||
public CodeAttributeDeclarationCollection IncludeMetadata
|
||||
{
|
||||
get { return codeGenerator.IncludeMetadata; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.CodeGenerationOptions
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez Gual (lluis@ximian.com)
|
||||
//
|
||||
// Copyright (C) Novell, Inc., 2004
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
[Flags]
|
||||
public
|
||||
enum CodeGenerationOptions
|
||||
{
|
||||
[XmlIgnore]
|
||||
None = 0,
|
||||
[XmlEnum ("properties")]
|
||||
GenerateProperties = 1,
|
||||
[XmlEnum ("newAsync")]
|
||||
GenerateNewAsync = 2,
|
||||
[XmlEnum ("oldAsync")]
|
||||
GenerateOldAsync = 4,
|
||||
[XmlEnum ("order")]
|
||||
GenerateOrder = 8,
|
||||
[XmlEnum ("enableDataBinding")]
|
||||
EnableDataBinding = 16,
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.CodeIdentifier.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman (tim@timcoleman.com)
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Xml.Serialization {
|
||||
public class CodeIdentifier {
|
||||
|
||||
[Obsolete ("Design mistake. It only contains static methods.")]
|
||||
public
|
||||
CodeIdentifier ()
|
||||
{
|
||||
}
|
||||
|
||||
public static string MakeCamel (string identifier)
|
||||
{
|
||||
string validIdentifier = MakeValid (identifier);
|
||||
return (Char.ToLower (validIdentifier[0], CultureInfo.InvariantCulture) + validIdentifier.Substring (1));
|
||||
}
|
||||
|
||||
public static string MakePascal (string identifier)
|
||||
{
|
||||
string validIdentifier = MakeValid (identifier);
|
||||
return (Char.ToUpper (validIdentifier[0], CultureInfo.InvariantCulture) + validIdentifier.Substring (1));
|
||||
}
|
||||
|
||||
public static string MakeValid (string identifier)
|
||||
{
|
||||
if (identifier == null)
|
||||
throw new NullReferenceException ();
|
||||
if (identifier.Length == 0)
|
||||
return "Item";
|
||||
|
||||
string output = "";
|
||||
|
||||
if (!Char.IsLetter (identifier[0]) && (identifier[0]!='_') )
|
||||
output = "Item";
|
||||
|
||||
foreach (char c in identifier)
|
||||
if (Char.IsLetterOrDigit (c) || c == '_')
|
||||
output += c;
|
||||
|
||||
if (output.Length > 400)
|
||||
output = output.Substring (0,400);
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.CodeIdentifiers
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman (tim@timcoleman.com)
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Xml.Serialization {
|
||||
public class CodeIdentifiers {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool useCamelCasing;
|
||||
Hashtable table;
|
||||
Hashtable reserved;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public CodeIdentifiers ()
|
||||
: this (true)
|
||||
{
|
||||
}
|
||||
|
||||
public
|
||||
CodeIdentifiers (bool caseSensitive)
|
||||
{
|
||||
StringComparer c = caseSensitive ?
|
||||
StringComparer.Ordinal :
|
||||
StringComparer.OrdinalIgnoreCase;
|
||||
table = new Hashtable (c);
|
||||
reserved = new Hashtable (c);
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool UseCamelCasing {
|
||||
get { return useCamelCasing; }
|
||||
set { useCamelCasing = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public void Add (string identifier, object value)
|
||||
{
|
||||
table.Add (identifier, value);
|
||||
}
|
||||
|
||||
public void AddReserved (string identifier)
|
||||
{
|
||||
reserved.Add (identifier, identifier);
|
||||
}
|
||||
|
||||
public string AddUnique (string identifier, object value)
|
||||
{
|
||||
string unique = MakeUnique (identifier);
|
||||
Add (unique, value);
|
||||
return unique;
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
table.Clear ();
|
||||
}
|
||||
|
||||
public bool IsInUse (string identifier)
|
||||
{
|
||||
return (table.ContainsKey (identifier) || reserved.ContainsKey (identifier));
|
||||
}
|
||||
|
||||
public string MakeRightCase (string identifier)
|
||||
{
|
||||
if (UseCamelCasing)
|
||||
return CodeIdentifier.MakeCamel (identifier);
|
||||
else
|
||||
return CodeIdentifier.MakePascal (identifier);
|
||||
}
|
||||
|
||||
public string MakeUnique (string identifier)
|
||||
{
|
||||
string uniqueIdentifier = identifier;
|
||||
int i = 1;
|
||||
|
||||
while (IsInUse (uniqueIdentifier)) {
|
||||
uniqueIdentifier = String.Format (CultureInfo.InvariantCulture, "{0}{1}", identifier, i);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
return uniqueIdentifier;
|
||||
}
|
||||
|
||||
public void Remove (string identifier)
|
||||
{
|
||||
table.Remove (identifier);
|
||||
}
|
||||
|
||||
public void RemoveReserved (string identifier)
|
||||
{
|
||||
reserved.Remove (identifier);
|
||||
}
|
||||
|
||||
public object ToArray (Type type)
|
||||
{
|
||||
Array list = Array.CreateInstance (type, table.Count);
|
||||
table.CopyTo (list, 0);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.SchemaImporter.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez Gual (lluis@novell.com)
|
||||
//
|
||||
// Copyright (C) Novell, Inc., 2004
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
using System.Xml.Serialization.Advanced;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
public abstract class SchemaImporter
|
||||
{
|
||||
SchemaImporterExtensionCollection extensions;
|
||||
|
||||
internal SchemaImporter ()
|
||||
{
|
||||
}
|
||||
|
||||
public SchemaImporterExtensionCollection Extensions
|
||||
{
|
||||
get {
|
||||
if (extensions == null)
|
||||
extensions = new SchemaImporterExtensionCollection ();
|
||||
return extensions;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.SoapCodeExporter
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman (tim@timcoleman.com)
|
||||
// Lluis Sanchez Gual (lluis@ximian.com)
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.CodeDom;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
public class SoapCodeExporter
|
||||
: CodeExporter
|
||||
{
|
||||
#region Fields
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SoapCodeExporter (CodeNamespace codeNamespace): this (codeNamespace, null)
|
||||
{
|
||||
}
|
||||
|
||||
public SoapCodeExporter (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)
|
||||
{
|
||||
codeGenerator = new SoapMapCodeGenerator (codeNamespace, codeCompileUnit);
|
||||
}
|
||||
|
||||
|
||||
public SoapCodeExporter (CodeNamespace codeNamespace,
|
||||
CodeCompileUnit codeCompileUnit,
|
||||
CodeGenerationOptions options)
|
||||
: this (codeNamespace, codeCompileUnit, null, options, null)
|
||||
{
|
||||
}
|
||||
|
||||
public SoapCodeExporter (CodeNamespace codeNamespace,
|
||||
CodeCompileUnit codeCompileUnit,
|
||||
CodeGenerationOptions options,
|
||||
Hashtable mappings)
|
||||
: this (codeNamespace, codeCompileUnit, null, options, mappings)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO]// FIXME: mappings?
|
||||
public SoapCodeExporter (CodeNamespace codeNamespace,
|
||||
CodeCompileUnit codeCompileUnit,
|
||||
CodeDomProvider codeProvider,
|
||||
CodeGenerationOptions options,
|
||||
Hashtable mappings)
|
||||
{
|
||||
codeGenerator = new SoapMapCodeGenerator (codeNamespace, codeCompileUnit, codeProvider, options, mappings);
|
||||
}
|
||||
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlMemberMapping member)
|
||||
{
|
||||
AddMappingMetadata (metadata, member, false);
|
||||
}
|
||||
|
||||
public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlMemberMapping member, bool forceUseMemberName)
|
||||
{
|
||||
TypeData memType = member.TypeMapMember.TypeData;
|
||||
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapElement");
|
||||
if (forceUseMemberName || (member.ElementName != member.MemberName))
|
||||
att.Arguments.Add (new CodeAttributeArgument (new CodePrimitiveExpression(member.ElementName)));
|
||||
if (!TypeTranslator.IsDefaultPrimitiveTpeData (memType))
|
||||
att.Arguments.Add (new CodeAttributeArgument ("DataType", new CodePrimitiveExpression(member.TypeName)));
|
||||
|
||||
if (att.Arguments.Count > 0)
|
||||
metadata.Add (att);
|
||||
}
|
||||
|
||||
public void ExportMembersMapping (XmlMembersMapping xmlMembersMapping)
|
||||
{
|
||||
codeGenerator.ExportMembersMapping (xmlMembersMapping);
|
||||
}
|
||||
|
||||
public void ExportTypeMapping (XmlTypeMapping xmlTypeMapping)
|
||||
{
|
||||
codeGenerator.ExportTypeMapping (xmlTypeMapping, true);
|
||||
}
|
||||
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
|
||||
class SoapMapCodeGenerator : MapCodeGenerator
|
||||
{
|
||||
public SoapMapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)
|
||||
: base (codeNamespace, codeCompileUnit, CodeGenerationOptions.None)
|
||||
{
|
||||
includeArrayTypes = true;
|
||||
}
|
||||
|
||||
public SoapMapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeDomProvider codeProvider, CodeGenerationOptions options, Hashtable mappings)
|
||||
: base (codeNamespace, codeCompileUnit, codeProvider, options, mappings)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void GenerateClass (XmlTypeMapping map, CodeTypeDeclaration codeClass, bool isTopLevel)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapType");
|
||||
if (map.XmlType != map.TypeData.TypeName) att.Arguments.Add (GetArg (map.XmlType));
|
||||
if (map.XmlTypeNamespace != "") att.Arguments.Add (GetArg ("Namespace", map.XmlTypeNamespace));
|
||||
AddCustomAttribute (codeClass, att, false);
|
||||
}
|
||||
|
||||
protected override void GenerateClassInclude (CodeAttributeDeclarationCollection attributes, XmlTypeMapping map)
|
||||
{
|
||||
CodeAttributeDeclaration iatt = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapInclude");
|
||||
iatt.Arguments.Add (new CodeAttributeArgument (new CodeTypeOfExpression(map.TypeData.FullTypeName)));
|
||||
attributes.Add (iatt);
|
||||
}
|
||||
|
||||
protected override void GenerateAttributeMember (CodeAttributeDeclarationCollection attributes, XmlTypeMapMemberAttribute attinfo, string defaultNamespace, bool forceUseMemberName)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapAttribute");
|
||||
if (attinfo.Name != attinfo.AttributeName) att.Arguments.Add (GetArg (attinfo.AttributeName));
|
||||
if (attinfo.Namespace != defaultNamespace) att.Arguments.Add (GetArg ("Namespace", attinfo.Namespace));
|
||||
if (!TypeTranslator.IsDefaultPrimitiveTpeData(attinfo.TypeData)) att.Arguments.Add (GetArg ("DataType",attinfo.TypeData.XmlType));
|
||||
attributes.Add (att);
|
||||
}
|
||||
|
||||
protected override void GenerateElementInfoMember (CodeAttributeDeclarationCollection attributes, XmlTypeMapMemberElement member, XmlTypeMapElementInfo einfo, TypeData defaultType, string defaultNamespace, bool addAlwaysAttr, bool forceUseMemberName)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapElement");
|
||||
if (forceUseMemberName || einfo.ElementName != member.Name) att.Arguments.Add (GetArg (einfo.ElementName));
|
||||
// if (einfo.IsNullable) att.Arguments.Add (GetArg ("IsNullable", true)); MS seems to ignore this
|
||||
if (!TypeTranslator.IsDefaultPrimitiveTpeData(einfo.TypeData)) att.Arguments.Add (GetArg ("DataType",einfo.TypeData.XmlType));
|
||||
if (addAlwaysAttr || att.Arguments.Count > 0) attributes.Add (att);
|
||||
}
|
||||
|
||||
protected override void GenerateEnum (XmlTypeMapping map, CodeTypeDeclaration codeEnum, bool isTopLevel)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapType");
|
||||
if (map.XmlType != map.TypeData.TypeName) att.Arguments.Add (GetArg (map.XmlType));
|
||||
if (map.XmlTypeNamespace != "") att.Arguments.Add (GetArg ("Namespace", map.XmlTypeNamespace));
|
||||
AddCustomAttribute (codeEnum, att, false);
|
||||
}
|
||||
|
||||
protected override void GenerateEnumItem (CodeMemberField codeField, EnumMap.EnumMapMember emem)
|
||||
{
|
||||
if (emem.EnumName != emem.XmlName)
|
||||
{
|
||||
CodeAttributeDeclaration xatt = new CodeAttributeDeclaration ("System.Xml.Serialization.SoapEnum");
|
||||
xatt.Arguments.Add (GetArg ("Name", emem.XmlName));
|
||||
AddCustomAttribute (codeField, xatt, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void GenerateSpecifierMember (CodeTypeMember codeField)
|
||||
{
|
||||
AddCustomAttribute (codeField, "System.Xml.Serialization.SoapIgnore");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.SoapSchemaExporter
|
||||
//
|
||||
// Authors:
|
||||
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
|
||||
// Lluis Sanchez Gual (lluis@ximian.com)
|
||||
//
|
||||
// (c) 2002 Ximian, Inc. (http://www.ximian.com)
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
public class SoapSchemaExporter
|
||||
{
|
||||
XmlSchemaExporter _exporter;
|
||||
|
||||
public SoapSchemaExporter (XmlSchemas schemas)
|
||||
{
|
||||
_exporter = new XmlSchemaExporter(schemas, true);
|
||||
}
|
||||
|
||||
public void ExportMembersMapping (XmlMembersMapping xmlMembersMapping)
|
||||
{
|
||||
_exporter.ExportMembersMapping (xmlMembersMapping, false);
|
||||
}
|
||||
|
||||
public void ExportMembersMapping (XmlMembersMapping xmlMembersMapping,
|
||||
bool exportEnclosingType)
|
||||
{
|
||||
_exporter.ExportMembersMapping (xmlMembersMapping, exportEnclosingType);
|
||||
}
|
||||
|
||||
public void ExportTypeMapping (XmlTypeMapping xmlTypeMapping)
|
||||
{
|
||||
_exporter.ExportTypeMapping (xmlTypeMapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.SoapSchemaImporter
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman (tim@timcoleman.com)
|
||||
// Lluis Sanchez Gual (lluis@novell.com)
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Xml;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
public class SoapSchemaImporter
|
||||
: SchemaImporter
|
||||
{
|
||||
|
||||
#region Fields
|
||||
|
||||
XmlSchemaImporter _importer;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SoapSchemaImporter (XmlSchemas schemas)
|
||||
{
|
||||
_importer = new XmlSchemaImporter (schemas);
|
||||
_importer.UseEncodedFormat = true;
|
||||
}
|
||||
|
||||
public SoapSchemaImporter (XmlSchemas schemas, CodeIdentifiers typeIdentifiers)
|
||||
{
|
||||
_importer = new XmlSchemaImporter (schemas, typeIdentifiers);
|
||||
_importer.UseEncodedFormat = true;
|
||||
}
|
||||
|
||||
|
||||
public SoapSchemaImporter (XmlSchemas schemas, CodeGenerationOptions options, ImportContext context)
|
||||
{
|
||||
_importer = new XmlSchemaImporter (schemas, options, context);
|
||||
_importer.UseEncodedFormat = true;
|
||||
}
|
||||
|
||||
public SoapSchemaImporter (XmlSchemas schemas, CodeIdentifiers typeIdentifiers, CodeGenerationOptions options)
|
||||
{
|
||||
_importer = new XmlSchemaImporter (schemas, typeIdentifiers, options);
|
||||
_importer.UseEncodedFormat = true;
|
||||
}
|
||||
|
||||
public SoapSchemaImporter (XmlSchemas schemas,CodeGenerationOptions options,
|
||||
CodeDomProvider codeProvider, ImportContext context)
|
||||
{
|
||||
_importer = new XmlSchemaImporter (schemas, options, codeProvider, context);
|
||||
_importer.UseEncodedFormat = true;
|
||||
}
|
||||
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Methods
|
||||
|
||||
public XmlTypeMapping ImportDerivedTypeMapping (XmlQualifiedName name, Type baseType, bool baseTypeCanBeIndirect)
|
||||
{
|
||||
return _importer.ImportDerivedTypeMapping (name, baseType, baseTypeCanBeIndirect);
|
||||
}
|
||||
|
||||
public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember member)
|
||||
{
|
||||
return _importer.ImportEncodedMembersMapping (name, ns, member);
|
||||
}
|
||||
|
||||
public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember[] members)
|
||||
{
|
||||
return _importer.ImportEncodedMembersMapping (name, ns, members, false);
|
||||
}
|
||||
|
||||
public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember[] members, bool hasWrapperElement)
|
||||
{
|
||||
return _importer.ImportEncodedMembersMapping (name, ns, members, hasWrapperElement);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember[] members, bool hasWrapperElement, Type baseType, bool baseTypeCanBeIndirect)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// UnreferencedObjectEventArgs.cs:
|
||||
//
|
||||
// Author:
|
||||
// John Donagher (john@webmeta.com)
|
||||
//
|
||||
// (C) 2002 John Donagher
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for UnreferencedObjectEventArgs.
|
||||
/// </summary>
|
||||
public class UnreferencedObjectEventArgs : EventArgs
|
||||
{
|
||||
private object unreferencedObject;
|
||||
private string unreferencedId;
|
||||
|
||||
public UnreferencedObjectEventArgs(object o, string id)
|
||||
{
|
||||
unreferencedObject = o;
|
||||
unreferencedId = id;
|
||||
}
|
||||
|
||||
public string UnreferencedId {
|
||||
get{ return unreferencedId; }
|
||||
}
|
||||
public object UnreferencedObject {
|
||||
get{ return unreferencedObject; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// UnreferencedObjectEventHandler.cs:
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza (miguel@ximian.com)
|
||||
//
|
||||
// (C) 2002 Ximian, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization {
|
||||
|
||||
public delegate void UnreferencedObjectEventHandler (object sender, UnreferencedObjectEventArgs e);
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
//
|
||||
// XmlAttributeEventArgs.cs:
|
||||
//
|
||||
// Author:
|
||||
// John Donagher (john@webmeta.com)
|
||||
//
|
||||
// (C) 2002 John Donagher
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Xml;
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for XmlAttributeEventArgs.
|
||||
/// </summary>
|
||||
public class XmlAttributeEventArgs : EventArgs
|
||||
{
|
||||
private XmlAttribute attr;
|
||||
private int lineNumber;
|
||||
private int linePosition;
|
||||
private object obj;
|
||||
private string expectedAttributes;
|
||||
|
||||
internal XmlAttributeEventArgs(XmlAttribute attr, int lineNum, int linePos, object source)
|
||||
{
|
||||
this.attr = attr;
|
||||
this.lineNumber = lineNum;
|
||||
this.linePosition = linePos;
|
||||
this.obj = source;
|
||||
}
|
||||
|
||||
public XmlAttribute Attr {
|
||||
get { return attr; }
|
||||
}
|
||||
|
||||
public int LineNumber {
|
||||
get { return lineNumber; }
|
||||
}
|
||||
|
||||
public int LinePosition {
|
||||
get { return linePosition; }
|
||||
}
|
||||
|
||||
public object ObjectBeingDeserialized {
|
||||
get{ return obj; }
|
||||
}
|
||||
|
||||
public string ExpectedAttributes {
|
||||
get { return expectedAttributes; }
|
||||
internal set { expectedAttributes = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// XmlAttributeEventHandler.cs:
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza (miguel@ximian.com)
|
||||
//
|
||||
// (C) 2002 Ximian, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization {
|
||||
|
||||
public delegate void XmlAttributeEventHandler (object sender, XmlAttributeEventArgs e);
|
||||
}
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.XmlCodeExporter
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman (tim@timcoleman.com)
|
||||
// Lluis Sanchez Gual (lluis@ximian.com)
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.CodeDom;
|
||||
using System.Collections;
|
||||
using System.Xml.Schema;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
|
||||
public class XmlCodeExporter
|
||||
: CodeExporter
|
||||
{
|
||||
#region Fields
|
||||
|
||||
// CodeGenerationOptions options;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public XmlCodeExporter (CodeNamespace codeNamespace): this (codeNamespace, null)
|
||||
{
|
||||
}
|
||||
|
||||
public XmlCodeExporter (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)
|
||||
{
|
||||
codeGenerator = new XmlMapCodeGenerator (codeNamespace, codeCompileUnit, CodeGenerationOptions.GenerateProperties);
|
||||
}
|
||||
|
||||
public XmlCodeExporter (CodeNamespace codeNamespace,
|
||||
CodeCompileUnit codeCompileUnit,
|
||||
CodeGenerationOptions options)
|
||||
: this (codeNamespace, codeCompileUnit, null, options, null)
|
||||
{
|
||||
}
|
||||
|
||||
public XmlCodeExporter (CodeNamespace codeNamespace,
|
||||
CodeCompileUnit codeCompileUnit,
|
||||
CodeGenerationOptions options,
|
||||
Hashtable mappings)
|
||||
: this (codeNamespace, codeCompileUnit, null, options, mappings)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO]// FIXME: mappings?
|
||||
public XmlCodeExporter (CodeNamespace codeNamespace,
|
||||
CodeCompileUnit codeCompileUnit,
|
||||
CodeDomProvider codeProvider,
|
||||
CodeGenerationOptions options,
|
||||
Hashtable mappings)
|
||||
{
|
||||
codeGenerator = new XmlMapCodeGenerator (codeNamespace, codeCompileUnit, codeProvider, options, mappings);
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlMemberMapping member, string ns)
|
||||
{
|
||||
AddMappingMetadata (metadata, member, ns, false);
|
||||
}
|
||||
|
||||
public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlTypeMapping mapping, string ns)
|
||||
{
|
||||
if ( (mapping.TypeData.SchemaType == SchemaTypes.Primitive ||
|
||||
mapping.TypeData.SchemaType == SchemaTypes.Array)
|
||||
&& mapping.Namespace != XmlSchema.Namespace)
|
||||
{
|
||||
CodeAttributeDeclaration ratt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlRoot");
|
||||
ratt.Arguments.Add (MapCodeGenerator.GetArg (mapping.ElementName));
|
||||
ratt.Arguments.Add (MapCodeGenerator.GetArg ("Namespace", mapping.Namespace));
|
||||
ratt.Arguments.Add (MapCodeGenerator.GetArg ("IsNullable", mapping.IsNullable));
|
||||
metadata.Add (ratt);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlMemberMapping member, string ns, bool forceUseMemberName)
|
||||
{
|
||||
CodeAttributeDeclaration att;
|
||||
TypeData memType = member.TypeMapMember.TypeData;
|
||||
|
||||
if (member.Any)
|
||||
{
|
||||
XmlTypeMapElementInfoList list = (XmlTypeMapElementInfoList)((XmlTypeMapMemberElement)member.TypeMapMember).ElementInfo;
|
||||
foreach (XmlTypeMapElementInfo info in list)
|
||||
{
|
||||
if (info.IsTextElement)
|
||||
metadata.Add (new CodeAttributeDeclaration ("System.Xml.Serialization.XmlText"));
|
||||
else {
|
||||
att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlAnyElement");
|
||||
if (!info.IsUnnamedAnyElement) {
|
||||
att.Arguments.Add (MapCodeGenerator.GetArg ("Name", info.ElementName));
|
||||
if (info.Namespace != ns) att.Arguments.Add (MapCodeGenerator.GetArg ("Namespace", member.Namespace));
|
||||
}
|
||||
metadata.Add (att);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (member.TypeMapMember is XmlTypeMapMemberList)
|
||||
{
|
||||
// Array parameter
|
||||
XmlTypeMapMemberList list = member.TypeMapMember as XmlTypeMapMemberList;
|
||||
ListMap listMap = (ListMap) list.ListTypeMapping.ObjectMap;
|
||||
|
||||
codeGenerator.AddArrayAttributes (metadata, list, ns, forceUseMemberName);
|
||||
codeGenerator.AddArrayItemAttributes (metadata, listMap, memType.ListItemTypeData, list.Namespace, 0);
|
||||
}
|
||||
else if (member.TypeMapMember is XmlTypeMapMemberElement) {
|
||||
codeGenerator.AddElementMemberAttributes ((XmlTypeMapMemberElement) member.TypeMapMember, ns, metadata, forceUseMemberName);
|
||||
}
|
||||
else if (member.TypeMapMember is XmlTypeMapMemberAttribute) {
|
||||
codeGenerator.AddAttributeMemberAttributes ((XmlTypeMapMemberAttribute) member.TypeMapMember, ns, metadata, forceUseMemberName);
|
||||
}
|
||||
else
|
||||
throw new NotSupportedException ("Schema type not supported");
|
||||
}
|
||||
|
||||
public void ExportMembersMapping (XmlMembersMapping xmlMembersMapping)
|
||||
{
|
||||
codeGenerator.ExportMembersMapping (xmlMembersMapping);
|
||||
}
|
||||
|
||||
public void ExportTypeMapping (XmlTypeMapping xmlTypeMapping)
|
||||
{
|
||||
codeGenerator.ExportTypeMapping (xmlTypeMapping, true);
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
|
||||
class XmlMapCodeGenerator : MapCodeGenerator
|
||||
{
|
||||
public XmlMapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeGenerationOptions options)
|
||||
: base (codeNamespace, codeCompileUnit, options)
|
||||
{
|
||||
}
|
||||
|
||||
public XmlMapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeDomProvider codeProvider, CodeGenerationOptions options, Hashtable mappings)
|
||||
: base (codeNamespace, codeCompileUnit, codeProvider, options, mappings)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void GenerateClass (XmlTypeMapping map, CodeTypeDeclaration codeClass, bool isTopLevel)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlTypeAttribute");
|
||||
if (map.XmlType != map.TypeData.TypeName) att.Arguments.Add (GetArg (map.XmlType));
|
||||
if (map.XmlTypeNamespace != "") att.Arguments.Add (GetArg ("Namespace", map.XmlTypeNamespace));
|
||||
if (!map.IncludeInSchema) att.Arguments.Add (GetArg ("IncludeInSchema", false));
|
||||
AddCustomAttribute (codeClass, att, false);
|
||||
|
||||
CodeAttributeDeclaration ratt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlRootAttribute");
|
||||
if (map.ElementName != map.XmlType) ratt.Arguments.Add (GetArg (map.ElementName));
|
||||
if (isTopLevel) {
|
||||
ratt.Arguments.Add (GetArg ("Namespace", map.Namespace));
|
||||
ratt.Arguments.Add (GetArg ("IsNullable", map.IsNullable));
|
||||
} else {
|
||||
if (map.Namespace != "")
|
||||
ratt.Arguments.Add (GetArg ("Namespace", map.Namespace));
|
||||
}
|
||||
AddCustomAttribute (codeClass, ratt, isTopLevel);
|
||||
}
|
||||
|
||||
protected override void GenerateClassInclude (CodeAttributeDeclarationCollection attributes, XmlTypeMapping map)
|
||||
{
|
||||
CodeAttributeDeclaration iatt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlIncludeAttribute");
|
||||
iatt.Arguments.Add (new CodeAttributeArgument (new CodeTypeOfExpression(map.TypeData.FullTypeName)));
|
||||
attributes.Add (iatt);
|
||||
}
|
||||
|
||||
protected override void GenerateAnyAttribute (CodeTypeMember codeField)
|
||||
{
|
||||
AddCustomAttribute (codeField, "System.Xml.Serialization.XmlAnyAttribute");
|
||||
}
|
||||
|
||||
protected override void GenerateAttributeMember (CodeAttributeDeclarationCollection attributes, XmlTypeMapMemberAttribute attinfo, string defaultNamespace, bool forceUseMemberName)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlAttributeAttribute");
|
||||
if (forceUseMemberName || attinfo.Name != attinfo.AttributeName) att.Arguments.Add (GetArg (attinfo.AttributeName));
|
||||
if (attinfo.Namespace != defaultNamespace) att.Arguments.Add (GetArg ("Namespace", attinfo.Namespace));
|
||||
if (attinfo.Form == XmlSchemaForm.Qualified) att.Arguments.Add (GetEnumArg ("Form","System.Xml.Schema.XmlSchemaForm",attinfo.Form.ToString()));
|
||||
if (!TypeTranslator.IsDefaultPrimitiveTpeData(attinfo.TypeData)) att.Arguments.Add (GetArg ("DataType",attinfo.TypeData.XmlType));
|
||||
attributes.Add (att);
|
||||
|
||||
if (attinfo.Ignore)
|
||||
attributes.Add (new CodeAttributeDeclaration ("System.Xml.Serialization.XmlIgnoreAttribute"));
|
||||
}
|
||||
|
||||
protected override void GenerateElementInfoMember (CodeAttributeDeclarationCollection attributes, XmlTypeMapMemberElement member, XmlTypeMapElementInfo einfo, TypeData defaultType, string defaultNamespace, bool addAlwaysAttr, bool forceUseMemberName)
|
||||
{
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlElementAttribute");
|
||||
if (forceUseMemberName || einfo.ElementName != member.Name) att.Arguments.Add (GetArg (einfo.ElementName));
|
||||
if (einfo.TypeData.FullTypeName != defaultType.FullTypeName) att.Arguments.Add (GetTypeArg ("Type", einfo.TypeData.FullTypeName));
|
||||
if (einfo.Namespace != defaultNamespace) att.Arguments.Add (GetArg ("Namespace", einfo.Namespace));
|
||||
if (einfo.Form == XmlSchemaForm.Unqualified) att.Arguments.Add (GetEnumArg ("Form", "System.Xml.Schema.XmlSchemaForm", einfo.Form.ToString()));
|
||||
if (einfo.IsNullable) att.Arguments.Add (GetArg ("IsNullable", true));
|
||||
if (!TypeTranslator.IsDefaultPrimitiveTpeData(einfo.TypeData)) att.Arguments.Add (GetArg ("DataType",einfo.TypeData.XmlType));
|
||||
if (addAlwaysAttr || att.Arguments.Count > 0) attributes.Add (att);
|
||||
}
|
||||
|
||||
protected override void GenerateElementMember (CodeAttributeDeclarationCollection attributes, XmlTypeMapMemberElement member)
|
||||
{
|
||||
if (member.ChoiceMember != null) {
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlChoiceIdentifier");
|
||||
att.Arguments.Add (GetArg(member.ChoiceMember));
|
||||
attributes.Add (att);
|
||||
}
|
||||
|
||||
if (member.Ignore)
|
||||
attributes.Add (new CodeAttributeDeclaration ("System.Xml.Serialization.XmlIgnoreAttribute"));
|
||||
}
|
||||
|
||||
protected override void GenerateArrayElement (CodeAttributeDeclarationCollection attributes, XmlTypeMapMemberElement member, string defaultNamespace, bool forceUseMemberName)
|
||||
{
|
||||
XmlTypeMapElementInfo einfo = (XmlTypeMapElementInfo) member.ElementInfo[0];
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlArray");
|
||||
if (forceUseMemberName || (einfo.ElementName != member.Name)) att.Arguments.Add (GetArg ("ElementName", einfo.ElementName));
|
||||
if (einfo.Namespace != defaultNamespace) att.Arguments.Add (GetArg ("Namespace", einfo.Namespace));
|
||||
if (einfo.Form == XmlSchemaForm.Unqualified) att.Arguments.Add (MapCodeGenerator.GetEnumArg ("Form", "System.Xml.Schema.XmlSchemaForm", einfo.Form.ToString()));
|
||||
if (einfo.IsNullable) att.Arguments.Add (GetArg ("IsNullable", true));
|
||||
if (att.Arguments.Count > 0) attributes.Add (att);
|
||||
}
|
||||
|
||||
protected override void GenerateArrayItemAttributes (CodeAttributeDeclarationCollection attributes, ListMap listMap, TypeData type, XmlTypeMapElementInfo ainfo, string defaultName, string defaultNamespace, int nestingLevel)
|
||||
{
|
||||
bool needsType = (listMap.ItemInfo.Count > 1) ||
|
||||
(ainfo.TypeData.FullTypeName != type.FullTypeName && !listMap.IsMultiArray);
|
||||
|
||||
CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlArrayItem");
|
||||
if (ainfo.ElementName != defaultName) att.Arguments.Add (GetArg ("ElementName", ainfo.ElementName));
|
||||
if (ainfo.Namespace != defaultNamespace && ainfo.Namespace != XmlSchema.Namespace) att.Arguments.Add (GetArg ("Namespace", ainfo.Namespace));
|
||||
if (needsType) att.Arguments.Add (GetTypeArg ("Type", ainfo.TypeData.FullTypeName));
|
||||
if (!ainfo.IsNullable) att.Arguments.Add (GetArg ("IsNullable", false));
|
||||
if (ainfo.Form == XmlSchemaForm.Unqualified) att.Arguments.Add (MapCodeGenerator.GetEnumArg ("Form", "System.Xml.Schema.XmlSchemaForm", ainfo.Form.ToString()));
|
||||
if (att.Arguments.Count > 0 && nestingLevel > 0) att.Arguments.Add (GetArg ("NestingLevel", nestingLevel));
|
||||
|
||||
if (att.Arguments.Count > 0) attributes.Add (att);
|
||||
}
|
||||
|
||||
protected override void GenerateTextElementAttribute (CodeAttributeDeclarationCollection attributes, XmlTypeMapElementInfo einfo, TypeData defaultType)
|
||||
{
|
||||
CodeAttributeDeclaration uatt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlTextAttribute");
|
||||
if (einfo.TypeData.FullTypeName != defaultType.FullTypeName) uatt.Arguments.Add (GetTypeArg ("Type", einfo.TypeData.FullTypeName));
|
||||
attributes.Add (uatt);
|
||||
}
|
||||
|
||||
protected override void GenerateUnnamedAnyElementAttribute (CodeAttributeDeclarationCollection attributes, XmlTypeMapElementInfo einfo, string defaultNamespace)
|
||||
{
|
||||
CodeAttributeDeclaration uatt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlAnyElement");
|
||||
if (!einfo.IsUnnamedAnyElement) uatt.Arguments.Add (GetArg ("Name", einfo.ElementName));
|
||||
if (einfo.Namespace != defaultNamespace) uatt.Arguments.Add (GetArg ("Namespace", einfo.Namespace));
|
||||
attributes.Add (uatt);
|
||||
}
|
||||
|
||||
protected override void GenerateEnum (XmlTypeMapping map, CodeTypeDeclaration codeEnum, bool isTopLevel)
|
||||
{
|
||||
GenerateClass (map, codeEnum, isTopLevel);
|
||||
}
|
||||
|
||||
protected override void GenerateEnumItem (CodeMemberField codeField, EnumMap.EnumMapMember emem)
|
||||
{
|
||||
if (emem.EnumName != emem.XmlName)
|
||||
{
|
||||
CodeAttributeDeclaration xatt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlEnumAttribute");
|
||||
xatt.Arguments.Add (GetArg (emem.XmlName));
|
||||
|
||||
AddCustomAttribute (codeField, xatt, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void GenerateSpecifierMember (CodeTypeMember codeField)
|
||||
{
|
||||
AddCustomAttribute (codeField, "System.Xml.Serialization.XmlIgnore");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
//
|
||||
// XmlElementEventArgs.cs:
|
||||
//
|
||||
// Author:
|
||||
// John Donagher (john@webmeta.com)
|
||||
//
|
||||
// (C) 2002 John Donagher
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Xml;
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for XmlElementEventArgs.
|
||||
/// </summary>
|
||||
public class XmlElementEventArgs : EventArgs
|
||||
{
|
||||
private XmlElement attr;
|
||||
private int lineNumber;
|
||||
private int linePosition;
|
||||
private object obj;
|
||||
private string expectedElements;
|
||||
|
||||
internal XmlElementEventArgs(XmlElement attr, int lineNum, int linePos, object source)
|
||||
{
|
||||
this.attr = attr;
|
||||
this.lineNumber = lineNum;
|
||||
this.linePosition = linePos;
|
||||
this.obj = source;
|
||||
}
|
||||
|
||||
public XmlElement Element
|
||||
{
|
||||
get { return attr; }
|
||||
}
|
||||
|
||||
public int LineNumber
|
||||
{
|
||||
get { return lineNumber; }
|
||||
}
|
||||
|
||||
public int LinePosition
|
||||
{
|
||||
get { return linePosition; }
|
||||
}
|
||||
|
||||
public object ObjectBeingDeserialized
|
||||
{
|
||||
get{ return obj; }
|
||||
}
|
||||
|
||||
public string ExpectedElements {
|
||||
get { return expectedElements; }
|
||||
internal set { expectedElements = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// XmlElementEventHandler.cs:
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza (miguel@ximian.com)
|
||||
//
|
||||
// (C) 2002 Ximian, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization {
|
||||
|
||||
public delegate void XmlElementEventHandler (object sender, XmlElementEventArgs e);
|
||||
}
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
//
|
||||
// XmlNodeEventArgs.cs:
|
||||
//
|
||||
// Author:
|
||||
// John Donagher (john@webmeta.com)
|
||||
//
|
||||
// (C) 2002 John Donagher
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Xml;
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for XmlNodeEventArgs.
|
||||
/// </summary>
|
||||
public class XmlNodeEventArgs : EventArgs
|
||||
{
|
||||
private int linenumber;
|
||||
private int lineposition ;
|
||||
private string localname;
|
||||
private string name;
|
||||
private string nsuri;
|
||||
private XmlNodeType nodetype;
|
||||
private object source;
|
||||
private string text;
|
||||
|
||||
internal XmlNodeEventArgs(int linenumber, int lineposition, string localname, string name, string nsuri,
|
||||
XmlNodeType nodetype, object source, string text)
|
||||
{
|
||||
this.linenumber = linenumber;
|
||||
this.lineposition = lineposition;
|
||||
this.localname = localname;
|
||||
this.name = name;
|
||||
this.nsuri = nsuri;
|
||||
this.nodetype = nodetype;
|
||||
this.source = source;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public int LineNumber
|
||||
{
|
||||
get { return linenumber; }
|
||||
}
|
||||
|
||||
public int LinePosition
|
||||
{
|
||||
get { return lineposition; }
|
||||
}
|
||||
|
||||
public string LocalName
|
||||
{
|
||||
get { return localname; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
public string NamespaceURI
|
||||
{
|
||||
get { return nsuri; }
|
||||
}
|
||||
|
||||
public XmlNodeType NodeType
|
||||
{
|
||||
get { return nodetype; }
|
||||
}
|
||||
|
||||
public object ObjectBeingDeserialized
|
||||
{
|
||||
get { return source; }
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get { return text; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// XmlNodeEventHandler.cs:
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza (miguel@ximian.com)
|
||||
//
|
||||
// (C) 2002 Ximian, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
|
||||
namespace System.Xml.Serialization {
|
||||
|
||||
public delegate void XmlNodeEventHandler (object sender, XmlNodeEventArgs e);
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
//
|
||||
// System.Xml.Serialization.XmlSerializerVersionAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Atsushi Enomoto <atsushi@ximian.com>
|
||||
//
|
||||
// Copyright (C) 2006 Novell, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Schema;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
[MonoTODO]
|
||||
public class XmlSchemaEnumerator : IEnumerator<XmlSchema>, IDisposable, IEnumerator
|
||||
{
|
||||
IEnumerator e;
|
||||
|
||||
public XmlSchemaEnumerator (XmlSchemas list)
|
||||
{
|
||||
e = list.GetEnumerator ();
|
||||
}
|
||||
|
||||
public XmlSchema Current {
|
||||
get { return (XmlSchema) e.Current; }
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveNext ()
|
||||
{
|
||||
return e.MoveNext ();
|
||||
}
|
||||
|
||||
object IEnumerator.Current {
|
||||
get { return Current; }
|
||||
}
|
||||
|
||||
void IEnumerator.Reset ()
|
||||
{
|
||||
e.Reset ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -443,6 +443,8 @@ namespace System.Xml.Serialization
|
||||
XmlQualifiedName qname;
|
||||
XmlSchemaType stype;
|
||||
|
||||
if (!schemas.IsCompiled)
|
||||
schemas.Compile (null, true);
|
||||
XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (name, typeof (XmlSchemaElement));
|
||||
if (!LocateElement (elem, out qname, out stype))
|
||||
throw new InvalidOperationException (String.Format ("'{0}' is missing.", name));
|
||||
@@ -729,7 +731,7 @@ namespace System.Xml.Serialization
|
||||
if (refAttr.DefaultValue != null)
|
||||
member.DefaultValue = ImportDefaultValue (member.TypeData, refAttr.DefaultValue);
|
||||
else if (member.TypeData.IsValueType)
|
||||
member.IsOptionalValueType = (refAttr.ValidatedUse != XmlSchemaUse.Required);
|
||||
member.IsOptionalValueType = (refAttr.Use != XmlSchemaUse.Required);
|
||||
|
||||
if (member.TypeData.IsComplexType)
|
||||
member.MappedType = GetTypeMapping (member.TypeData);
|
||||
@@ -1690,7 +1692,7 @@ namespace System.Xml.Serialization
|
||||
}
|
||||
else
|
||||
{
|
||||
ns = attr.ParentIsSchema ? typeQName.Namespace : String.Empty;
|
||||
ns = attr.Parent is XmlSchema ? typeQName.Namespace : String.Empty;
|
||||
return attr;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user