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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
// ::MONO
//
// System.Globalization.CalendarAlgorithmType.cs
//
//
// 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.Globalization
{
[System.Runtime.InteropServices.ComVisible(true)]
public enum CalendarAlgorithmType
{
Unknown = 0,
SolarCalendar = 1,
LunarCalendar = 2,
LunisolarCalendar = 3,
}
}

View File

@@ -0,0 +1,52 @@
// ::MONO
//
// System.Globalization.CalendarWeekRule.cs
//
// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
//
// Contributors: Wictor Wilén
//
// Revisions
// 2001-09-14: First draft
// 2001-09-15: First release
//
// 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.Globalization
{
/// <summary>
/// The System.Globalization.CalendarWeekRule enumeration
/// </summary>
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum CalendarWeekRule
{
FirstDay = 0,
FirstFullWeek = 1,
FirstFourDayWeek = 2
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,308 @@
//
// System.Globalization.CharUnicodeInfo.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// (C)2005 Novell Inc,
//
//
// Copyright (C) 2005 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.Globalization
{
public static class CharUnicodeInfo
{
public static int GetDecimalDigitValue (char ch)
{
int i = (int) ch;
switch (i) {
// They are not decimal digits but are regarded as they were.
case 178:
return 2;
case 179:
return 3;
case 185:
return 1;
case 8304:
return 0;
}
// They are not decimal digits but are regarded as they were.
if (8308 <= i && i < 8314)
return i - 8304;
if (8320 <= i && i < 8330)
return i - 8320;
if (!Char.IsDigit (ch))
return -1;
if (i < 58)
return i - 48;
if (i < 1642)
return i - 1632;
if (i < 1786)
return i - 1776;
if (i < 2416)
return i - 2406;
if (i < 2544)
return i - 2534;
if (i < 2672)
return i - 2662;
if (i < 2800)
return i - 2790;
if (i < 2928)
return i - 2918;
if (i < 3056)
return i - 3046;
if (i < 3184)
return i - 3174;
if (i < 3312)
return i - 3302;
if (i < 3440)
return i - 3430;
if (i < 3674)
return i - 3664;
if (i < 3802)
return i - 3792;
if (i < 3882)
return i - 3872;
if (i < 4170)
return i - 4160;
if (i < 4978)
return i - 4968;
if (i < 6122)
return i - 6112;
if (i < 6170)
return i - 6160;
if (i < 8314)
return i - 8304;
if (i < 8330)
return i - 8320;
if (i < 65296)
return -1;
if (i < 65306)
return i - 65296;
return -1;
}
public static int GetDecimalDigitValue (string s, int index)
{
if (s == null)
throw new ArgumentNullException ("s");
return GetDecimalDigitValue (s [index]);
}
public static int GetDigitValue (char ch)
{
int i = GetDecimalDigitValue (ch);
if (i >= 0)
return i;
i = (int) ch;
if (i == 9450)
return 0;
// They are False in Char.IsDigit(), but returns a digit
if (i >= 9312 && i < 9321)
return i - 9311;
if (i >= 9332 && i < 9341)
return i - 9331;
if (i >= 9352 && i < 9361)
return i - 9351;
if (i >= 9461 && i < 9470)
return i - 9460;
if (i >= 10102 && i < 10111)
return i - 10101;
if (i >= 10112 && i < 10121)
return i - 10111;
if (i >= 10122 && i < 10131)
return i - 10121;
return -1;
}
public static int GetDigitValue (string s, int index)
{
if (s == null)
throw new ArgumentNullException ("s");
return GetDigitValue (s [index]);
}
public static double GetNumericValue (char ch)
{
int i = GetDigitValue (ch);
if (i >= 0)
return i;
i = (int) ch;
switch (i) {
case 188:
return 0.25;
case 189:
return 0.5;
case 190:
return 0.75;
case 2548:
return 1;
case 2549:
return 2;
case 2550:
return 3;
case 2551:
return 4;
case 2553:
return 16;
case 3056:
return 10;
case 3057:
return 100;
case 3058:
return 1000;
case 4988:
return 10000;
case 5870:
return 17;
case 5871:
return 18;
case 5872:
return 19;
case 8531:
return 1.0 / 3;
case 8532:
return 2.0 / 3;
case 8537:
return 1.0 / 6;
case 8538:
return 5.0 / 6;
case 8539:
return 1.0 / 8;
case 8540:
return 3.0 / 8;
case 8541:
return 5.0 / 8;
case 8542:
return 7.0 / 8;
case 8543:
return 1;
case 8556:
return 50;
case 8557:
return 100;
case 8558:
return 500;
case 8559:
return 1000;
case 8572:
return 50;
case 8573:
return 100;
case 8574:
return 500;
case 8575:
return 1000;
case 8576:
return 1000;
case 8577:
return 5000;
case 8578:
return 10000;
case 9470: // IsNumber(c) is False BTW.
case 10111:
case 10121:
case 10131:
return 10;
case 12295:
return 0;
case 12344:
return 10;
case 12345:
return 20;
case 12346:
return 30;
}
// They are not True by IsNumber() but regarded as they were.
if (9451 <= i && i < 9461)
return i - 9440;
if (12321 <= i && i < 12330)
return i - 12320;
if (12881 <= i && i < 12896)
return i - 12860;
if (12977 <= i && i < 12992)
return i - 12941;
if (!char.IsNumber (ch))
return -1;
if (i < 3891)
return 0.5 + i - 3882;
if (i < 4988)
return (i - 4977) * 10;
if (i < 8537)
return 0.2 * (i - 8532);
if (i < 8556)
return i - 8543;
if (i < 8572)
return i - 8559;
if (i < 9332)
return i - 9311;
if (i < 9352)
return i - 9331;
if (i < 9372)
return i - 9351;
if (i < 12694)
return i - 12689;
if (i < 12842)
return i - 12831;
if (i < 12938)
return i - 12927;
return -1;
}
public static double GetNumericValue (string s, int index)
{
if (s == null)
throw new ArgumentNullException ("s");
return GetNumericValue (s [index]);
}
public static UnicodeCategory GetUnicodeCategory (char ch)
{
return Char.GetUnicodeCategory (ch);
}
public static UnicodeCategory GetUnicodeCategory (string s, int index)
{
if (s == null)
throw new ArgumentNullException ("s");
return Char.GetUnicodeCategory (s, index);
}
}
}

View File

@@ -0,0 +1,99 @@
//
// ChineseLunisolarCalendar.cs
//
// Author
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2007 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.Globalization {
using System;
using System.Runtime.InteropServices;
[Serializable]
public class ChineseLunisolarCalendar : EastAsianLunisolarCalendar {
internal static readonly CCEastAsianLunisolarEraHandler era_handler;
static ChineseLunisolarCalendar ()
{
era_handler = new CCEastAsianLunisolarEraHandler ();
era_handler.appendEra (ChineseEra, CCFixed.FromDateTime (new DateTime (1, 1, 1)));
}
public const int ChineseEra = 1;
[MonoTODO]
public ChineseLunisolarCalendar ()
: base (era_handler)
{
}
[ComVisible (false)]
public override int [] Eras {
get {
return (int []) era_handler.Eras.Clone();
}
}
[ComVisible (false)]
public override int GetEra (DateTime time) {
// M_CheckDateTime not needed, because EraYear does the
// right thing.
int rd = CCFixed.FromDateTime(time);
int era;
era_handler.EraYear(out era, rd);
return era;
}
static DateTime ChineseMin = new DateTime (1901, 2, 19);
// looks like this valus is related to Lunar equation; Current
// epact compulation is valid only from 1900 to 2100.
static DateTime ChineseMax = new DateTime (2101, 1, 28, 23, 59, 59, 999);
[ComVisible (false)]
public override DateTime MinSupportedDateTime {
get {
return ChineseMin;
}
}
[ComVisible (false)]
public override DateTime MaxSupportedDateTime {
get {
return ChineseMax;
}
}
#if NET_4_5
protected override int DaysInYearBeforeMinSupportedYear {
get{
return 384;
}
}
#endif
}
}

View File

@@ -0,0 +1,59 @@
//
// System.Globalization.CodePageDataItem.cs
//
// Author:
// Kornél Pál <http://www.kornelpal.hu/>
//
// Copyright (C) 2006 Kornél Pál
//
//
// 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.
//
//
// .NET Framework 1.x serializes encoding properties using this class and
// .NET Framework 2.0 can deserialize it but drops the properties.
// This class supports serialization compatibility.
//
using System;
namespace System.Globalization
{
[Serializable]
internal sealed class CodePageDataItem
{
#pragma warning disable 169
private string m_bodyName;
private int m_codePage;
private int m_dataIndex;
private string m_description;
private uint m_flags;
private string m_headerName;
private int m_uiFamilyCodePage;
private string m_webName;
private CodePageDataItem ()
{
}
#pragma warning disable 169
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
// CompareOptions.cs
//
// This code was automatically generated from
// ECMA CLI XML Library Specification.
// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
// Created: Wed, 5 Sep 2001 06:34:52 UTC
// Source file: all.xml
// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
// 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.Globalization {
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
[Flags]
public enum CompareOptions {
None = 0,
IgnoreCase = 1,
IgnoreNonSpace = 2,
IgnoreSymbols = 4,
IgnoreKanaType = 8,
IgnoreWidth = 16,
StringSort = 0x20000000,
Ordinal = 0x40000000,
OrdinalIgnoreCase = 0x10000000
} // CompareOptions
} // System.Globalization

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,122 @@
//
// System.Globalization.CultureNotFoundException.cs
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@novell.com)
//
// Copyright (c) 2010 Novell (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.
//
#if NET_4_0
using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Globalization {
[Serializable]
[ComVisible (true)]
public class CultureNotFoundException : ArgumentException, ISerializable {
string invalid_culture_name;
int? invalid_culture_id;
public CultureNotFoundException () : base ("Culture not found")
{
}
public CultureNotFoundException (string message) : base (message)
{
}
protected CultureNotFoundException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
invalid_culture_name = (string) info.GetValue ("invalid_culture_name", typeof (string));
invalid_culture_id = (int?) info.GetValue ("invalid_culture_id", typeof (int?));
}
public CultureNotFoundException (string message, Exception innerException)
: base (message, innerException)
{
}
public CultureNotFoundException (string paramName, string message)
: base (message, paramName)
{
}
public CultureNotFoundException (string message, int invalidCultureId, Exception innerException)
: base (message, innerException)
{
invalid_culture_id = invalidCultureId;
}
public CultureNotFoundException (string paramName, int invalidCultureId, string message)
: base (message, paramName)
{
invalid_culture_id = invalidCultureId;
}
public CultureNotFoundException (string message, string invalidCultureName, Exception innerException)
: base (message, innerException)
{
invalid_culture_name = invalidCultureName;
}
public CultureNotFoundException (string paramName, string invalidCultureName, string message)
: base (message, paramName)
{
invalid_culture_name = invalidCultureName;
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
base.GetObjectData (info, context);
info.AddValue ("invalid_culture_name", invalid_culture_name, typeof (string));
info.AddValue ("invalid_culture_id", invalid_culture_id, typeof (int?));
}
public virtual int? InvalidCultureId {
get { return invalid_culture_id; }
}
public virtual string InvalidCultureName {
get { return invalid_culture_name; }
}
public override string Message {
get {
if (invalid_culture_name == null && invalid_culture_id.HasValue == false)
return base.Message;
if (invalid_culture_name != null)
return String.Format ("Culture name {0} is invalid", invalid_culture_name);
return String.Format ("Culture ID {0} is invalid", invalid_culture_id);
}
}
}
}
#endif

View File

@@ -0,0 +1,61 @@
// CultureTypes.cs
//
// This code was automatically generated from
// ECMA CLI XML Library Specification.
// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
// Created: Wed, 5 Sep 2001 06:35:02 UTC
// Source file: all.xml
// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
// 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.Globalization {
/// <summary>
/// </summary>
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum CultureTypes {
NeutralCultures = 1,
SpecificCultures = 2,
InstalledWin32Cultures = 4,
AllCultures = 7,
UserCustomCulture = 8,
ReplacementCultures = 16,
#if NET_4_0
[Obsolete]
#endif
WindowsOnlyCultures = 32,
#if NET_4_0
[Obsolete]
#endif
FrameworkCultures = 64,
} // CultureTypes
} // System.Globalization

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
// DateTimeStyles.cs
//
// This code was automatically generated from
// ECMA CLI XML Library Specification.
// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
// Created: Fri, 7 Sep 2001 16:32:07 UTC
// Source file: AllTypes.xml
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2005 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.Globalization {
[Flags]
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum DateTimeStyles {
None = 0x00000000,
AllowLeadingWhite = 0x00000001,
AllowTrailingWhite = 0x00000002,
AllowInnerWhite = 0x00000004,
AllowWhiteSpaces = AllowLeadingWhite | AllowTrailingWhite | AllowInnerWhite,
NoCurrentDateDefault = 0x00000008,
AdjustToUniversal = 0x00000010,
AssumeLocal = 0x00000020,
AssumeUniversal = 0x00000040,
RoundtripKind = 0x00000080,
} // DateTimeStyles
} // System.Globalization

