Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
2008-08-05 Gert Driesen <drieseng@users.sourceforge.net>
* SoapHexBinary.cs: In Byte [] ctor, actually save the value. Fixes
bug #414373. In Parse, when passed in value has uneven length throw
a RemotingException. On 2.0 profile, throw RemotingException for
invalid hex digits.
2008-07-02 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* SoapYearMonth.cs:
* SoapYear.cs:
* SoapQName.cs:
* SoapHexBinary.cs:
* SoapDuration.cs:
* SoapDate.cs: Fix parameter names
2005-08-01 Lluis Sanchez Gual <lluis@ximian.com>
* SoapPositiveInteger.cs: Set correct XsdType name for SoapPositiveInteger.
2005-06-27 Lluis Sanchez Gual <lluis@ximian.com>
* SoapDuration.cs: Fixed parsing of TimeSpan values. Based on a fix
by Roei Erez. Also fixed issues in the ToString method.
Closes bug #75340.
2004-06-15 Gert Driesen <drieseng@users.sourceforge.net>
* SoapHexBinary.cs: fixed serialization compatibility with MS.NET
* SoapQName.cs: fixed serialization compatibility with MS.NET
2003-11-28 Dick Porter <dick@ximian.com>
* SoapQName.cs: Use the char form of IndexOf, so that the
comparison is done with the Invariant culture.
2003-11-17 Lluis Sanchez Gual <lluis@ximian.com>
* SoapAnyUri.cs, SoapBase64Binary.cs, SoapDate.cs, SoapDateTime.cs
SoapDay.cs, SoapDuration.cs, SoapEntities.cs, SoapEntity.cs,
SoapHexBinary.cs, SoapId.cs, SoapIdref.cs, SoapIdrefs.cs, SoapInteger.cs,
SoapLanguage.cs, SoapMonth.cs, SoapMonthDay.cs, SoapName.cs,
SoapNcName.cs, SoapNegativeInteger.cs, SoapNmtoken.cs, SoapNmtokens.cs,
SoapNonNegativeInteger.cs, SoapNonPositiveInteger.cs,
SoapNormalizedString.cs, SoapNotation.cs, SoapPositiveInteger.cs,
SoapQName.cs, SoapTime.cs, SoapToken.cs, SoapYear.cs, SoapYearMonth.cs:
Implemented
* SoapHelper.cs: Added

View File