View File

@@ -0,0 +1,70 @@
//
// System.Globalization.DaylightTime
//
// Author:
// Chris Hynes (chrish@assistedsolutions.com)
//
// (C) 2001 Chris Hynes
// Copyright (C) 2004-2005 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.Globalization
{
[System.Runtime.InteropServices.ComVisible (true)]
[Serializable]
public class DaylightTime
{
DateTime m_start, m_end;
TimeSpan m_delta;
public DaylightTime(DateTime start, DateTime end, TimeSpan delta)
{
m_start = start;
m_end = end;
m_delta = delta;
}
public DateTime Start
{
get
{
return m_start;
}
}
public DateTime End
{
get
{
return m_end;
}
}
public TimeSpan Delta
{
get
{
return m_delta;
}
}
}
}

View File

@@ -0,0 +1,33 @@
//
// 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.Globalization {
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
public enum DigitShapes {
Context = 0,
None = 1,
NativeNational = 2
}
}

View File

@@ -0,0 +1,242 @@
//
// System.Globalization.EastAsianLunisolarCalendar.cs
//
// Author
// Ulrich Kunitz 2002
// Atsushi Enomoto <atsushi@ximian.com>
//
// (C) Ulrich Kunitz 2002
// Copyright (C) 2007 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.Globalization {
using System;
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public abstract class EastAsianLunisolarCalendar : Calendar {
// FIXME: This is ok and it does not have to be something like
// CCEastAsianLunisolarEraHandler since it does not depend on
// any lunisolar stuff.
internal readonly CCEastAsianLunisolarEraHandler M_EraHandler;
internal EastAsianLunisolarCalendar (CCEastAsianLunisolarEraHandler eraHandler)
{
M_EraHandler = eraHandler;
}
public override int TwoDigitYearMax
{
get {
return twoDigitYearMax;
}
set {
CheckReadOnly ();
M_ArgumentInRange ("value", value, 100, M_MaxYear);
twoDigitYearMax = value;
}
}
internal void M_CheckDateTime(DateTime time) {
M_EraHandler.CheckDateTime(time);
}
internal virtual int ActualCurrentEra {
get { return 1; }
}
internal void M_CheckEra(ref int era) {
if (era == CurrentEra)
era = ActualCurrentEra;
if (!M_EraHandler.ValidEra(era))
throw new ArgumentException("Era value was not valid.");
}
internal int M_CheckYEG(int year, ref int era) {
M_CheckEra(ref era);
return M_EraHandler.GregorianYear(year, era);
}
internal override void M_CheckYE(int year, ref int era) {
M_CheckYEG(year, ref era);
}
internal int M_CheckYMEG(int year, int month, ref int era) {
int gregorianYear = M_CheckYEG(year, ref era);
if (month < 1 || month > 12)
throw new ArgumentOutOfRangeException("month",
"Month must be between one and twelve.");
return gregorianYear;
}
internal int M_CheckYMDEG(int year, int month, int day, ref int era)
{
int gregorianYear = M_CheckYMEG(year, month, ref era);
M_ArgumentInRange("day", day, 1, GetDaysInMonth(year, month, era));
return gregorianYear;
}
[MonoTODO]
public override DateTime AddMonths(DateTime time, int months) {
DateTime t = CCEastAsianLunisolarCalendar.AddMonths(time, months);
M_CheckDateTime(t);
return t;
}
[MonoTODO]
public override DateTime AddYears(DateTime time, int years) {
DateTime t = CCEastAsianLunisolarCalendar.AddYears(time, years);
M_CheckDateTime(t);
return t;
}
[MonoTODO]
public override int GetDayOfMonth(DateTime time) {
M_CheckDateTime(time);
return CCEastAsianLunisolarCalendar.GetDayOfMonth(time);
}
[MonoTODO]
public override DayOfWeek GetDayOfWeek(DateTime time) {
M_CheckDateTime(time);
int rd = CCFixed.FromDateTime(time);
return (DayOfWeek)CCFixed.day_of_week(rd);
}
[MonoTODO]
public override int GetDayOfYear(DateTime time) {
M_CheckDateTime(time);
return CCEastAsianLunisolarCalendar.GetDayOfYear(time);
}
[MonoTODO]
public override int GetDaysInMonth(int year, int month, int era) {
int gregorianYear = M_CheckYMEG(year, month, ref era);
return CCEastAsianLunisolarCalendar.GetDaysInMonth(gregorianYear, month);
}
[MonoTODO]
public override int GetDaysInYear(int year, int era) {
int gregorianYear = M_CheckYEG(year, ref era);
return CCEastAsianLunisolarCalendar.GetDaysInYear(gregorianYear);
}
[MonoTODO]
public override int GetLeapMonth(int year, int era)
{
return base.GetLeapMonth(year, era);
}
[MonoTODO]
public override int GetMonth(DateTime time) {
M_CheckDateTime(time);
return CCEastAsianLunisolarCalendar.GetMonth(time);
}
[MonoTODO]
public override int GetMonthsInYear(int year, int era) {
M_CheckYE(year, ref era);
return IsLeapYear (year, era) ? 13: 12;
}
public override int GetYear(DateTime time) {
// M_CheckDateTime not needed, because EraYeat does the
// right thing.
int rd = CCFixed.FromDateTime(time);
int era;
return M_EraHandler.EraYear(out era, rd);
}
public override bool IsLeapDay(int year, int month, int day, int era)
{
int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
// every day in LeapMonth is a LeapDay.
return CCEastAsianLunisolarCalendar.IsLeapMonth (gregorianYear, month);
}
[MonoTODO]
public override bool IsLeapMonth(int year, int month, int era) {
int gregorianYear = M_CheckYMEG(year, month, ref era);
return CCEastAsianLunisolarCalendar.IsLeapMonth(gregorianYear, month);
}
public override bool IsLeapYear(int year, int era) {
int gregorianYear = M_CheckYEG(year, ref era);
return CCEastAsianLunisolarCalendar.IsLeapYear (gregorianYear);
}
[MonoTODO]
public override DateTime ToDateTime(int year, int month, int day,
int hour, int minute, int second, int millisecond,
int era)
{
int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
M_CheckHMSM(hour, minute, second, millisecond);
return CCGregorianCalendar.ToDateTime(
gregorianYear, month, day,
hour, minute, second, millisecond);
}
[MonoTODO]
public override int ToFourDigitYear(int year) {
if (year < 0)
throw new ArgumentOutOfRangeException(
"year", "Non-negative number required.");
int era = CurrentEra;
M_CheckYE(year, ref era);
return year;
}
public override CalendarAlgorithmType AlgorithmType {
get {
return CalendarAlgorithmType.LunisolarCalendar;
}
}
#region celestial/terrestial thingy
public int GetCelestialStem (int sexagenaryYear)
{
if (sexagenaryYear < 1 || 60 < sexagenaryYear)
throw new ArgumentOutOfRangeException ("sexagendaryYear is less than 0 or greater than 60");
return (sexagenaryYear - 1) % 10 + 1;
}
public virtual int GetSexagenaryYear (DateTime time)
{
return (GetYear (time) - 1900) % 60;
}
public int GetTerrestrialBranch (int sexagenaryYear)
{
if (sexagenaryYear < 1 || 60 < sexagenaryYear)
throw new ArgumentOutOfRangeException ("sexagendaryYear is less than 0 or greater than 60");
return (sexagenaryYear - 1) % 12 + 1;
}
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
// GregorianCalendarTypes.cs
//
// This code was automatically generated from
// ECMA CLI XML Library Specification.
// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
// Created: Wed, 5 Sep 2001 06:35:19 UTC
// Source file: all.xml
// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
// 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.Globalization {
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum GregorianCalendarTypes {
/// <summary>
/// </summary>
Localized = 1,
/// <summary>
/// </summary>
USEnglish = 2,
/// <summary>
/// </summary>
MiddleEastFrench = 9,
/// <summary>
/// </summary>
Arabic = 10,
/// <summary>
/// </summary>
TransliteratedEnglish = 11,
/// <summary>
/// </summary>
TransliteratedFrench = 12,
} // GregorianCalendarTypes
} // System.Globalization

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