@@ -0,0 +1,39 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
//
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[System.Runtime.InteropServices.ComVisible (true)]
public interface ISoapXsd {
string GetXsdType();
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapAnyUri
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapAnyUri : ISoapXsd
{
string _value;
public SoapAnyUri ()
{
}
public SoapAnyUri (string value)
{
_value = value;
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "anyUri"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapAnyUri Parse (string value)
{
return new SoapAnyUri (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapBase64Binary
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapBase64Binary : ISoapXsd
{
byte[] _value;
public SoapBase64Binary ()
{
}
public SoapBase64Binary (byte[] value)
{
_value = value;
}
public byte [] Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "base64Binary"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapBase64Binary Parse (string value)
{
return new SoapBase64Binary (Convert.FromBase64String (value));
}
public override string ToString()
{
return Convert.ToBase64String (_value);
}
}
}

View File

@@ -0,0 +1,108 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDate.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Globalization;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapDate : ISoapXsd
{
static readonly string[] _datetimeFormats = new string[]
{
"yyyy-MM-dd",
"'+'yyyy-MM-dd",
"'-'yyyy-MM-dd",
"yyyy-MM-ddzzz",
"'+'yyyy-MM-ddzzz",
"'-'yyyy-MM-ddzzz"
};
int _sign;
DateTime _value;
public SoapDate ()
{
}
public SoapDate (DateTime value)
{
_value = value;
}
public SoapDate (DateTime value, int sign)
{
_value = value;
_sign = sign;
}
public int Sign {
get { return _sign; }
set { _sign = value; }
}
public DateTime Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "date"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapDate Parse (string value)
{
DateTime d = DateTime.ParseExact (value, _datetimeFormats, null, DateTimeStyles.None);
SoapDate res = new SoapDate (d);
if (value.StartsWith ("-")) res.Sign = -1;
else res.Sign = 0;
return res;
}
public override string ToString()
{
if (_sign >= 0)
return _value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
else
return _value.ToString("'-'yyyy-MM-dd", CultureInfo.InvariantCulture);
}
}
}

View File

@@ -0,0 +1,87 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDateTime
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Globalization;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapDateTime
{
static readonly string[] _datetimeFormats = new string[] {
"yyyy-MM-ddTHH:mm:ss",
"yyyy-MM-ddTHH:mm:ss.f",
"yyyy-MM-ddTHH:mm:ss.ff",
"yyyy-MM-ddTHH:mm:ss.fff",
"yyyy-MM-ddTHH:mm:ss.ffff",
"yyyy-MM-ddTHH:mm:ss.fffff",
"yyyy-MM-ddTHH:mm:ss.ffffff",
"yyyy-MM-ddTHH:mm:ss.fffffff",
"yyyy-MM-ddTHH:mm:sszzz",
"yyyy-MM-ddTHH:mm:ss.fzzz",
"yyyy-MM-ddTHH:mm:ss.ffzzz",
"yyyy-MM-ddTHH:mm:ss.fffzzz",
"yyyy-MM-ddTHH:mm:ss.ffffzzz",
"yyyy-MM-ddTHH:mm:ss.fffffzzz",
"yyyy-MM-ddTHH:mm:ss.ffffffzzz",
"yyyy-MM-ddTHH:mm:ss.fffffffzzz",
"yyyy-MM-ddTHH:mm:ssZ",
"yyyy-MM-ddTHH:mm:ss.fZ",
"yyyy-MM-ddTHH:mm:ss.ffZ",
"yyyy-MM-ddTHH:mm:ss.fffZ",
"yyyy-MM-ddTHH:mm:ss.ffffZ",
"yyyy-MM-ddTHH:mm:ss.fffffZ",
"yyyy-MM-ddTHH:mm:ss.ffffffZ",
"yyyy-MM-ddTHH:mm:ss.fffffffZ"
};
public SoapDateTime()
{
}
public static string XsdType {
get { return "dateTime"; }
}
public static DateTime Parse (string value)
{
return DateTime.ParseExact (value, _datetimeFormats, null, DateTimeStyles.None);
}
public static string ToString(DateTime value)
{
return value.ToString("yyyy-MM-ddTHH:mm:ss.fffffffzzz", CultureInfo.InvariantCulture);
}
}
}

View File

@@ -0,0 +1,85 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDay
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Globalization;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapDay : ISoapXsd
{
static readonly string[] _datetimeFormats = new string[]
{
"---dd",
"---ddzzz"
};
DateTime _value;
public SoapDay ()
{
}
public SoapDay (DateTime value)
{
_value = value;
}
public DateTime Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "gDay"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapDay Parse (string value)
{
DateTime d = DateTime.ParseExact (value, _datetimeFormats, null, DateTimeStyles.None);
return new SoapDay (d);
}
public override string ToString()
{
return _value.ToString("---dd", CultureInfo.InvariantCulture);
}
}
}

View File

@@ -0,0 +1,195 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDuration.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Text;
using System.Globalization;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapDuration
{
public SoapDuration()
{
}
public static string XsdType {
get { return "duration"; }
}
public static TimeSpan Parse (string value)
{
if (value.Length == 0)
throw new ArgumentException ("Invalid format string for duration schema datatype.");
int start = 0;
if (value [0] == '-')
start = 1;
bool minusValue = (start == 1);
if (value [start] != 'P')
throw new ArgumentException ("Invalid format string for duration schema datatype.");
start++;
int parseStep = 0;
int days = 0;
bool isTime = false;
int hours = 0;
int minutes = 0;
double seconds = 0;
bool error = false;
int i = start;
while (i < value.Length) {
if (value [i] == 'T') {
isTime = true;
parseStep = 4;
i++;
start = i;
continue;
}
bool isIntegerValue = true;
int dotOccurence = 0;
for (; i < value.Length; i++)
{
if (!Char.IsDigit (value [i]))
{
//check if it is a non integer value.
if (value[i] == '.')
{
isIntegerValue = false;
dotOccurence++;
//if there is more than one dot in the number
//than its an error
if (dotOccurence > 1 )
{
error = true;
break;
}
}
else
break;
}
}
int intValue = -1;
double doubleValue = -1;
if (isIntegerValue)
intValue = int.Parse (value.Substring (start, i - start));
else
doubleValue = double.Parse (value.Substring (start, i - start), CultureInfo.InvariantCulture);
switch (value [i]) {
case 'Y':
days += intValue * 365;
if (parseStep > 0 || !isIntegerValue)
error = true;
else
parseStep = 1;
break;
case 'M':
if (parseStep < 2 && isIntegerValue) {
days += 365 * (intValue / 12) + 30 * (intValue % 12);
parseStep = 2;
} else if (isTime && parseStep < 6 && isIntegerValue) {
minutes = intValue;
parseStep = 6;
}
else
error = true;
break;
case 'D':
days += intValue;
if (parseStep > 2 || !isIntegerValue)
error = true;
else
parseStep = 3;
break;
case 'H':
hours = intValue;
if (!isTime || parseStep > 4 || !isIntegerValue)
error = true;
else
parseStep = 5;
break;
case 'S':
if (isIntegerValue)
seconds = intValue;
else
seconds = doubleValue;
if (!isTime || parseStep > 6)
error = true;
else
parseStep = 7;
break;
default:
error = true;
break;
}
if (error)
break;
++i;
start = i;
}
if (error)
throw new ArgumentException ("Invalid format string for duration schema datatype.");
TimeSpan ts = new TimeSpan (days, hours, minutes, 0) + TimeSpan.FromSeconds (seconds);
return minusValue ? -ts : ts;
}
public static string ToString (TimeSpan timeSpan)
{
StringBuilder builder = new StringBuilder();
if (timeSpan.Ticks < 0) {
builder.Append('-');
timeSpan = timeSpan.Negate();
}
builder.Append('P');
if (timeSpan.Days > 0) builder.Append(timeSpan.Days).Append('D');
if (timeSpan.Days > 0 || timeSpan.Minutes > 0 || timeSpan.Seconds > 0 || timeSpan.Milliseconds > 0) {
builder.Append('T');
if (timeSpan.Hours > 0) builder.Append(timeSpan.Hours).Append('H');
if (timeSpan.Minutes > 0) builder.Append(timeSpan.Minutes).Append('M');
if (timeSpan.Seconds > 0 || timeSpan.Milliseconds > 0) {
double secs = (double) timeSpan.Seconds;
if (timeSpan.Milliseconds > 0)
secs += ((double)timeSpan.Milliseconds) / 1000.0;
builder.Append(String.Format(CultureInfo.InvariantCulture, "{0:0.0000000}", secs));
builder.Append('S');
}
}
return builder.ToString();
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapEntities
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapEntities : ISoapXsd
{
string _value;
public SoapEntities ()
{
}
public SoapEntities (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "ENTITIES"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapEntities Parse (string value)
{
return new SoapEntities (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapEntity
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapEntity : ISoapXsd
{
string _value;
public SoapEntity ()
{
}
public SoapEntity (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "ENTITY"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapEntity Parse (string value)
{
return new SoapEntity (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,50 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapNmtoken
//
// Authors:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Novell, Inc.
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
internal class SoapHelper
{
public static Exception GetException (ISoapXsd type, string msg)
{
return new RemotingException ("Soap Parse error, xsd:type xsd:" + type.GetXsdType() + " " + msg);
}
public static string Normalize (string s)
{
return s;
}
}
}

View File

@@ -0,0 +1,122 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapHexBinary.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Globalization;
using System.Text;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapHexBinary : ISoapXsd
{
byte[] _value;
StringBuilder sb = new StringBuilder ();
public SoapHexBinary ()
{
}
public SoapHexBinary (byte[] value)
{
_value = value;
}
public byte [] Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "hexBinary"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapHexBinary Parse (string value)
{
byte [] bytes = FromBinHexString (value);
return new SoapHexBinary (bytes);
}
internal static byte [] FromBinHexString (string value)
{
char [] chars = value.ToCharArray ();
byte [] buffer = new byte [chars.Length / 2 + chars.Length % 2];
int charLength = chars.Length;
if (charLength % 2 != 0)
throw CreateInvalidValueException (value);
int bufIndex = 0;
for (int i = 0; i < charLength - 1; i += 2) {
buffer [bufIndex] = FromHex (chars [i], value);
buffer [bufIndex] <<= 4;
buffer [bufIndex] += FromHex (chars [i + 1], value);
bufIndex++;
}
return buffer;
}
static byte FromHex (char hexDigit, string value)
{
try {
return byte.Parse (hexDigit.ToString (),
NumberStyles.HexNumber,
CultureInfo.InvariantCulture);
} catch (FormatException) {
throw CreateInvalidValueException (value);
}
}
static Exception CreateInvalidValueException (string value)
{
return new RemotingException (string.Format (
CultureInfo.InvariantCulture,
"Invalid value '{0}' for xsd:{1}.",
value, XsdType));
}
public override string ToString()
{
sb.Length = 0;
foreach (byte b in _value)
sb.Append (b.ToString ("X2"));
return sb.ToString ();
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapId
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapId : ISoapXsd
{
string _value;
public SoapId()
{
}
public SoapId (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "ID"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapId Parse (string value)
{
return new SoapId (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapIdref
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapIdref : ISoapXsd
{
string _value;
public SoapIdref()
{
}
public SoapIdref (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "IDREF"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapIdref Parse (string value)
{
return new SoapIdref (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapIdrefs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapIdrefs : ISoapXsd
{
string _value;
public SoapIdrefs()
{
}
public SoapIdrefs (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "IDREFS"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapIdrefs Parse (string value)
{
return new SoapIdrefs (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapInteger
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapInteger : ISoapXsd
{
decimal _value;
public SoapInteger ()
{
}
public SoapInteger (decimal value)
{
_value = value;
}
public decimal Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "integer"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapInteger Parse (string value)
{
return new SoapInteger (decimal.Parse (value));
}
public override string ToString()
{
return _value.ToString ();
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapLanguage
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapLanguage : ISoapXsd
{
string _value;
public SoapLanguage ()
{
}
public SoapLanguage (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "language"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapLanguage Parse (string value)
{
return new SoapLanguage (value);
}
public override string ToString()
{
return _value;
}
}
}

View File

@@ -0,0 +1,85 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapMonth
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Globalization;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapMonth : ISoapXsd
{
static readonly string[] _datetimeFormats = new string[]
{
"--MM--",
"--MM--zzz"
};
DateTime _value;
public SoapMonth ()
{
}
public SoapMonth (DateTime value)
{
_value = value;
}
public DateTime Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "gMonth"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapMonth Parse (string value)
{
DateTime d = DateTime.ParseExact (value, _datetimeFormats, null, DateTimeStyles.None);
return new SoapMonth (d);
}
public override string ToString()
{
return _value.ToString("--MM--", CultureInfo.InvariantCulture);
}
}
}

View File

@@ -0,0 +1,85 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapMonthDay
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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;
using System.Globalization;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapMonthDay : ISoapXsd
{
static readonly string[] _datetimeFormats = new string[]
{
"--MM-dd",
"--MM-ddzzz"
};
DateTime _value;
public SoapMonthDay ()
{
}
public SoapMonthDay (DateTime value)
{
_value = value;
}
public DateTime Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "gMonthDay"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapMonthDay Parse (string value)
{
DateTime d = DateTime.ParseExact (value, _datetimeFormats, null, DateTimeStyles.None);
return new SoapMonthDay (d);
}
public override string ToString()
{
return _value.ToString("--MM-dd", CultureInfo.InvariantCulture);
}
}
}

View File

@@ -0,0 +1,77 @@
//
// System.Runtime.Remoting.Metadata.W3cXsd2001.SoapName
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Martin Willemoes Hansen
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.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.Runtime.Remoting.Metadata.W3cXsd2001
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class SoapName : ISoapXsd
{
string _value;
public SoapName ()
{
}
public SoapName (string value)
{
_value = SoapHelper.Normalize (value);
}
public string Value {
get { return _value; }
set { _value = value; }
}
public static string XsdType {
get { return "Name"; }
}
public string GetXsdType()
{
return XsdType;
}
public static SoapName Parse (string value)
{
return new SoapName (value);
}
public override string ToString()
{
return _value;
}
}
}

Some files were not shown because too many files have changed in this diff Show More