Compare commits

...
Author SHA1 Message Date
Miguel de Icaza 757c146741 [System.ServiceModel] Couple of extra classes 2015-02-17 23:21:59 -05:00
Miguel de Icaza d060165941 [System.ServiceModel] Bring UriTemplate from ReferenceSource 2015-02-17 22:59:15 -05:00
Miguel de Icaza 0a77ba4b2e Merge branch 'master' into wip-serialization 2015-02-17 22:46:23 -05:00
Zoltan Varga 8a5a230aec [runtime] Use -fvisibility=hidden so only symbols marked with MONO_API are exported. 2015-02-17 19:05:03 -05:00
Zoltan Varga 2b74940f64 [runtime] Link the logging profiler against eglib. 2015-02-17 19:03:39 -05:00
Zoltan Varga 065f41d168 [runtime] Export mono_threads_attach_tools_thread (). 2015-02-17 19:03:39 -05:00
Marek Safar 4d91c8e7d2 [build] Remove misused bootstrap profile definition 2015-02-17 21:58:23 +01:00
Marek Safar 451e14e4c8 [corlib] Remove duplicate source files 2015-02-17 21:43:23 +01:00
Marek Safar c495250fde [corlib] Replace resource keys with actual messages during compilation 2015-02-17 21:43:22 +01:00
Rodrigo Kumpera 04eeb70c8c Merge pull request #1570 from mono/fix27010
Bug 27010 - Difference in Assembly.GetExportedTypes with .NET
2015-02-17 13:49:05 -06:00
Alex Rønne Petersen 8bf480fc62 Merge pull request #1571 from evincarofautumn/fix-warning
[utils] Fix warning in Makefile.am.
2015-02-17 19:58:14 +01:00
Jon Purdy f14d23b7f0 [utils] Fix warning in Makefile.am. 2015-02-17 10:56:15 -08:00
João Matos b8dec77eea [mini] Improve the driver to handle more cases of incompatible cross-compilation targets. 2015-02-17 16:12:49 +00:00
João Matos ac8ae330c7 [metadata] Do not try to use host context members when cross-compiling. 2015-02-17 16:12:11 +00:00
João Matos 85e5ebbfa9 [metadata] Add missing ARM64 object offsets.
This fixes the mobile products build with Mono master.
2015-02-17 16:11:21 +00:00
Zoltan Varga 0ba6d1777d [aot] Fix the emission of ElementAddr wrappers. 2015-02-17 07:46:11 -05:00
Zoltan Varga 4c8a1a6733 [runtime] Link monodis against libmonoruntime instead of libmono which can be a dynamic lib. 2015-02-17 06:59:29 -05:00
Zoltan Varga ff2cfae862 [gsharedvt] Implement support for multi-dimensional arrays in gsharedvt methods. 2015-02-17 06:57:43 -05:00
Zoltan Varga acbe5f52d5 Fix a warning. 2015-02-17 05:44:58 -05:00
Marek Safar 673e8fa8ee [mcs] Single name meaning relaxation to match roslyn 2015-02-17 10:59:33 +01:00
Alex Rønne Petersen 33ad107825 Update refsrc to get read-only interface changes for System/System.Core. 2015-02-17 10:53:10 +01:00
Marek Safar 877e8ce941 [mcs] Fixes check for overriden auto-properties. 2015-02-17 08:14:21 +01:00
Ungureanu Marius 818d229538 Bug 27010 - Difference in Assembly.GetExportedTypes with .NET 2015-02-17 06:41:12 +02:00
Alex Rønne Petersen 235f543d94 [mini] Fix a crash on armel. 2015-02-17 02:04:15 +01:00
Zoltan Varga 6ee1b1b565 [jit] Add tests for arm64 gsharedvt argument passing. 2015-02-16 16:07:03 -05:00
Zoltan Varga 175c1a521d [jit] Add tests for arm64 gsharedvt argument passing. 2015-02-16 15:20:17 -05:00
Alexander Köplinger 8f7a551c0c [Microsoft.Build.Tasks] Rethrow exception in Copy task
This way we don't lose the original stacktrace.
2015-02-16 19:05:00 +01:00
Marek Safar 724c1becc1 Add new test 2015-02-16 17:03:50 +01:00
Marek Safar ed517ad778 [mcs] Implements dictionary initializers on pointer types 2015-02-16 16:48:24 +01:00
Miguel de Icaza aef0b3e04c Merge pull request #1542 from ninjarobot/UriTemplateMatchException
Fix to UriTemplate.Match to properly handle query parameters without a v...
2015-02-16 10:19:44 -05:00
Miguel de Icaza 5715cdc582 [System.ServiceModel] Prevent server crash when client disconnect
This patch is an updated version of a pull request (377) from Rob
Wilkens to fix #5926
2015-02-16 10:01:22 -05:00
João Matos bccf5cf121 [aot] Re-organize JSON dumping code. 2015-02-16 12:48:05 +00:00
João Matos d9234357f6 Revert "[aot] Re-organize JSON dumping code."
This reverts commit 25969466b5.
2015-02-16 12:46:29 +00:00
João Matos b4926395c6 [git] Ignore Doxygen-related generated files. 2015-02-16 12:39:03 +00:00
Zoltan Varga 25969466b5 [aot] Re-organize JSON dumping code. 2015-02-16 12:38:40 +00:00
Marek Safar bc57fda921 Merge pull request #1568 from akoeplinger/xbuild
[Microsoft.Build.Tasks] Implement retries in Copy task and add a stub.
2015-02-16 07:54:54 +01:00
Atsushi Eno 90b1124402 Merge branch 'import-text-encoding-2' 2015-02-16 14:34:19 +08:00
Alexander Köplinger 40c0dfcf93 [Microsoft.Build.Tasks] Add stub for UseHardlinksIfPossible to Copy task
Creating hardlinks in .NET doesn't have a nice API and using Mono.Unix/Pinvoke doesn't
seem worth the effort at this point since the feature is off by default on msbuild as well.
2015-02-16 01:50:07 +01:00
Alexander Köplinger baaf07c104 [Microsoft.Build.Tasks] Implement retries in Copy task 2015-02-16 01:38:06 +01:00
Atsushi Eno e4b2bc75aa [sys.xaml] serialize string value as string, do not try ValueConverter.
Fixed some xwt object serialization.
2015-02-16 03:32:49 +08:00
Zoltan Varga bcd70a77a7 [jit] Fix a regression introduced by 00a28a7dfd which disabled liveness2 for most methods. 2015-02-14 15:51:11 -05:00
Zoltan Varga bca66a090d [arm64] Add a test for vtype by ref returns in dyn calls. 2015-02-13 17:54:31 -05:00
João Matos 874d17321d [runtime] Fixed TLS detection on AMD64 to support cross-compilation. 2015-02-13 16:45:46 +00:00
Marek Safar 52c33f00ff [mcs] Better error reporting after delegate probing failed. Fixs #27043 2015-02-13 17:42:41 +01:00
João Matos e3279063de [aot] Added JSON dumping support.
This is enabled by passing "aot=dump" to the Mono AOT driver and will create a JSON file in the working directory with the name of the assembly.

It's still a work-in-progress and will see improvements in the data dumped as it's needed.
2015-02-13 16:41:07 +00:00
Marek Safar b9c8a612b7 [mcs] Set fixed buffer layourt wihout StructLayoutAttribute when possible. Fixes #27020 2015-02-13 16:49:22 +01:00
Marek Safar 8d3c6d44f8 [corlib] Random from reference sources 2015-02-13 15:05:43 +01:00
Marek Safar da9546edfd [corlib] MissingMember exceptions from reference sources 2015-02-13 14:58:40 +01:00
Marek Safar 09b16951bc [corlib] UnitySerialization from reference sources 2015-02-13 14:45:46 +01:00
Marek Safar 8157ba59ce [system.net.http] Parsing of nested parens inside comment. Fixes #27036 2015-02-13 14:37:32 +01:00
Marek Safar 1128af49cf [mcs] Resolve using aliases on demand to fix issue with nested types. Fixes #27001 2015-02-13 14:37:31 +01:00
João Matos 08014c4629 [monodis] Attempt to fix the Cygwin build.
CCLD     monodis.exe
../../mono/metadata/.libs/libmonoruntimesgen-static.a(libmonoruntimesgen_static_la-opcodes.o): In function `mono_opcode_name':
/cygdrive/c/projects/mono-817/mono/metadata/opcodes.c:63: multiple definition of `mono_opcode_name'
../mini/.libs/libmonosgen-2.0.dll.a(d001720.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
2015-02-13 12:43:06 +00:00
Atsushi Eno f47937f8f3 avoid reflection in EncodingHelper.
as per https://github.com/mono/mono/pull/1566#discussion_r24653304
2015-02-13 18:25:49 +08:00
Atsushi Eno 59dc2b42c8 [encoding] import referencesource encoding foundation types.
This change does not involve Windows-specific NLS-based encodings.
We will be still using I18N assemblies until we make more grand design
changes (Xamarin products premise those assemblies).

This also fixes bug #23771 and probably more.
2015-02-13 16:41:05 +08:00
Zoltan Varga 2a3385da86 Fix a warning. 2015-02-13 02:16:16 -05:00
Alex Rønne Petersen 61e8b5e6d0 [mini] Add a MONO_ARM_FORCE_SOFT_FLOAT environment variable. 2015-02-13 08:08:44 +01:00
Zoltan Varga 8a3b8e716f [runtime] Overwrite logging profiler output files automatically. 2015-02-13 00:39:48 -05:00
Zoltan Varga f16a4a1975 [runtime] Export mono_personality (), which is accessed from llvm compiled code. 2015-02-13 00:29:24 -05:00
Zoltan Varga b45199d288 [corlib] Fix a race in LazyTest.EnsureSingleThreadSafeExecution (). 2015-02-13 00:15:52 -05:00
Zoltan Varga 82554c4e89 [runtime] Add a SHARED_CFLAGS autoconf var which can be used to pass the -fvisibility=hidden flag. 2015-02-13 00:10:51 -05:00
Rodrigo Kumpera 19a22ede0d Merge pull request #1439 from BrzVlad/feature-managed-allocator
[jit] Optimize the managed allocator fastpath for small objects
2015-02-12 17:43:52 -06:00
Atsushi Eno 93ce056a76 Merge pull request #1496 from echampet/serializers
System.Xml.Serialization: fix xml serializers generation for Web Services
2015-02-13 05:08:10 +08:00
Atsushi Eno 33694c02b3 [encoding] as part of referencesource import, use new EncodingHelper class.
This will remain after importing referencesource and offer mono-only
internals for some classes. This involves icall (owner class) change.
2015-02-13 04:24:47 +08:00
Marek Safar 2ca5117fd2 [system] Mark ping MT implementation as broken 2015-02-12 19:09:08 +01:00
João Matos ccf89b6b5b [runtime] Fixed TLS detection on x86 to support cross-compilation. Fixes #26969.
https://bugzilla.xamarin.com/show_bug.cgi?id=26969.
2015-02-12 17:40:13 +00:00
Zoltan Varga 83ae5b92ac [runtime] Fix an automake warning. 2015-02-12 12:29:37 -05:00
Zoltan Varga 679f9b44a5 [runtime] Fix an initialization race when using custom marshallers. 2015-02-12 12:13:54 -05:00
João Matos 98a88d8009 Merge pull request #1534 from haf/bugs/hmac-wrong-keysizes
Bugs/hmac wrong keysizes
2015-02-12 16:46:00 +00:00
Marek Safar 72eb18f84d [system] More linker friendly tests 2015-02-12 17:00:34 +01:00
Zoltan Varga d7ae2816fe Merge pull request #1562 from vkargov/master
[runtime] Mark TLS variables as explicitly used
2015-02-12 10:03:40 -05:00
Vladimir Kargov 16ee025230 [runtime]
Mark TLS variables as explicitly used to avoid their unwarranted deletion
by the compiler overlooking their usage in inline assembly sections.
2015-02-12 17:45:34 +03:00
João Matos 90185288b1 [aot] Fixed LLVM assembly generation for non-Mach targets.
Fixes bugzilla #26964.
2015-02-12 13:42:46 +00:00
Marek Safar 45448a3f16 [corlib] Add timeout to more tests 2015-02-12 14:21:24 +01:00
Zoltan Varga 9eea9b6d70 [aot] Fix emission of symbol sizes which got broken by 05cd4225b2. 2015-02-12 07:49:08 -05:00
Marek Safar 3af8147e4d [system] Add old monotouch test codepath 2015-02-12 13:24:16 +01:00
Marek Safar 3d3c8b9bc6 [system.core] Fix wrong 405f9534df 2015-02-12 13:20:10 +01:00
Zoltan Varga 0871f1f266 Revert "[runtime] Use -fvisibility=hidden so only symbols marked with MONO_API are exported."
This reverts commit 90e86725ac.

Revert this as it causes many test failures.
2015-02-12 06:47:09 -05:00
Zoltan Varga b64c24b4ea [runtime] Export mono_gc_toggleref_add (). 2015-02-12 06:45:45 -05:00
Zoltan Varga 90e86725ac [runtime] Use -fvisibility=hidden so only symbols marked with MONO_API are exported. 2015-02-12 05:22:52 -05:00
Zoltan Varga 17eadbf010 [runtime] Define MONO_API_EXPORT properly for gcc, and define MONO_DLL_EXPORT so it is actually used during the build. 2015-02-12 05:21:50 -05:00
Zoltan Varga 029753034f Revert "[runtime] Use -fvisibility=hidden so only symbols marked with MONO_API are exported."
This reverts commit beb1463b6c.

Revert this for now as it breaks loading symbols from the mono executable on osx.
2015-02-12 04:51:06 -05:00
Marek Safar 52227a1e6d [runtime] Return strongly typed array from GetModules to match managed signature. Fixes a crash with strongly typed enumerator 2015-02-12 10:09:06 +01:00
Marcos Henrich b3aec8113a [corlib] Fixes commit ceef1e2.
We want to remove the module check from GetMethodToken not SetUserEntryPoint.
2015-02-12 08:59:21 +00:00
Zoltan Varga 4ef4090a22 [runtime] Export symbols from libtest. 2015-02-12 03:53:26 -05:00
Zoltan Varga 250cd40b86 [runtime] Remove unused MONO_ARCH_SAVE_REGS declarations. 2015-02-12 03:46:49 -05:00
Zoltan Varga b34c3f6f64 [jit] Remove unused MONO_ARCH_SAVE_REGS declarations. 2015-02-12 03:32:58 -05:00
Zoltan Varga d9259e59e1 [monodis] Build monodis against the static mono libraries. 2015-02-12 03:04:39 -05:00
Zoltan Varga beb1463b6c [runtime] Use -fvisibility=hidden so only symbols marked with MONO_API are exported. 2015-02-12 02:25:19 -05:00
Sebastien Pouliot cfc0d6fc73 [linker] Do not update the Scope on TypeSpecification (fix mmp regression tests) 2015-02-11 15:38:48 -05:00
Zoltan Varga 6f572dcc58 Merge pull request #1561 from main--/patch-1
Only call string.Format in Debug.Assert if really necessary
2015-02-11 13:49:53 -05:00
main() 2e6efb3149 Only call string.Format in Debug.Assert if really necessary
Right now (without this change), Debug.Assert **always** formats its string parameters, even if doing so wouldn't be necessary because the condition is true. This has a huge impact on code that asserts frequently because it assumes that calling Assert(true, ...) is cheap.
2015-02-11 19:42:29 +01:00
Marek Safar ceef1e2379 Merge pull request #1560 from esdrubal/xlstregression
[corlib] ModuleBuilder.GetMethodToken no longer has a module check.
2015-02-11 17:17:27 +01:00
Marcos Henrich 9eb81476bd [corlib] ModuleBuilder.GetMethodToken no longer has a module check.
.NET implementation is able to get method tokens from other modules.
This was causing a regression on a System.Xml.Xsl.XslTransformTests.Bug487065 while using referencesource's System.Xml implementation.
2015-02-11 15:59:37 +00:00
Marcos Henrich 1e7a4a2114 [corlib] Test GetMethodToken ability to get other modules' tokens.
.NET implementation is able to get method tokens from other modules.
2015-02-11 15:59:36 +00:00
João Matos f1006fbbe0 [msvc] Upgrade the projects to require VS2013. 2015-02-11 15:55:43 +00:00
Alex Rønne Petersen 628f3d998b Use -std=gnu99 as we rely on the linux macro in some places. 2015-02-11 16:50:59 +01:00
Marek Safar 2326fa0721 Bump reference sources 2015-02-11 16:42:40 +01:00
Zoltan Varga 46357aee0b [runtime] Enable C99 mode. 2015-02-11 10:32:34 -05:00
Zoltan Varga 984a13d908 [runtime] Use ISO C __typeof__ instead of typeof () in one place. 2015-02-11 10:32:13 -05:00
Zoltan Varga 3b85df9c0d Fix the loadable llvm build. 2015-02-11 09:44:45 -05:00
Sebastien Pouliot b6d6280821 [linker] Ignore null type arguments in MarkWithResolvedScope
It's ignored in MarkType but it breaks calling Resolve in this case
2015-02-11 09:01:35 -05:00
Marek Safar 8db46e61fd [corlib] Fixes build 2015-02-11 14:04:35 +01:00
Zoltan Varga a42f4d8d22 Merge pull request #1559 from directhex/emit-nunit-xml-in-unmanaged-tests
Add NUnit XML emission to the managed runtime test runner.
2015-02-11 08:00:18 -05:00
Jo Shields 84a8428de1 Add NUnit XML emission to the managed runtime test runner.
This makes it easy to plug failures from the runtime tests into a visualisation, such as Jenkins' jUnit display system.
2015-02-11 12:48:45 +00:00
Zoltan Varga 078968540f Make the managed test runner the default in mono/tests, run with make M=0 to use the old one. 2015-02-11 07:47:39 -05:00
Zoltan Varga 9b617125bd [llvm] Maps structs made up of floats/doubles to llvm structs containing floats. 2015-02-11 07:02:45 -05:00
Marek Safar 4e27a21367 [system] Fix ping process exit code check 2015-02-11 12:04:50 +01:00
Marek Safar f97001e2c8 [system] updates fixed test 2015-02-11 10:47:54 +01:00
Marek Safar 405f9534df [system.core] Update aes test to match imported code 2015-02-11 09:43:17 +01:00
Marek Safar ec2e126dfd [mcs] Additional fix for #26892 2015-02-11 09:21:20 +01:00
Sebastien Pouliot d07822286c [linker] Resolve types inside custom attributes since they might refer to types in assemblies we won't be keeping [#26752]
Custom attributes encoding means it's possible to have a scope that will
point into a PCL facade even if we (just before saving) will resolve all
type references.

Since all other references can be made on the _real_ assembly and that
we do not want to include any facade assembly just for this we need to
resolve those type and update their scope.
2015-02-10 21:04:02 -05:00
João Matos 325744cb85 [build] Fixed the MSVC build. 2015-02-10 15:14:16 +00:00
Marek Safar 9b9b96980b [corlib] Guid from reference sources 2015-02-10 15:42:13 +01:00
Marek Safar 86e2bada8a [mcs] Fixes failing test 2015-02-10 15:42:13 +01:00
Marcos Henrich b94c4cdce1 [corlib] Calling 'tzi.exe -i' now prints olson transitions. 2015-02-10 10:44:35 +00:00
Marcos Henrich 7169eeb5e0 [corlib] Updated make target tzi.exe 2015-02-10 10:39:29 +00:00
Marcos Henrich 8473c6db7e Moved android-dump-tzdata make target to corlib.
Reason: All TimeZoneInfo related files are now all in corlib directory.
2015-02-10 10:32:30 +00:00
Zoltan Varga 2f95909242 Merge pull request #1557 from StephenMcConnel/bug-26887
Prevent right click from triggering ToolStripItem.HandleClick
2015-02-10 04:25:34 -05:00
Marek Safar 158487fe94 Rename binary reference assemblies location 2015-02-10 10:21:29 +01:00
Marek Safar 85ee5582f6 [eval] Add C#6 using handling 2015-02-10 10:12:43 +01:00
Zoltan Varga e26e45cf2f Merge pull request #1558 from ermshiperete/fixCrash
[MWF] Fix NullReferenceException introduced by commit a080a7d
2015-02-10 04:05:26 -05:00
Damien Daspit f7593c22b0 [MWF] Fix NullReferenceException introduced by commit a080a7d
Change-Id: I5709063cc7eecc01fd1e2978cd8aac096060c31e
2015-02-10 09:59:50 +01:00
Marek Safar a74bac2da2 [mcs] Fixed casts rules don't apply to strings and arrays. Fixes #26892 2015-02-10 09:31:22 +01:00
Marek Safar c7a4778737 [mcs] Resolve delegate optional parameters only once. Fixes #26840 2015-02-10 08:49:50 +01:00
Zoltan Varga 8562a498f3 [jit] Factor out the gsharedvt constrained call handling code into a separate function. 2015-02-10 02:27:13 -05:00
Zoltan Varga 382cf74c98 [jit] Fix some issues with constrained gsharedvt calls to be able to handle some cases encountered with the new MS reference source code. 2015-02-10 02:20:32 -05:00
Zoltan Varga b8f1a79295 Increase some trampoline buffer sizes. 2015-02-09 23:08:57 -05:00
Zoltan Varga d7b1944dce Bump referencesource. 2015-02-09 22:40:50 -05:00
Zoltan Varga c83aeed35f Bump referencesource to e6af770c424af46f78d3b8f90eebbb2e0d7953a2. 2015-02-09 22:35:07 -05:00
Alex Rønne Petersen 23fa25b4b5 Revert "[mini] Implement atomic exchange with xchg on x86."
This reverts commit c96e58280c.

Getting this to work right with regards to register allocation
is turning out to be more complicated than it seems. Going to
abandon this for now.
2015-02-10 03:01:33 +01:00
Alex Rønne Petersen c96e58280c [mini] Implement atomic exchange with xchg on x86. 2015-02-10 01:49:18 +01:00
Stephen McConnel e9cf1dc44a Prevent right click from triggering ToolStripItem.HandleClick
This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=26887.
2015-02-09 18:39:18 -06:00
Zoltan Varga 8856edd6d3 Disable some full-aot tests on amd64 since it doesn't support dyn calls/gsharedvt. 2015-02-09 19:09:21 -05:00
Alex Rønne Petersen 0366b81069 [mini] Implement atomic exchange with xchg on amd64. 2015-02-09 23:41:30 +01:00
Marek Safar d2994b1b3d [corlib] Remove unused file 2015-02-09 23:15:16 +01:00
Marek Safar 8d9e34a098 [corlib] Keep file names ordered 2015-02-09 23:14:45 +01:00
Marek Safar 1bfa0567dc Merge pull request #1556 from atsushieno/import-text-encoding
import referencesource CharUnicodeInfo and remove some runtime char tables.
2015-02-09 20:09:04 +01:00
Alex Rønne Petersen 8aaed197ca Revert "[mini] Implement atomic exchange with xchg on x86/amd64."
This reverts commit 1a319806fe.

This seems to cause memory corruption that results in random
SGen crashes, especially in Roslyn.
2015-02-09 19:32:15 +01:00
Ludovic Henry 449666271a [runtime] Lower log level of "counters not enabled" message in counters 2015-02-09 13:12:11 -05:00
João Matos 48b7a501b0 Initialize the counters support before registering new ones.
This bug manifests itself in mkbundle'd programs that use the machine config support. Under this case, we can end up registering counters before initializing the counter support in the runtime:

```
* thread #1: tid = 0x141dec, 0x003ebdff mtouch-32`mono_counters_register(name=0x0042f7e3, type=2048, addr=0x00b81288) + 31 at mono-counters.c:218, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x003ebdff mtouch-32`mono_counters_register(name=0x0042f7e3, type=2048, addr=0x00b81288) + 31 at mono-counters.c:218
    frame #1: 0x0025c3f6 mtouch-32`mono_loader_init + 198 at loader.c:106
    frame #2: 0x0025f005 mtouch-32`mono_dllmap_insert(assembly=0x00000000, dll=0x00d0a0c0, func=0x00000000, tdll=0x00d0a0d0, tfunc=0x00000000) + 53 at loader.c:1321
    frame #3: 0x002c28ca mtouch-32`dllmap_start(user_data=0x00d0a0b0, element_name=0x00d0a0a0, attribute_names=0x00d0a030, attribute_values=0x00d0a040) + 698 at mono-config.c:290
    frame #4: 0x002c2010 mtouch-32`start_element(context=0x00d09fa0, element_name=0x00d0a0a0, attribute_names=0x00d0a030, attribute_values=0x00d0a040, user_data=0xbffffb68, error=0x00000000) + 240 at mono-config.c:176
    frame #5: 0x0040ba6d mtouch-32`monoeg_g_markup_parse_context_parse(context=0x00d09fa0, text=0x00b72f30, text_len=240, error=0x00000000) + 1965 at gmarkup.c:351
    frame #6: 0x002c0a93 mtouch-32`mono_config_parse_xml_with_context(state=0xbffffb68, text=0x00b72f30, len=240) + 147 at mono-config.c:440
    frame #7: 0x002c09eb mtouch-32`mono_config_parse_memory(buffer=0x00b72f30) + 123 at mono-config.c:482
    frame #8: 0x00001e6d mtouch-32`install_dll_config_files + 29
    frame #9: 0x00001c86 mtouch-32`mono_mkbundle_init + 22
    frame #10: 0x000029db mtouch-32`main + 331
    frame #11: 0x00001c65 mtouch-32`start + 53
```

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=24605.
2015-02-09 17:40:04 +00:00
Marek Safar 0daaf302a5 [corlib] Update failing test 2015-02-10 02:01:29 +10:00
Miguel de Icaza 53c20ba829 Merge pull request #1544 from alexanderkyte/wip-serialization
Removed unused dependency to break dependency loop
2015-02-05 21:02:30 -05:00
Vlad Brezae bea7d8a600 [jit] Pass the aligned object size to the managed allocator. 2015-02-03 23:51:59 +00:00
Vlad Brezae 29659f7623 [jit] Optimize the managed allocator fastpath
Send the instance_size as an argument to the managed object allocator to reduce memory dereferences from the vtable in the generated code.
2015-02-03 23:51:58 +00:00
Alexander Kyte 20f782d80e Added system.runtime.serialization config 2015-02-03 14:00:43 -05:00
Alexander Kyte 6de77f9019 Removed unused dependency to break dependency loop 2015-02-03 10:31:34 -05:00
Miguel de Icaza 649d82d04d Automatically build these 2015-02-02 16:04:04 -05:00
Miguel de Icaza 2c9c0aad5a Add missing files 2015-02-02 16:03:07 -05:00
Dave Curylo 7cbeed36fd Fix to UriTemplate.Match to properly handle query parameters without a value. No longer throws IndexOutOfRangeException and the parameter is added to the resulting UriTemplateMatch.QueryParameters field with a null value, same as in .NET.
This change is released under the MIT license.
2015-01-31 07:21:03 -05:00
Henrik Feldt 789d43622e [crypto] Re-instantiate for Invariants() test 2015-01-28 17:13:02 +01:00
Henrik Feldt 0b8d94d285 [crypto] check key length in test 2015-01-28 16:51:11 +01:00
Henrik Feldt 7fc8c726ad [crypto] Key size 128 bytes for HMACSHA512
Using recommended key size according to MSDN (1) and RFC4868 (2).

 (1): https://msdn.microsoft.com/en-us/library/w5y83hkf%28v=vs.110%29.aspx
 (2): https://tools.ietf.org/html/rfc4868
2015-01-28 16:28:24 +01:00
Henrik Feldt c72f6c2fb5 [crypto] Key size 128 bytes for HMACSHA384
Using recommended key size according to MSDN (1) and RFC4868 (2).

 (1): https://msdn.microsoft.com/en-us/library/h43559cy%28v=vs.110%29.aspx
 (2): https://tools.ietf.org/html/rfc4868
2015-01-28 16:28:24 +01:00
Henrik Feldt ad4a6a5369 [crypto] Key size 64 for HMACSHA256
Using recommended key size according to MSDN (1) and RFC4868.

Fixes #23808 - https://bugzilla.xamarin.com/show_bug.cgi?id=23808

 (1): https://msdn.microsoft.com/en-us/library/9c9tf8wc%28v=vs.110%29.aspx
 (2): https://tools.ietf.org/html/rfc4868 - under
      2.1.1.  Data Origin Authentication and Integrity Verification Usage
2015-01-28 16:28:09 +01:00
Henrik Feldt f3d2c41b26 [crypto] Key size 64 for HMACSHA1
This HMAC cipher accepts any key size (1), took from RFC2104, which uses
the full 64 bytes of key since it has a block length of 64 bytes.

 (1): https://www.ietf.org/rfc/rfc2104.txt - Chapter 2: Definition of HMAC
2015-01-28 16:27:54 +01:00
Henrik Feldt 1caf94bec7 [crypto] Key size 64 for HMACRIPEMD160
This HMAC cipher accepts any key size (1), took 64 bytes from MSDN (2)

 (1): https://tools.ietf.org/html/rfc2857 - chapter 3 keying material
 (2): https://msdn.microsoft.com/en-us/library/8k00xhf0%28v=vs.110%29.aspx
2015-01-28 16:27:41 +01:00
Etienne CHAMPETIER 81057618ac System.Xml.Serialization: fix xml serializers generation for Web Services
(add a reference to System.Web.Services)

Without this patch we get the following exception after multiple call
to a soap web services:
Error while compiling generated serializer
/tmp/24ee1170/4996ddb2.cs(2519,27) : warning CS1522: Empty switch block
/tmp/24ee1170/4996ddb2.cs(969,29) : error CS0012: The type `System.Web.Services.Protocols.SoapHeader' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Signed-off-by: Frederic Mestayer <[email protected]>
Signed-off-by: Etienne CHAMPETIER <[email protected]>
2015-01-09 15:02:10 +01:00
Miguel de Icaza ff322b5809 [mscorlib] SerializationInfo, add constructor 2015-01-08 17:20:17 -05:00
Miguel de Icaza 6fc5955051 Work in progress to bring Microsoft System.Runtime.Serialization to Mono
The current code compiles by replacing existing Mono code with
Microsoft code (without actually deleting the unreferenced files -
purely to use them as a roadmap for things that we should do to make
the code MOBILE and AOT friendly).

Currently this does not compile the mobile profile assembly, nor has
the code been tested yet.

The code also brings an extensive tracing/logging system that wont
work on Unix as it is based on Window's Event Tracing facility.

We should consider a few options:

   * Allow for the code to be disabled (for release builds on Mobile,
     or for an initial delivery that does not support any tracing
     capabilities).

   * Allow for the tracing framework to be replaced with some other
     logging framework.
2015-01-05 12:00:29 -02:00
222 changed files with 8408 additions and 7027 deletions

No files matched your search

+4
View File
@@ -109,6 +109,10 @@ GRTAGS
GSYMS
GTAGS
# Doxygen
docs/doxygen*
docs/perlmod*
##############################################################################
# Mono-specific patterns
+1 -1
View File
@@ -31,5 +31,5 @@
url = git://github.com/mono/referencesource
branch = mono
[submodule "external/reference-assemblies"]
path = external/reference-assemblies
path = external/binary-reference-assemblies
url = git://github.com/mono/reference-assemblies.git
+1 -1
View File
@@ -52,7 +52,7 @@ dist-hook:
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -f `find $(top_distdir)/external -path '*\.exe'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/reference-assemblies/v4\.0*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/v4\.0*'`
cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
# Disable this for now because it is very slow and causes wrench to timeout:
+12
View File
@@ -529,12 +529,24 @@ AC_CACHE_CHECK([for clang],
WARN=''
if test x"$GCC" = xyes; then
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value'
# We require C99 with some GNU extensions, e.g. `linux` macro
CFLAGS="$CFLAGS -std=gnu99"
# The runtime code does not respect ANSI C strict aliasing rules
CFLAGS="$CFLAGS -fno-strict-aliasing"
# We rely on signed overflow to behave
CFLAGS="$CFLAGS -fwrapv"
# Don't export any symbols by default
CFLAGS="$CFLAGS -fvisibility=hidden"
CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB -fvisibility=hidden"
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
# Export symbols marked by MONO_API
CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
ORIG_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
AC_MSG_CHECKING(for -Wdeclaration-after-statement option to gcc)
+3
View File
@@ -18,6 +18,9 @@
<section name="system.windows.forms" type="System.Windows.Forms.WindowsFormsSection, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="windows" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<sectionGroup name="system.runtime.serialization" type="System.Runtime.Serialization.Configuration.SerializationSectionGroup, System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="dataContractSerializer" type="System.Runtime.Serialization.Configuration.DataContractSerializerSection, System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
<sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
+1
View File
@@ -132,6 +132,7 @@ g_assertion_message (const gchar *format, ...)
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
va_end (args);
exit (0);
}
File renamed without changes.
+4
View File
@@ -970,6 +970,10 @@ where V is the architecture number 4, 5, 6, 7 and the options can be currently b
.fi
.TP
\fBMONO_ARM_FORCE_SOFT_FLOAT\fR
When Mono is built with a soft float fallback on ARM and this variable is set to
"1", Mono will always emit soft float code, even if a VFP unit is detected.
.TP
\fBMONO_DISABLE_AIO\fR
If set, tells mono NOT to attempt using native asynchronous I/O services. In
that case, a default select/poll implementation is used. Currently only epoll()
+1
View File
@@ -131,6 +131,7 @@ net_4_5_dirs := \
Mono.Debugger.Soft \
SystemWebTestShim \
System.Xml.Linq \
System.ServiceModel.Internals \
System.Runtime.Serialization \
System.Data.DataSetExtensions \
System.Data.Linq \
@@ -38,10 +38,8 @@ namespace System.Windows.Forms {
void CreateEditingControl ()
{
editingControl = new DataGridViewTextBoxEditingControl() {
EditingControlDataGridView = DataGridView,
Multiline = false,
BorderStyle = BorderStyle.None,
MaxLength = maxInputLength
BorderStyle = BorderStyle.None
};
}
@@ -92,8 +90,13 @@ namespace System.Windows.Forms {
throw new InvalidOperationException("There is no associated DataGridView.");
}
CreateEditingControl ();
if (editingControl == null)
CreateEditingControl ();
DataGridView.EditingControlInternal = editingControl;
editingControl.EditingControlDataGridView = DataGridView;
editingControl.MaxLength = maxInputLength;
if (initialFormattedValue == null || initialFormattedValue.ToString () == string.Empty)
editingControl.Text = string.Empty;
@@ -126,6 +129,9 @@ namespace System.Windows.Forms {
public override void PositionEditingControl (bool setLocation, bool setSize, Rectangle cellBounds, Rectangle cellClip, DataGridViewCellStyle cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow)
{
if (editingControl == null)
CreateEditingControl ();
cellBounds.Size = new Size (cellBounds.Width - 5, cellBounds.Height + 2);
cellBounds.Location = new Point (cellBounds.X + 3, ((cellBounds.Height - editingControl.Height) / 2) + cellBounds.Y - 1);
@@ -1775,7 +1775,8 @@ namespace System.Windows.Forms
switch (met) {
case ToolStripItemEventType.MouseUp:
this.HandleClick (((MouseEventArgs)e).Clicks, e);
if (((MouseEventArgs)e).Button == MouseButtons.Left)
this.HandleClick (((MouseEventArgs)e).Clicks, e);
this.OnMouseUp ((MouseEventArgs)e);
break;
case ToolStripItemEventType.MouseDown:
@@ -29,6 +29,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
@@ -41,7 +42,10 @@ namespace Microsoft.Build.Tasks {
bool skipUnchangedFiles;
ITaskItem[] sourceFiles;
bool overwriteReadOnlyFiles;
int retries;
int retryDelayMilliseconds;
bool useHardlinksIfPossible;
public Copy ()
{
}
@@ -79,7 +83,7 @@ namespace Microsoft.Build.Tasks {
}
if (!skipUnchangedFiles || HasFileChanged (sourceFile, destinationFile))
CopyFile (sourceFile, destinationFile, true);
CopyFileWithRetries (sourceFile, destinationFile, true);
sourceItem.CopyMetadataTo (destinationItem);
temporaryCopiedFiles.Add (destinationItem);
@@ -102,7 +106,7 @@ namespace Microsoft.Build.Tasks {
if (!skipUnchangedFiles || directoryCreated ||
HasFileChanged (sourceFile, destinationFile))
CopyFile (sourceFile, destinationFile, false);
CopyFileWithRetries (sourceFile, destinationFile, false);
temporaryCopiedFiles.Add (new TaskItem (
Path.Combine (destinationFolder.GetMetadata ("Identity"), filename),
@@ -172,6 +176,34 @@ namespace Microsoft.Build.Tasks {
}
}
public int Retries {
get {
return retries;
}
set {
retries = value;
}
}
public int RetryDelayMilliseconds {
get {
return retryDelayMilliseconds;
}
set {
retryDelayMilliseconds = value;
}
}
[MonoTODO ("Not implemented yet.")]
public bool UseHardlinksIfPossible {
get {
return useHardlinksIfPossible;
}
set {
useHardlinksIfPossible = value;
}
}
[Required]
public ITaskItem[] SourceFiles {
get {
@@ -193,6 +225,23 @@ namespace Microsoft.Build.Tasks {
return true;
}
void CopyFileWithRetries (string source, string dest, bool create_dir)
{
for (int i = retries; i >= 0; i--) {
try {
CopyFile (source, dest, create_dir);
}
catch (Exception ex) {
Log.LogMessage ("Copying failed. Retries left: {0}.", i);
if (i == 0)
throw;
Thread.Sleep (retryDelayMilliseconds);
}
}
}
void CopyFile (string source, string dest, bool create_dir)
{
if (create_dir)
@@ -30,6 +30,7 @@ using System.IO;
using Microsoft.Build.BuildEngine;
using NUnit.Framework;
using System.Text;
using System.Threading;
using Microsoft.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
@@ -396,6 +397,61 @@ namespace MonoTests.Microsoft.Build.Tasks {
File.SetAttributes (target_file, FileAttributes.Normal);
}
[Test]
public void TestCopy_Retries ()
{
Engine engine;
Project project;
string file_path = Path.Combine (source_path, "copyretries.txt");
string target_file = Path.Combine (target_path, "copyretries.txt");
using (File.CreateText (file_path)) { }
using (File.CreateText (target_file)) { }
File.SetAttributes (target_file, FileAttributes.ReadOnly);
Assert.AreEqual (FileAttributes.ReadOnly, File.GetAttributes (target_file), "A1");
string documentString = @"
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<PropertyGroup><DestFile>" + target_file + @"</DestFile></PropertyGroup>
<ItemGroup>
<SFiles Include='" + file_path + @"'><Md>1</Md></SFiles>
<DFiles Include='$(DestFile)'><Mde>2</Mde></DFiles>
</ItemGroup>
<Target Name='1'>
<Copy SourceFiles='@(SFiles)' DestinationFiles='@(DFiles)' Retries='3' RetryDelayMilliseconds='2000'>
<Output TaskParameter='CopiedFiles' ItemName='I0'/>
<Output TaskParameter='DestinationFiles' ItemName='I1'/>
</Copy>
<Message Text=""I0 : @(I0), I1: @(I1)""/>
</Target>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
TestMessageLogger testLogger = new TestMessageLogger ();
engine.RegisterLogger (testLogger);
project.LoadXml (documentString);
// remove the read-only flag from the file after a few secs,
// so copying works after retries
new Thread ( () => {
Thread.Sleep (3000);
File.SetAttributes (target_file, FileAttributes.Normal);
}).Start ();
if (!project.Build ("1")) {
var sb = new StringBuilder ();
testLogger.DumpMessages (sb);
Assert.Fail ("Build failed " + sb.ToString ());
}
testLogger.CheckLoggedAny ("Copying failed. Retries left: 3.", MessageImportance.Normal, "A2");
}
void CheckCopyBuildItems (Project project, string [] source_files, string destination_folder, string prefix)
{
int num = source_files.Length;
@@ -155,7 +155,6 @@ namespace MonoTests.EvaluatorTest
Assert.AreEqual (124, res);
}
#if NET_4_0
[Test]
public void DynamicStatement ()
{
@@ -163,9 +162,7 @@ namespace MonoTests.EvaluatorTest
Evaluator.Run ("d = 'a';");
Evaluator.Run ("d.GetType ();");
}
#endif
#if NET_4_5
[Test]
public void AwaitExpression ()
{
@@ -174,6 +171,14 @@ namespace MonoTests.EvaluatorTest
res = Evaluator.Evaluate ("res;");
Assert.AreEqual (3, res, "#1");
}
#endif
[Test]
public void UsingStatic ()
{
Evaluator.Run ("using static System.String;");
var res = Evaluator.Evaluate("Join (\"--\", new [] { \"a\", \"b\" } );");
Assert.AreEqual ("a--b", res);
}
}
}
-18
View File
@@ -73,21 +73,3 @@ csproj-local:
$(MAKE) csproj-local intermediate=plaincore/
endif
endif
#
# Android TimeZoneInfo testing....
#
tzi.exe: ../corlib/System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/common/Consts.cs ../Mono.Options/Mono.Options/Options.cs
mcs /debug+ /out:$@ /unsafe "/d:INSIDE_CORLIB;MONODROID;MOBILE;NET_4_5;NET_4_0;LIBC;SELF_TEST" $^
android-pull-tzdb:
mkdir -p android/tzdb/usr/share/zoneinfo
mkdir -p android/tzdb/misc/zoneinfo/zoneinfo
android_root=`adb shell echo '$$ANDROID_ROOT' | tr -d "\r"` ; \
android_data=`adb shell echo '$$ANDROID_DATA' | tr -d "\r"` ; \
adb $(ADB_TARGET) pull $$android_root/usr/share/zoneinfo android/tzdb/usr/share/zoneinfo ; \
adb $(ADB_TARGET) pull $$android_data/misc/zoneinfo/tzdata android/tzdb/misc/zoneinfo
android-dump-tzdata: tzi.exe android-pull-tzdb
__XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT="`pwd`/android/tzdb" ANDROID_DATA="`pwd`/android/tzdb" mono --debug tzi.exe -o android/tzdata
@@ -51,9 +51,7 @@ namespace MonoTests.System.Security.Cryptography {
}
[Test]
#if !MOBILE
[ExpectedException (typeof (CryptographicException))]
#endif
public void CTS_NotAllowed ()
{
// this check is normally (e.g. RijndaelManaged) done later
@@ -232,10 +232,20 @@ namespace System.Net.Http.Headers
return false;
}
int parens = 1;
while (pos < s.Length) {
var ch = s[pos];
if (ch == '(') {
++parens;
++pos;
continue;
}
if (ch == ')') {
++pos;
if (--parens > 0)
continue;
var start = readToken.StartPosition;
value = s.Substring (start, pos - start);
return true;
@@ -101,12 +101,12 @@ namespace MonoTests.System.Net.Http.Headers
Assert.AreEqual ("1.1", res.ProtocolVersion, "#3");
Assert.AreEqual ("1.1 nowhere.com", res.ToString (), "#4");
res = ViaHeaderValue.Parse ("foo / 1.1 nowhere.com:43 ( lalala ) ");
res = ViaHeaderValue.Parse ("foo / 1.1 nowhere.com:43 ( lal ( a ) la ) ");
Assert.AreEqual ("foo", res.ProtocolName, "#10");
Assert.AreEqual ("1.1", res.ProtocolVersion, "#11");
Assert.AreEqual ("nowhere.com:43", res.ReceivedBy, "#12");
Assert.AreEqual ("( lalala )", res.Comment, "#13");
Assert.AreEqual ("foo/1.1 nowhere.com:43 ( lalala )", res.ToString (), "#14");
Assert.AreEqual ("( lal ( a ) la )", res.Comment, "#13");
Assert.AreEqual ("foo/1.1 nowhere.com:43 ( lal ( a ) la )", res.ToString (), "#14");
}
[Test]
@@ -70,3 +70,16 @@ using System.Runtime.InteropServices;
#endif
[assembly: ComVisible (false)]
namespace System.ServiceModel.Diagnostics {
class FencePost_To_Build_With_MS_Sources {}
}
namespace System.Runtime.Diagnostics {
class FencePost_To_Build_With_MS_Sources {}
}
namespace System.Runtime.Serialization.Diagnostics.Application {
class FencePost_To_Build_With_MS_Sources {}
}
@@ -12,6 +12,7 @@ LIB_MCS_FLAGS = \
/r:System.dll \
/r:System.Xml.dll \
/r:System.Core.dll \
/r:System.ServiceModel.Internals\
$(RESOURCE_FILES:%=/resource:%)
ifneq (2.1, $(FRAMEWORK_VERSION))
@@ -0,0 +1,99 @@
../../../external/referencesource/System.Runtime.Serialization/System/Text/Base64Encoding.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Diagnostics/TraceCode.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Diagnostics/TraceUtility.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/AppSettings.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Attributes.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ClassDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CodeGenerator.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ContractNamespaceAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ContractCodeDomInfo.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractResolver.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractSerializer.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractSet.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataMember.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataMemberAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DateTimeOffsetAdapter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DictionaryGlobals.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumMemberAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ExtensionDataObject.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ExtensionDataReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/GenericParameterDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Globals.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/HybridObjectCache.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/IDataContractSurrogate.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/KnownTypeDataContractResolver.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/NetDataContractSerializer.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ObjectReferenceStack.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ObjectToIdCache.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/PrimitiveDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/SchemaExporter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/SchemaHelper.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/SerializationMode.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/SerializationTrace.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ScopedKnownTypes.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/SpecialTypeDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/SurrogateDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/TypeInformation.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlDataContract.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlFormatGeneratorStatics.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlFormatReaderGenerator.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlFormatWriterGenerator.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializer.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerContext.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContextComplex.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlReaderDelegator.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlSerializableReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlSerializableWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlWriterDelegator.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/ConfigurationStrings.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/DataContractSerializerSection.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/DeclaredTypeElement.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/DeclaredTypeElementCollection.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/DeclaredTypeValidator.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/DeclaredTypeValidatorAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/NetDataContractSerializerSection.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/ParameterElement.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/ParameterElementCollection.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/Properties.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/SerializationSectionGroup.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/TypeElement.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/TypeElementCollection.cs
../../../external/referencesource/System.Runtime.Serialization/System/Text/BinHexEncoding.cs
../../../external/referencesource/System.Runtime.Serialization/System/Text/SurrogateChar.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/ArrayHelper.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/EncodingStreamWrapper.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/PrefixHandle.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/StringHandle.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/ValueHandle.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlBinaryNodeType.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlBinaryReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlBinaryWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlBufferReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlC14NWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlConverter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryReaderQuotas.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryString.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlExceptionHelper.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlNodeWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlNodeWriterWriteBase64TextArgs.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlSigningNodeWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlStreamNodeWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlUTF8TextReader.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlUTF8TextWriter.cs
../../../external/referencesource/System.Runtime.Serialization/System/Xml/XmlWriteBase64AsyncArgs.cs
../../../external/referencesource/System.Runtime.Serialization/TD.Designer.cs
@@ -0,0 +1,55 @@
using System.Diagnostics;
namespace System.Runtime.Serialization {
internal static class DiagnosticUtility {
internal static bool ShouldTraceError = true;
internal static bool ShouldTraceWarning;
internal static bool ShouldTraceInformation;
internal static bool ShouldTraceVerbose = true;
internal static class DiagnosticTrace {
internal static void TraceEvent (params object [] args)
{
}
}
internal static class ExceptionUtility {
internal static Exception ThrowHelperError (Exception e)
{
return ThrowHelper (e, TraceEventType.Error);
}
internal static Exception ThrowHelperCallback (string msg, Exception e)
{
return new CallbackException (msg, e);
}
internal static Exception ThrowHelperCallback (Exception e)
{
return new CallbackException ("Callback exception", e);
}
internal static Exception ThrowHelper (Exception e, TraceEventType type)
{
return e;
}
internal static Exception ThrowHelperArgument (string arg)
{
return new ArgumentException (arg);
}
internal static Exception ThrowHelperArgumentNull (string arg)
{
return new ArgumentNullException (arg);
}
internal static Exception ThrowHelperFatal (string msg, Exception e)
{
return new FatalException (msg, e);
}
}
}
}
@@ -0,0 +1,35 @@
//
// bare-bones based implementation based on the references
// from the Microsoft reference source code to get things to build
//
using System.Runtime;
using System.Runtime.Diagnostics;
namespace System.Runtime.Serialization {
internal static class FxTrace {
public static EtwDiagnosticTrace Trace {
get {
return Fx.Trace;
}
}
public static bool ShouldTraceError = true;
public static bool ShouldTraceVerbose = true;
static ExceptionTrace exception;
public static ExceptionTrace Exception {
get {
if (exception == null)
return new ExceptionTrace ("System.Runtime.Serialization", Trace);
return exception;
}
}
public static bool IsEventEnabled (int index)
{
return false;
}
public static void UpdateEventDefinitions (EventDescriptor [] ed, ushort [] events) {}
}
}
@@ -0,0 +1,555 @@
using System.Text;
namespace System.Runtime.Serialization {
internal class SR {
public static object GetObject (string name)
{
return name;
}
public static string GetString (string name)
{
return name;
}
public static string GetString (string format, params object [] args)
{
if (format.IndexOf ("{0}") == -1){
var sb = new StringBuilder ();
sb.Append ("[");
sb.Append (format);
foreach (var s in args){
sb.Append ("-");
sb.Append (args.ToString ());
}
sb.Append ("]");
return sb.ToString ();
} else
return string.Format (format, args);
}
public const string AbstractElementNotSupported = "AbstractElementNotSupported";
public const string AbstractTypeNotSupported = "AbstractTypeNotSupported";
public const string AmbiguousReferencedTypes1 = "AmbiguousReferencedTypes1";
public const string AmbiguousReferencedCollectionTypes1 = "AmbiguousReferencedCollectionTypes1";
public const string AmbiguousReferencedTypes3 = "AmbiguousReferencedTypes3";
public const string AmbiguousReferencedCollectionTypes3 = "AmbiguousReferencedCollectionTypes3";
public const string AnnotationAttributeNotFound = "AnnotationAttributeNotFound";
public const string AnonymousTypeNotSupported = "AnonymousTypeNotSupported";
public const string AnyAttributeNotSupported = "AnyAttributeNotSupported";
public const string ArrayExceededSize = "ArrayExceededSize";
public const string ArrayExceededSizeAttribute = "ArrayExceededSizeAttribute";
public const string ArrayItemFormMustBe = "ArrayItemFormMustBe";
public const string ArraySizeAttributeIncorrect = "ArraySizeAttributeIncorrect";
public const string ArraySizeXmlMismatch = "ArraySizeXmlMismatch";
public const string ArrayTypeCannotBeImported = "ArrayTypeCannotBeImported";
public const string ArrayTypeIsNotSupported = "ArrayTypeIsNotSupported";
public const string AssemblyNotFound = "AssemblyNotFound";
public const string AttributeNotFound = "AttributeNotFound";
public const string AttributedTypesCannotInheritFromNonAttributedSerializableTypes = "AttributedTypesCannotInheritFromNonAttributedSerializableTypes";
public const string BaseTypeNotISerializable = "BaseTypeNotISerializable";
public const string CLRNamespaceMappedMultipleTimes = "CLRNamespaceMappedMultipleTimes";
public const string CallbackMustReturnVoid = "CallbackMustReturnVoid";
public const string CallbackParameterInvalid = "CallbackParameterInvalid";
public const string CallbacksCannotBeVirtualMethods = "CallbacksCannotBeVirtualMethods";
public const string CanOnlyStoreIntoArgOrLocGot0 = "CanOnlyStoreIntoArgOrLocGot0";
public const string CannotComputeUniqueName = "CannotComputeUniqueName";
public const string CannotDeriveFromSealedReferenceType = "CannotDeriveFromSealedReferenceType";
public const string CannotDeserializeForwardedType = "CannotDeserializeForwardedType";
public const string CannotDeserializeRefAtTopLevel = "CannotDeserializeRefAtTopLevel";
public const string CannotExportNullAssembly = "CannotExportNullAssembly";
public const string CannotExportNullKnownType = "CannotExportNullKnownType";
public const string CannotExportNullType = "CannotExportNullType";
public const string CannotHaveDuplicateAttributeNames = "CannotHaveDuplicateAttributeNames";
public const string CannotHaveDuplicateElementNames = "CannotHaveDuplicateElementNames";
public const string CannotImportInvalidSchemas = "CannotImportInvalidSchemas";
public const string CannotImportNullDataContractName = "CannotImportNullDataContractName";
public const string CannotImportNullSchema = "CannotImportNullSchema";
public const string CannotLoadMemberType = "CannotLoadMemberType";
public const string CannotSerializeObjectWithCycles = "CannotSerializeObjectWithCycles";
public const string CannotSetMembersForReferencedType = "CannotSetMembersForReferencedType";
public const string CannotSetNamespaceForReferencedType = "CannotSetNamespaceForReferencedType";
public const string CannotUseGenericTypeAsBase = "CannotUseGenericTypeAsBase";
public const string ChangingFullTypeNameNotSupported = "ChangingFullTypeNameNotSupported";
public const string CharIsInvalidPrimitive = "CharIsInvalidPrimitive";
public const string CircularTypeReference = "CircularTypeReference";
public const string ClassDataContractReturnedForGetOnlyCollection = "ClassDataContractReturnedForGetOnlyCollection";
public const string ClrTypeNotFound = "ClrTypeNotFound";
public const string CollectionAssignedToIncompatibleInterface = "CollectionAssignedToIncompatibleInterface";
public const string CollectionMustHaveAddMethod = "CollectionMustHaveAddMethod";
public const string CollectionMustHaveGetEnumeratorMethod = "CollectionMustHaveGetEnumeratorMethod";
public const string CollectionMustHaveItemType = "CollectionMustHaveItemType";
public const string CollectionTypeCannotBeBuiltIn = "CollectionTypeCannotBeBuiltIn";
public const string CollectionTypeCannotHaveDataContract = "CollectionTypeCannotHaveDataContract";
public const string CollectionTypeDoesNotHaveAddMethod = "CollectionTypeDoesNotHaveAddMethod";
public const string CollectionTypeDoesNotHaveDefaultCtor = "CollectionTypeDoesNotHaveDefaultCtor";
public const string CollectionTypeHasMultipleDefinitionsOfInterface = "CollectionTypeHasMultipleDefinitionsOfInterface";
public const string CollectionTypeIsNotIEnumerable = "CollectionTypeIsNotIEnumerable";
public const string CombinedPrefixNSLength = "CombinedPrefixNSLength";
public const string ComplexTypeRestrictionNotSupported = "ComplexTypeRestrictionNotSupported";
public const string ConfigDataContractSerializerSectionLoadError = "ConfigDataContractSerializerSectionLoadError";
public const string ConfigIndexOutOfRange = "ConfigIndexOutOfRange";
public const string ConfigMustOnlyAddParamsWithType = "ConfigMustOnlyAddParamsWithType";
public const string ConfigMustOnlySetTypeOrIndex = "ConfigMustOnlySetTypeOrIndex";
public const string ConfigMustSetTypeOrIndex = "ConfigMustSetTypeOrIndex";
public const string CouldNotReadSerializationSchema = "CouldNotReadSerializationSchema";
public const string DataContractCacheOverflow = "DataContractCacheOverflow";
public const string DataContractNamespaceAlreadySet = "DataContractNamespaceAlreadySet";
public const string DataContractNamespaceIsNotValid = "DataContractNamespaceIsNotValid";
public const string DataContractNamespaceReserved = "DataContractNamespaceReserved";
public const string DataMemberOnEnumField = "DataMemberOnEnumField";
public const string DcTypeNotFoundOnDeserialize = "DcTypeNotFoundOnDeserialize";
public const string DcTypeNotFoundOnSerialize = "DcTypeNotFoundOnSerialize";
public const string DcTypeNotResolvedOnDeserialize = "DcTypeNotResolvedOnDeserialize";
public const string DefaultOnElementNotSupported = "DefaultOnElementNotSupported";
public const string DerivedTypeNotISerializable = "DerivedTypeNotISerializable";
public const string DeserializedObjectWithIdNotFound = "DeserializedObjectWithIdNotFound";
public const string DupContractInDataContractSet = "DupContractInDataContractSet";
public const string DupContractInKnownTypes = "DupContractInKnownTypes";
public const string DupKeyValueName = "DupKeyValueName";
public const string DupMemberName = "DupMemberName";
public const string DupMemberValue = "DupMemberValue";
public const string DupEnumMemberValue = "DupEnumMemberValue";
public const string InterfaceTypeCannotBeCreated = "InterfaceTypeCannotBeCreated";
public const string ReferencedTypeMatchingMessage = "ReferencedTypeMatchingMessage";
public const string DupTypeContractInDataContractSet = "DupTypeContractInDataContractSet";
public const string DuplicateAttribute = "DuplicateAttribute";
public const string DuplicateCallback = "DuplicateCallback";
public const string DuplicateExtensionDataSetMethod = "DuplicateExtensionDataSetMethod";
public const string ElementMaxOccursMustBe = "ElementMaxOccursMustBe";
public const string ElementMinOccursMustBe = "ElementMinOccursMustBe";
public const string ElementRefOnLocalElementNotSupported = "ElementRefOnLocalElementNotSupported";
public const string EncounteredWithNameNamespace = "EncounteredWithNameNamespace";
public const string EnumEnumerationFacetsMustHaveValue = "EnumEnumerationFacetsMustHaveValue";
public const string EnumListInAnonymousTypeNotSupported = "EnumListInAnonymousTypeNotSupported";
public const string EnumListMustContainAnonymousType = "EnumListMustContainAnonymousType";
public const string EnumOnlyEnumerationFacetsSupported = "EnumOnlyEnumerationFacetsSupported";
public const string EnumRestrictionInvalid = "EnumRestrictionInvalid";
public const string EnumTypeCannotBeImported = "EnumTypeCannotBeImported";
public const string EnumTypeCannotHaveIsReference = "EnumTypeCannotHaveIsReference";
public const string EnumTypeNotSupportedByDataContractJsonSerializer = "EnumTypeNotSupportedByDataContractJsonSerializer";
public const string EnumUnionInAnonymousTypeNotSupported = "EnumUnionInAnonymousTypeNotSupported";
public const string ErrorDeserializing = "ErrorDeserializing";
public const string ErrorInLine = "ErrorInLine";
public const string ErrorIsStartObject = "ErrorIsStartObject";
public const string ErrorSerializing = "ErrorSerializing";
public const string ErrorTypeInfo = "ErrorTypeInfo";
public const string ErrorWriteEndObject = "ErrorWriteEndObject";
public const string ErrorWriteStartObject = "ErrorWriteStartObject";
public const string ExceededMaxItemsQuota = "ExceededMaxItemsQuota";
public const string ExpectingElement = "ExpectingElement";
public const string ExpectingElementAtDeserialize = "ExpectingElementAtDeserialize";
public const string ExpectingEnd = "ExpectingEnd";
public const string ExpectingState = "ExpectingState";
public const string ExtensionDataSetMustReturnVoid = "ExtensionDataSetMustReturnVoid";
public const string ExtensionDataSetParameterInvalid = "ExtensionDataSetParameterInvalid";
public const string FactoryObjectContainsSelfReference = "FactoryObjectContainsSelfReference";
public const string FactoryTypeNotISerializable = "FactoryTypeNotISerializable";
public const string FixedOnElementNotSupported = "FixedOnElementNotSupported";
public const string FlushBufferAlreadyInUse = "FlushBufferAlreadyInUse";
public const string FormMustBeQualified = "FormMustBeQualified";
public const string GenericAnnotationAttributeNotFound = "GenericAnnotationAttributeNotFound";
public const string GenericAnnotationForNestedLevelMustBeIncreasing = "GenericAnnotationForNestedLevelMustBeIncreasing";
public const string GenericAnnotationHasInvalidAttributeValue = "GenericAnnotationHasInvalidAttributeValue";
public const string GenericAnnotationHasInvalidElement = "GenericAnnotationHasInvalidElement";
public const string GenericNameBraceMismatch = "GenericNameBraceMismatch";
public const string GenericParameterNotValid = "GenericParameterNotValid";
public const string GenericTypeNameMismatch = "GenericTypeNameMismatch";
public const string GenericTypeNotExportable = "GenericTypeNotExportable";
public const string GetOnlyCollectionMustHaveAddMethod = "GetOnlyCollectionMustHaveAddMethod";
public const string GetRealObjectReturnedNull = "GetRealObjectReturnedNull";
public const string ISerializableAssemblyNameSetToZero = "ISerializableAssemblyNameSetToZero";
public const string ISerializableCannotHaveDataContract = "ISerializableCannotHaveDataContract";
public const string ISerializableContainsMoreThanOneItems = "ISerializableContainsMoreThanOneItems";
public const string ISerializableDerivedContainsOneOrMoreItems = "ISerializableDerivedContainsOneOrMoreItems";
public const string ISerializableDoesNotContainAny = "ISerializableDoesNotContainAny";
public const string ISerializableMustRefFactoryTypeAttribute = "ISerializableMustRefFactoryTypeAttribute";
public const string ISerializableTypeCannotBeImported = "ISerializableTypeCannotBeImported";
public const string ISerializableWildcardMaxOccursMustBe = "ISerializableWildcardMaxOccursMustBe";
public const string ISerializableWildcardMinOccursMustBe = "ISerializableWildcardMinOccursMustBe";
public const string ISerializableWildcardNamespaceInvalid = "ISerializableWildcardNamespaceInvalid";
public const string ISerializableWildcardProcessContentsInvalid = "ISerializableWildcardProcessContentsInvalid";
public const string IXmlSerializableCannotHaveCollectionDataContract = "IXmlSerializableCannotHaveCollectionDataContract";
public const string IXmlSerializableCannotHaveDataContract = "IXmlSerializableCannotHaveDataContract";
public const string IXmlSerializableIllegalOperation = "IXmlSerializableIllegalOperation";
public const string IXmlSerializableMissingEndElements = "IXmlSerializableMissingEndElements";
public const string IXmlSerializableMustHaveDefaultConstructor = "IXmlSerializableMustHaveDefaultConstructor";
public const string IXmlSerializableWritePastSubTree = "IXmlSerializableWritePastSubTree";
public const string InconsistentIsReference = "InconsistentIsReference";
public const string IndexedPropertyCannotBeSerialized = "IndexedPropertyCannotBeSerialized";
public const string InvalidAnnotationExpectingText = "InvalidAnnotationExpectingText";
public const string InvalidAssemblyFormat = "InvalidAssemblyFormat";
public const string InvalidCharacterEncountered = "InvalidCharacterEncountered";
public const string InvalidClassDerivation = "InvalidClassDerivation";
public const string InvalidClrNameGeneratedForISerializable = "InvalidClrNameGeneratedForISerializable";
public const string InvalidClrNamespaceGeneratedForISerializable = "InvalidClrNamespaceGeneratedForISerializable";
public const string InvalidCollectionContractItemName = "InvalidCollectionContractItemName";
public const string InvalidCollectionContractKeyName = "InvalidCollectionContractKeyName";
public const string InvalidCollectionContractKeyNoDictionary = "InvalidCollectionContractKeyNoDictionary";
public const string InvalidCollectionContractName = "InvalidCollectionContractName";
public const string InvalidCollectionContractNamespace = "InvalidCollectionContractNamespace";
public const string InvalidCollectionContractValueName = "InvalidCollectionContractValueName";
public const string InvalidCollectionContractValueNoDictionary = "InvalidCollectionContractValueNoDictionary";
public const string InvalidCollectionDataContract = "InvalidCollectionDataContract";
public const string InvalidCollectionType = "InvalidCollectionType";
public const string InvalidDataContractName = "InvalidDataContractName";
public const string InvalidDataContractNamespace = "InvalidDataContractNamespace";
public const string InvalidDataMemberName = "InvalidDataMemberName";
public const string InvalidDataNode = "InvalidDataNode";
public const string InvalidEmitDefaultAnnotation = "InvalidEmitDefaultAnnotation";
public const string InvalidEnumBaseType = "InvalidEnumBaseType";
public const string InvalidEnumMemberValue = "InvalidEnumMemberValue";
public const string InvalidEnumValueOnRead = "InvalidEnumValueOnRead";
public const string InvalidEnumValueOnWrite = "InvalidEnumValueOnWrite";
public const string InvalidGetSchemaMethod = "InvalidGetSchemaMethod";
public const string InvalidGlobalDataContractNamespace = "InvalidGlobalDataContractNamespace";
public const string InvalidInclusivePrefixListCollection = "InvalidInclusivePrefixListCollection";
public const string InvalidKeyValueType = "InvalidKeyValueType";
public const string InvalidKeyValueTypeNamespace = "InvalidKeyValueTypeNamespace";
public const string InvalidLocalNameEmpty = "InvalidLocalNameEmpty";
public const string InvalidMember = "InvalidMember";
public const string InvalidNodeType = "InvalidNodeType";
public const string InvalidNonNullReturnValueByIsAny = "InvalidNonNullReturnValueByIsAny";
public const string InvalidPrimitiveType = "InvalidPrimitiveType";
public const string InvalidReturnSchemaOnGetSchemaMethod = "InvalidReturnSchemaOnGetSchemaMethod";
public const string InvalidReturnTypeOnGetSchemaMethod = "InvalidReturnTypeOnGetSchemaMethod";
public const string InvalidSizeDefinition = "InvalidSizeDefinition";
public const string InvalidStateInExtensionDataReader = "InvalidStateInExtensionDataReader";
public const string InvalidXmlDataContractName = "InvalidXmlDataContractName";
public const string InvalidXmlDeserializingExtensionData = "InvalidXmlDeserializingExtensionData";
public const string InvalidXsIdDefinition = "Invalid XsId Definition";
public const string InvalidXsRefDefinition = "Invalid XsRef Definition";
public const string IsAnyCannotBeNull = "IsAnyCannotBeNull";
public const string IsAnyCannotBeSerializedAsDerivedType = "IsAnyCannotBeSerializedAsDerivedType";
public const string IsAnyCannotHaveXmlRoot = "IsAnyCannotHaveXmlRoot";
public const string IsAnyNotSupportedByNetDataContractSerializer = "IsAnyNotSupportedByNetDataContractSerializer";
public const string IsDictionaryFormattedIncorrectly = "IsDictionaryFormattedIncorrectly";
public const string IsNotAssignableFrom = "IsNotAssignableFrom";
public const string IsReferenceGetOnlyCollectionsNotSupported = "IsReferenceGetOnlyCollectionsNotSupported";
public const string IsRequiredDataMemberOnIsReferenceDataContractType = "IsRequiredDataMemberOnIsReferenceDataContractType";
public const string IsValueTypeFormattedIncorrectly = "IsValueTypeFormattedIncorrectly";
public const string JsonAttributeAlreadyWritten = "JsonAttributeAlreadyWritten";
public const string JsonAttributeMustHaveElement = "JsonAttributeMustHaveElement";
public const string JsonCannotWriteStandaloneTextAfterQuotedText = "JsonCannotWriteStandaloneTextAfterQuotedText";
public const string JsonCannotWriteTextAfterNonTextAttribute = "JsonCannotWriteTextAfterNonTextAttribute";
public const string JsonDateTimeOutOfRange = "JsonDateTimeOutOfRange";
public const string JsonDuplicateMemberInInput = "JsonDuplicateMemberInInput";
public const string JsonDuplicateMemberNames = "JsonDuplicateMemberNames";
public const string JsonEncodingNotSupported = "JsonEncodingNotSupported";
public const string JsonEncounteredUnexpectedCharacter = "JsonEncounteredUnexpectedCharacter";
public const string JsonEndElementNoOpenNodes = "JsonEndElementNoOpenNodes";
public const string JsonExpectedEncoding = "JsonExpectedEncoding";
public const string JsonInvalidBytes = "JsonInvalidBytes";
public const string JsonInvalidDataTypeSpecifiedForServerType = "JsonInvalidDataTypeSpecifiedForServerType";
public const string JsonInvalidDateTimeString = "JsonInvalidDateTimeString";
public const string JsonInvalidFFFE = "JsonInvalidFFFE";
public const string JsonInvalidItemNameForArrayElement = "JsonInvalidItemNameForArrayElement";
public const string JsonInvalidLocalNameEmpty = "JsonInvalidLocalNameEmpty";
public const string JsonInvalidMethodBetweenStartEndAttribute = "JsonInvalidMethodBetweenStartEndAttribute";
public const string JsonInvalidRootElementName = "JsonInvalidRootElementName";
public const string JsonInvalidStartElementCall = "JsonInvalidStartElementCall";
public const string JsonInvalidWriteState = "JsonInvalidWriteState";
public const string JsonMethodNotSupported = "JsonMethodNotSupported";
public const string JsonMultipleRootElementsNotAllowedOnWriter = "JsonMultipleRootElementsNotAllowedOnWriter";
public const string JsonMustSpecifyDataType = "JsonMustSpecifyDataType";
public const string JsonMustUseWriteStringForWritingAttributeValues = "JsonMustUseWriteStringForWritingAttributeValues";
public const string JsonNamespaceMustBeEmpty = "JsonNamespaceMustBeEmpty";
public const string JsonNestedArraysNotSupported = "JsonNestedArraysNotSupported";
public const string JsonNoMatchingStartAttribute = "JsonNoMatchingStartAttribute";
public const string JsonNodeTypeArrayOrObjectNotSpecified = "JsonNodeTypeArrayOrObjectNotSpecified";
public const string JsonOffsetExceedsBufferSize = "JsonOffsetExceedsBufferSize";
public const string JsonOneRequiredMemberNotFound = "JsonOneRequiredMemberNotFound";
public const string JsonOnlyWhitespace = "JsonOnlyWhitespace";
public const string JsonOpenAttributeMustBeClosedFirst = "JsonOpenAttributeMustBeClosedFirst";
public const string JsonPrefixMustBeNullOrEmpty = "JsonPrefixMustBeNullOrEmpty";
public const string JsonRequiredMembersNotFound = "JsonRequiredMembersNotFound";
public const string JsonServerTypeSpecifiedForInvalidDataType = "JsonServerTypeSpecifiedForInvalidDataType";
public const string JsonSizeExceedsRemainingBufferSpace = "JsonSizeExceedsRemainingBufferSpace";
public const string JsonTypeNotSupportedByDataContractJsonSerializer = "JsonTypeNotSupportedByDataContractJsonSerializer";
public const string JsonUnexpectedAttributeLocalName = "JsonUnexpectedAttributeLocalName";
public const string JsonUnexpectedAttributeValue = "JsonUnexpectedAttributeValue";
public const string JsonUnexpectedEndOfFile = "JsonUnexpectedEndOfFile";
public const string JsonUnsupportedForIsReference = "JsonUnsupportedForIsReference";
public const string JsonWriteArrayNotSupported = "JsonWriteArrayNotSupported";
public const string JsonWriterClosed = "JsonWriterClosed";
public const string JsonXmlInvalidDeclaration = "JsonXmlInvalidDeclaration";
public const string JsonXmlProcessingInstructionNotSupported = "JsonXmlProcessingInstructionNotSupported";
public const string KeyTypeCannotBeParsedInSimpleDictionary = "KeyTypeCannotBeParsedInSimpleDictionary";
public const string KnownTypeAttributeEmptyString = "KnownTypeAttributeEmptyString";
public const string KnownTypeAttributeMethodNull = "KnownTypeAttributeMethodNull";
public const string KnownTypeAttributeNoData = "KnownTypeAttributeNoData";
public const string KnownTypeAttributeOneScheme = "KnownTypeAttributeOneScheme";
public const string KnownTypeAttributeReturnType = "KnownTypeAttributeReturnType";
public const string KnownTypeAttributeUnknownMethod = "KnownTypeAttributeUnknownMethod";
public const string KnownTypeAttributeValidMethodTypes = "KnownTypeAttributeValidMethodTypes";
public const string KnownTypeConfigClosedGenericDeclared = "KnownTypeConfigClosedGenericDeclared";
public const string KnownTypeConfigGenericParamMismatch = "KnownTypeConfigGenericParamMismatch";
public const string KnownTypeConfigIndexOutOfBounds = "KnownTypeConfigIndexOutOfBounds";
public const string KnownTypeConfigIndexOutOfBoundsZero = "KnownTypeConfigIndexOutOfBoundsZero";
public const string KnownTypeConfigObject = "KnownTypeConfigObject";
public const string MaxArrayLengthExceeded = "MaxArrayLengthExceeded";
public const string MaxMimePartsExceeded = "MaxMimePartsExceeded";
public const string MimeContentTypeHeaderInvalid = "MimeContentTypeHeaderInvalid";
public const string MimeHeaderInvalidCharacter = "MimeHeaderInvalidCharacter";
public const string MimeMessageGetContentStreamCalledAlready = "MimeMessageGetContentStreamCalledAlready";
public const string MimeReaderHeaderAlreadyExists = "MimeReaderHeaderAlreadyExists";
public const string MimeReaderMalformedHeader = "MimeReaderMalformedHeader";
public const string MimeReaderResetCalledBeforeEOF = "MimeReaderResetCalledBeforeEOF";
public const string MimeReaderTruncated = "MimeReaderTruncated";
public const string MimeVersionHeaderInvalid = "MimeVersionHeaderInvalid";
public const string MimeWriterInvalidStateForClose = "MimeWriterInvalidStateForClose";
public const string MimeWriterInvalidStateForContent = "MimeWriterInvalidStateForContent";
public const string MimeWriterInvalidStateForHeader = "MimeWriterInvalidStateForHeader";
public const string MimeWriterInvalidStateForStartPart = "MimeWriterInvalidStateForStartPart";
public const string MimeWriterInvalidStateForStartPreface = "MimeWriterInvalidStateForStartPreface";
public const string MissingGetSchemaMethod = "MissingGetSchemaMethod";
public const string MissingSchemaType = "MissingSchemaType";
public const string MixedContentNotSupported = "MixedContentNotSupported";
public const string MtomBoundaryInvalid = "MtomBoundaryInvalid";
public const string MtomBufferQuotaExceeded = "MtomBufferQuotaExceeded";
public const string MtomContentTransferEncodingNotPresent = "MtomContentTransferEncodingNotPresent";
public const string MtomContentTransferEncodingNotSupported = "MtomContentTransferEncodingNotSupported";
public const string MtomContentTypeInvalid = "MtomContentTypeInvalid";
public const string MtomDataMustNotContainXopInclude = "MtomDataMustNotContainXopInclude";
public const string MtomExceededMaxSizeInBytes = "MtomExceededMaxSizeInBytes";
public const string MtomInvalidCIDUri = "MtomInvalidCIDUri";
public const string MtomInvalidEmptyURI = "MtomInvalidEmptyURI";
public const string MtomInvalidStartUri = "MtomInvalidStartUri";
public const string MtomInvalidTransferEncodingForMimePart = "MtomInvalidTransferEncodingForMimePart";
public const string MtomMessageContentTypeNotFound = "MtomMessageContentTypeNotFound";
public const string MtomMessageInvalidContent = "MtomMessageInvalidContent";
public const string MtomMessageInvalidContentInMimePart = "MtomMessageInvalidContentInMimePart";
public const string MtomMessageInvalidMimeVersion = "MtomMessageInvalidMimeVersion";
public const string MtomMessageNotApplicationXopXml = "MtomMessageNotApplicationXopXml";
public const string MtomMessageNotMultipart = "MtomMessageNotMultipart";
public const string MtomMessageRequiredParamNotSpecified = "MtomMessageRequiredParamNotSpecified";
public const string MtomMimePartReferencedMoreThanOnce = "MtomMimePartReferencedMoreThanOnce";
public const string MtomPartNotFound = "MtomPartNotFound";
public const string MtomRootContentTypeNotFound = "MtomRootContentTypeNotFound";
public const string MtomRootNotApplicationXopXml = "MtomRootNotApplicationXopXml";
public const string MtomRootPartNotFound = "MtomRootPartNotFound";
public const string MtomRootRequiredParamNotSpecified = "MtomRootRequiredParamNotSpecified";
public const string MtomRootUnexpectedCharset = "MtomRootUnexpectedCharset";
public const string MtomRootUnexpectedType = "MtomRootUnexpectedType";
public const string MtomXopIncludeHrefNotSpecified = "MtomXopIncludeHrefNotSpecified";
public const string MtomXopIncludeInvalidXopAttributes = "MtomXopIncludeInvalidXopAttributes";
public const string MtomXopIncludeInvalidXopElement = "MtomXopIncludeInvalidXopElement";
public const string MultipleIdDefinition = "MultipleIdDefinition";
public const string MustContainOnlyLocalElements = "MustContainOnlyLocalElements";
public const string NoAsyncWritePending = "NoAsyncWritePending";
public const string NoConversionPossibleTo = "NoConversionPossibleTo";
public const string NoGetMethodForProperty = "NoGetMethodForProperty";
public const string NoSetMethodForProperty = "NoSetMethodForProperty";
public const string NonAttributedSerializableTypesMustHaveDefaultConstructor = "NonAttributedSerializableTypesMustHaveDefaultConstructor";
public const string NonOptionalFieldMemberOnIsReferenceSerializableType = "NonOptionalFieldMemberOnIsReferenceSerializableType";
public const string NullKnownType = "NullKnownType";
public const string NullValueReturnedForGetOnlyCollection = "NullValueReturnedForGetOnlyCollection";
public const string ObjectTableOverflow = "ObjectTableOverflow";
public const string OffsetExceedsBufferSize = "OffsetExceedsBufferSize";
public const string OnlyDataContractTypesCanHaveExtensionData = "OnlyDataContractTypesCanHaveExtensionData";
public const string OrderCannotBeNegative = "OrderCannotBeNegative";
public const string OutParametersMustBeByRefTypeReceived = "OutParametersMustBeByRefTypeReceived";
public const string ParameterCountMismatch = "ParameterCountMismatch";
public const string PartialTrustCollectionContractAddMethodNotPublic = "PartialTrustCollectionContractAddMethodNotPublic";
public const string PartialTrustCollectionContractNoPublicConstructor = "PartialTrustCollectionContractNoPublicConstructor";
public const string PartialTrustCollectionContractTypeNotPublic = "PartialTrustCollectionContractTypeNotPublic";
public const string PartialTrustDataContractFieldGetNotPublic = "PartialTrustDataContractFieldGetNotPublic";
public const string PartialTrustDataContractFieldSetNotPublic = "PartialTrustDataContractFieldSetNotPublic";
public const string PartialTrustDataContractOnDeserializedNotPublic = "PartialTrustDataContractOnDeserializedNotPublic";
public const string PartialTrustDataContractOnDeserializingNotPublic = "PartialTrustDataContractOnDeserializingNotPublic";
public const string PartialTrustDataContractOnSerializedNotPublic = "PartialTrustDataContractOnSerializedNotPublic";
public const string PartialTrustDataContractOnSerializingNotPublic = "PartialTrustDataContractOnSerializingNotPublic";
public const string PartialTrustDataContractPropertyGetNotPublic = "PartialTrustDataContractPropertyGetNotPublic";
public const string PartialTrustDataContractPropertySetNotPublic = "PartialTrustDataContractPropertySetNotPublic";
public const string PartialTrustDataContractTypeNotPublic = "PartialTrustDataContractTypeNotPublic";
public const string PartialTrustISerializableNoPublicConstructor = "PartialTrustISerializableNoPublicConstructor";
public const string PartialTrustIXmlSerializableTypeNotPublic = "PartialTrustIXmlSerializableTypeNotPublic";
public const string PartialTrustIXmlSerialzableNoPublicConstructor = "PartialTrustIXmlSerialzableNoPublicConstructor";
public const string PartialTrustNonAttributedSerializableTypeNoPublicConstructor = "PartialTrustNonAttributedSerializableTypeNoPublicConstructor";
public const string QueryGeneratorPathToMemberNotFound = "QueryGeneratorPathToMemberNotFound";
public const string QuotaCopyReadOnly = "QuotaCopyReadOnly";
public const string QuotaIsReadOnly = "QuotaIsReadOnly";
public const string QuotaMustBePositive = "QuotaMustBePositive";
public const string ReadNotSupportedOnStream = "ReadNotSupportedOnStream";
public const string ReadOnlyClassDeserialization = "ReadOnlyClassDeserialization";
public const string ReadOnlyCollectionDeserialization = "ReadOnlyCollectionDeserialization";
public const string RecursiveCollectionType = "RecursiveCollectionType";
public const string RedefineNotSupported = "RedefineNotSupported";
public const string ReferencedBaseTypeDoesNotExist = "ReferencedBaseTypeDoesNotExist";
public const string ReferencedCollectionTypesCannotContainNull = "ReferencedCollectionTypesCannotContainNull";
public const string ReferencedTypeDoesNotMatch = "ReferencedTypeDoesNotMatch";
public const string ReferencedTypeNotMatchingMessage = "ReferencedTypeNotMatchingMessage";
public const string ReferencedTypesCannotContainNull = "ReferencedTypesCannotContainNull";
public const string RequiredMemberMustBeEmitted = "RequiredMemberMustBeEmitted";
public const string RequiresClassDataContractToSetIsISerializable = "RequiresClassDataContractToSetIsISerializable";
public const string ResolveTypeReturnedFalse = "ResolveTypeReturnedFalse";
public const string ResolveTypeReturnedNull = "ResolveTypeReturnedNull";
public const string RootParticleMustBeSequence = "RootParticleMustBeSequence";
public const string RootSequenceMaxOccursMustBe = "RootSequenceMaxOccursMustBe";
public const string RootSequenceMustBeRequired = "RootSequenceMustBeRequired";
public const string SeekNotSupportedOnStream = "SeekNotSupportedOnStream";
public const string SerializationInfo_ConstructorNotFound = "SerializationInfo_ConstructorNotFound";
public const string SimpleContentNotSupported = "SimpleContentNotSupported";
public const string SimpleTypeRestrictionDoesNotSpecifyBase = "SimpleTypeRestrictionDoesNotSpecifyBase";
public const string SimpleTypeUnionNotSupported = "SimpleTypeUnionNotSupported";
public const string SizeExceedsRemainingBufferSpace = "SizeExceedsRemainingBufferSpace";
public const string SpecifiedTypeNotFoundInSchema = "SpecifiedTypeNotFoundInSchema";
public const string SubstitutionGroupOnElementNotSupported = "SubstitutionGroupOnElementNotSupported";
public const string SupportForMultidimensionalArraysNotPresent = "SupportForMultidimensionalArraysNotPresent";
public const string SurrogatesWithGetOnlyCollectionsNotSupported = "SurrogatesWithGetOnlyCollectionsNotSupported";
public const string SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser = "SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser";
public const string TooManyCollectionContracts = "TooManyCollectionContracts";
public const string TooManyDataContracts = "TooManyDataContracts";
public const string TooManyDataMembers = "TooManyDataMembers";
public const string TooManyEnumMembers = "TooManyEnumMembers";
public const string TooManyIgnoreDataMemberAttributes = "TooManyIgnoreDataMemberAttributes";
public const string TopLevelElementRepresentsDifferentType = "TopLevelElementRepresentsDifferentType";
public const string TraceCodeElementIgnored = "TraceCodeElementIgnored";
public const string TraceCodeFactoryTypeNotFound = "TraceCodeFactoryTypeNotFound";
public const string TraceCodeObjectWithLargeDepth = "TraceCodeObjectWithLargeDepth";
public const string TraceCodeReadObjectBegin = "TraceCodeReadObjectBegin";
public const string TraceCodeReadObjectEnd = "TraceCodeReadObjectEnd";
public const string TraceCodeWriteObjectBegin = "TraceCodeWriteObjectBegin";
public const string TraceCodeWriteObjectContentBegin = "TraceCodeWriteObjectContentBegin";
public const string TraceCodeWriteObjectContentEnd = "TraceCodeWriteObjectContentEnd";
public const string TraceCodeWriteObjectEnd = "TraceCodeWriteObjectEnd";
public const string TraceCodeXsdExportAnnotationFailed = "TraceCodeXsdExportAnnotationFailed";
public const string TraceCodeXsdExportBegin = "TraceCodeXsdExportBegin";
public const string TraceCodeXsdExportDupItems = "TraceCodeXsdExportDupItems";
public const string TraceCodeXsdExportEnd = "TraceCodeXsdExportEnd";
public const string TraceCodeXsdExportError = "TraceCodeXsdExportError";
public const string TraceCodeXsdImportAnnotationFailed = "TraceCodeXsdImportAnnotationFailed";
public const string TraceCodeXsdImportBegin = "TraceCodeXsdImportBegin";
public const string TraceCodeXsdImportEnd = "TraceCodeXsdImportEnd";
public const string TraceCodeXsdImportError = "TraceCodeXsdImportError";
public const string TypeCannotBeForwardedFrom = "TypeCannotBeForwardedFrom";
public const string TypeCannotBeImported = "TypeCannotBeImported";
public const string TypeCannotBeImportedHowToFix = "TypeCannotBeImportedHowToFix";
public const string TypeHasNotBeenImported = "TypeHasNotBeenImported";
public const string TypeMustBeConcrete = "TypeMustBeConcrete";
public const string TypeMustBeIXmlSerializable = "TypeMustBeIXmlSerializable";
public const string TypeMustNotBeOpenGeneric = "TypeMustNotBeOpenGeneric";
public const string TypeNotSerializable = "TypeNotSerializable";
public const string TypeShouldNotContainAttributes = "TypeShouldNotContainAttributes";
public const string UnexpectedContractType = "UnexpectedContractType";
public const string UnexpectedElementExpectingElements = "UnexpectedElementExpectingElements";
public const string UnexpectedEndOfFile = "UnexpectedEndOfFile";
public const string UnknownConstantType = "UnknownConstantType";
public const string UnknownXmlType = "UnknownXmlType";
public const string ValueMustBeInRange = "ValueMustBeInRange";
public const string ValueMustBeNonNegative = "ValueMustBeNonNegative";
public const string ValueTypeCannotBeNull = "ValueTypeCannotBeNull";
public const string ValueTypeCannotHaveBaseType = "ValueTypeCannotHaveBaseType";
public const string ValueTypeCannotHaveId = "ValueTypeCannotHaveId";
public const string ValueTypeCannotHaveIsReference = "ValueTypeCannotHaveIsReference";
public const string ValueTypeCannotHaveRef = "ValueTypeCannotHaveRef";
public const string ValueTypeMismatchInSurrogatedType = "ValueTypeMismatchInSurrogatedType";
public const string WriteBufferOverflow = "WriteBufferOverflow";
public const string WriteNotSupportedOnStream = "WriteNotSupportedOnStream";
public const string XmlArrayTooSmall = "XmlArrayTooSmall";
public const string XmlArrayTooSmallInput = "XmlArrayTooSmallInput";
public const string XmlArrayTooSmallOutput = "XmlArrayTooSmallOutput";
public const string XmlBadBOM = "XmlBadBOM";
public const string XmlBase64DataExpected = "XmlBase64DataExpected";
public const string XmlCDATAInvalidAtTopLevel = "XmlCDATAInvalidAtTopLevel";
public const string XmlCanonicalizationNotStarted = "XmlCanonicalizationNotStarted";
public const string XmlCanonicalizationStarted = "XmlCanonicalizationStarted";
public const string XmlCloseCData = "XmlCloseCData";
public const string XmlConversionOverflow = "XmlConversionOverflow";
public const string XmlDeclMissing = "XmlDeclMissing";
public const string XmlDeclMissingVersion = "XmlDeclMissingVersion";
public const string XmlDeclNotFirst = "XmlDeclNotFirst";
public const string XmlDeclarationRequired = "XmlDeclarationRequired";
public const string XmlDictionaryStringIDRange = "XmlDictionaryStringIDRange";
public const string XmlDictionaryStringIDUndefinedSession = "XmlDictionaryStringIDUndefinedSession";
public const string XmlDictionaryStringIDUndefinedStatic = "XmlDictionaryStringIDUndefinedStatic";
public const string XmlDuplicateAttribute = "XmlDuplicateAttribute";
public const string XmlElementAttributes = "XmlElementAttributes";
public const string XmlEmptyNamespaceRequiresNullPrefix = "XmlEmptyNamespaceRequiresNullPrefix";
public const string XmlEncodingMismatch = "XmlEncodingMismatch";
public const string XmlEncodingNotSupported = "XmlEncodingNotSupported";
public const string XmlEndElementExpected = "XmlEndElementExpected";
public const string XmlEndElementNoOpenNodes = "XmlEndElementNoOpenNodes";
public const string XmlExpectedEncoding = "XmlExpectedEncoding";
public const string XmlForObjectCannotHaveContent = "XmlForObjectCannotHaveContent";
public const string XmlFoundCData = "XmlFoundCData";
public const string XmlFoundComment = "XmlFoundComment";
public const string XmlFoundElement = "XmlFoundElement";
public const string XmlFoundEndElement = "XmlFoundEndElement";
public const string XmlFoundEndOfFile = "XmlFoundEndOfFile";
public const string XmlFoundNodeType = "XmlFoundNodeType";
public const string XmlFoundText = "XmlFoundText";
public const string XmlFullStartElementExpected = "XmlFullStartElementExpected";
public const string XmlFullStartElementLocalNameNsExpected = "XmlFullStartElementLocalNameNsExpected";
public const string XmlFullStartElementNameExpected = "XmlFullStartElementNameExpected";
public const string XmlFunctionRequiredNodeType = "XmlFunctionRequiredNodeType";
public const string XmlIDDefined = "XmlIDDefined";
public const string XmlIllegalOutsideRoot = "XmlIllegalOutsideRoot";
public const string XmlInvalidBase64Length = "XmlInvalidBase64Length";
public const string XmlInvalidBase64Sequence = "XmlInvalidBase64Sequence";
public const string XmlInvalidBinHexLength = "XmlInvalidBinHexLength";
public const string XmlInvalidBinHexSequence = "XmlInvalidBinHexSequence";
public const string XmlInvalidBytes = "XmlInvalidBytes";
public const string XmlInvalidCharRef = "XmlInvalidCharRef";
public const string XmlInvalidCommentChars = "XmlInvalidCommentChars";
public const string XmlInvalidConversion = "XmlInvalidConversion";
public const string XmlInvalidDeclaration = "XmlInvalidDeclaration";
public const string XmlInvalidDepth = "XmlInvalidDepth";
public const string XmlInvalidEncoding = "XmlInvalidEncoding";
public const string XmlInvalidFFFE = "XmlInvalidFFFE";
public const string XmlInvalidFormat = "XmlInvalidFormat";
public const string XmlInvalidHighSurrogate = "XmlInvalidHighSurrogate";
public const string XmlInvalidID = "XmlInvalidID";
public const string XmlInvalidLowSurrogate = "XmlInvalidLowSurrogate";
public const string XmlInvalidOperation = "XmlInvalidOperation";
public const string XmlInvalidPrefixState = "XmlInvalidPrefixState";
public const string XmlInvalidQualifiedName = "XmlInvalidQualifiedName";
public const string XmlInvalidRootData = "XmlInvalidRootData";
public const string XmlInvalidStandalone = "XmlInvalidStandalone";
public const string XmlInvalidStream = "XmlInvalidStream";
public const string XmlInvalidSurrogate = "XmlInvalidSurrogate";
public const string XmlInvalidUTF8Bytes = "XmlInvalidUTF8Bytes";
public const string XmlInvalidUniqueId = "XmlInvalidUniqueId";
public const string XmlInvalidVersion = "XmlInvalidVersion";
public const string XmlInvalidWriteState = "XmlInvalidWriteState";
public const string XmlInvalidXmlByte = "XmlInvalidXmlByte";
public const string XmlInvalidXmlSpace = "XmlInvalidXmlSpace";
public const string XmlKeyAlreadyExists = "XmlKeyAlreadyExists";
public const string XmlLineInfo = "XmlLineInfo {0},{1}";
public const string XmlMalformedDecl = "XmlMalformedDecl";
public const string XmlMaxArrayLengthExceeded = "XmlMaxArrayLengthExceeded";
public const string XmlMaxArrayLengthOrMaxItemsQuotaExceeded = "XmlMaxArrayLengthOrMaxItemsQuotaExceeded";
public const string XmlMaxBytesPerReadExceeded = "XmlMaxBytesPerReadExceeded";
public const string XmlMaxDepthExceeded = "XmlMaxDepthExceeded";
public const string XmlMaxNameTableCharCountExceeded = "XmlMaxNameTableCharCountExceeded";
public const string XmlMaxStringContentLengthExceeded = "XmlMaxStringContentLengthExceeded";
public const string XmlMethodNotSupported = "XmlMethodNotSupported";
public const string XmlMissingLowSurrogate = "XmlMissingLowSurrogate";
public const string XmlMultipleRootElements = "XmlMultipleRootElements";
public const string XmlNamespaceNotFound = "XmlNamespaceNotFound";
public const string XmlNestedArraysNotSupported = "XmlNestedArraysNotSupported";
public const string XmlNoRootElement = "XmlNoRootElement";
public const string XmlObjectAssignedToIncompatibleInterface = "XmlObjectAssignedToIncompatibleInterface";
public const string XmlOnlyOneRoot = "XmlOnlyOneRoot";
public const string XmlOnlySingleValue = "XmlOnlySingleValue";
public const string XmlOnlyWhitespace = "XmlOnlyWhitespace";
public const string XmlPrefixBoundToNamespace = "XmlPrefixBoundToNamespace";
public const string XmlProcessingInstructionNotSupported = "XmlProcessingInstructionNotSupported";
public const string XmlReservedPrefix = "XmlReservedPrefix";
public const string XmlSpaceBetweenAttributes = "XmlSpaceBetweenAttributes";
public const string XmlSpecificBindingNamespace = "XmlSpecificBindingNamespace";
public const string XmlSpecificBindingPrefix = "XmlSpecificBindingPrefix";
public const string XmlStartElementExpected = "XmlStartElementExpected";
public const string XmlStartElementLocalNameNsExpected = "XmlStartElementLocalNameNsExpected";
public const string XmlStartElementNameExpected = "XmlStartElementNameExpected";
public const string XmlTagMismatch = "XmlTagMismatch";
public const string XmlTokenExpected = "XmlTokenExpected";
public const string XmlUndefinedPrefix = "XmlUndefinedPrefix";
public const string XmlUnexpectedEndElement = "XmlUnexpectedEndElement";
public const string XmlUnexpectedEndOfFile = "XmlUnexpectedEndOfFile";
public const string XmlWriterClosed = "XmlWriterClosed";
public const string XmlWriterMustBeInElement = "XmlWriterMustBeInElement";
}
}
@@ -0,0 +1,13 @@
//
// bare-bones based implementation based on the references
// from the Microsoft reference source code to get things to build
//
namespace System.Runtime {
using System.Runtime.Diagnostics;
using System.Security;
internal partial class TraceCore {
}
}
@@ -0,0 +1,33 @@
//
// bare-bones based implementation based on the references
// from the Microsoft reference source code to get things to build
//
namespace System.Runtime.Serialization.Diagnostics {
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Runtime;
using System.Runtime.Diagnostics;
using System.ServiceModel.Diagnostics;
class TraceRecord {
}
static class TraceUtility {
internal static void Trace(TraceEventType severity, int traceCode, string traceDescription)
{
Console.WriteLine ("Serialization/Trace: {0} {1} {2}", severity, traceCode, traceDescription);
}
internal static void Trace(TraceEventType severity, int traceCode, string traceDescription, TraceRecord record)
{
Console.WriteLine ("Serialization/Trace: {0} {1} {2} {3}", severity, traceCode, traceDescription, record.ToString ());
}
internal static void Trace(TraceEventType severity, int traceCode, string traceDescription, TraceRecord record, Exception exception)
{
Console.WriteLine ("Serialization/Trace: {0} {1} {2} {3} {4}", severity, traceCode, traceDescription, record.ToString (), exception);
}
}
}
@@ -2,66 +2,38 @@
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
Assembly/AssemblyInfo.cs
System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs
System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs
System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs
System.Runtime.Serialization.Configuration/ParameterElement.cs
System.Runtime.Serialization.Configuration/ParameterElementCollection.cs
System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs
System.Runtime.Serialization.Configuration/TypeElement.cs
System.Runtime.Serialization.Configuration/TypeElementCollection.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ContractNamespaceAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs
System.Runtime.Serialization/DataContractResolver.cs
System.Runtime.Serialization/DataContractSerializer.cs
System.Runtime.Serialization/DataMemberAttribute.cs
System.Runtime.Serialization/EnumMemberAttribute.cs
# Temporary files to get things to build, they are missing from the OSS drop
ReferenceSource/SR.cs
ReferenceSource/FxTrace.cs
ReferenceSource/DiagnosticUtility.cs
ReferenceSource/TraceCore.cs
# The sources we are actually pulling
#include ReferenceSource.sources
System.Runtime.Serialization/ExportOptions.cs
System.Runtime.Serialization/ExtensionDataObject.cs
System.Runtime.Serialization/IDataContractSurrogate.cs
System.Runtime.Serialization/IExtensibleDataObject.cs
System.Runtime.Serialization/IgnoreDataMemberAttribute.cs
System.Runtime.Serialization/ImportOptions.cs
System.Runtime.Serialization/InvalidDataContractException.cs
System.Runtime.Serialization/KnownTypeAttribute.cs
System.Runtime.Serialization/KnownTypeCollection.cs
System.Runtime.Serialization/NetDataContractSerializer.cs
System.Runtime.Serialization/SerializationMap.cs
System.Runtime.Serialization/SerializationMap.XsdExporter.cs
System.Runtime.Serialization/XmlFormatterDeserializer.cs
System.Runtime.Serialization/XmlFormatterSerializer.cs
System.Runtime.Serialization/XmlObjectSerializer.cs
System.Runtime.Serialization/XmlSerializableServices.cs
System.Runtime.Serialization/XsdDataContractExporter.cs
System.Runtime.Serialization/XsdDataContractImporter.cs
System.Xml/IFragmentCapableXmlDictionaryWriter.cs
System.Xml/IStreamProvider.cs
System.Xml/IXmlBinaryReaderInitializer.cs
System.Xml/IXmlBinaryWriterInitializer.cs
System.Xml/IXmlDictionary.cs
System.Xml/IXmlMtomReaderInitializer.cs
System.Xml/IXmlMtomWriterInitializer.cs
System.Xml/IXmlUTF8ReaderInitializer.cs
System.Xml/IXmlUTF8WriterInitializer.cs
System.Xml/OnXmlDictionaryReaderClose.cs
System.Xml/UniqueId.cs
System.Xml/XmlBinaryDictionaryReader.cs
System.Xml/XmlBinaryDictionaryWriter.cs
System.Xml/XmlBinaryDictionaryWriterAutoGen.cs
System.Xml/XmlBinaryFormat.cs
System.Xml/XmlBinaryReaderSession.cs
System.Xml/XmlBinaryWriterSession.cs
System.Xml/XmlC14NWriter.cs
System.Xml/XmlCanonicalWriter.cs
System.Xml/XmlDictionary.cs
System.Xml/XmlDictionaryReader.cs
System.Xml/XmlDictionaryReaderAutoGen.cs
System.Xml/XmlDictionaryReaderQuotas.cs
System.Xml/XmlDictionaryString.cs
System.Xml/XmlDictionaryWriter.cs
System.Xml/XmlDictionaryWriterAutoGen.cs
System.Xml/XmlMtomDictionaryReader.cs
System.Xml/XmlMtomDictionaryWriter.cs
System.Xml/XmlSimpleDictionaryReader.cs
System.Xml/XmlSimpleDictionaryWriter.cs
@@ -13,6 +13,7 @@ Assembly/AssemblyInfo.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ContractNamespaceAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs
../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializer.cs
System.Runtime.Serialization/DataContractResolver.cs
System.Runtime.Serialization/DataContractSerializer.cs
System.Runtime.Serialization/DataContractSerializerSettings.cs
@@ -1,12 +1,6 @@
//
// System.MemberAccessException.cs
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr ([email protected])
//
//
// 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
@@ -28,38 +22,31 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.Serialization;
using System;
using System.Reflection;
using System.Resources;
using System.Security;
using System.Security.Permissions;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle ("System.ServiceModel.Internals.dll")]
[assembly: AssemblyDescription ("Contains share code for some System.ServiceModel libraries")]
[assembly: AssemblyDefaultAlias ("System.ServiceModel.dll")]
namespace System
{
[Serializable]
[ComVisible (true)]
public class MemberAccessException : SystemException
{
const int Result = unchecked ((int)0x8013151A);
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
public MemberAccessException ()
: base (Locale.GetText ("Cannot access a class member."))
{
HResult = Result;
}
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
#if NET_2_1
[assembly: AssemblyKeyFile ("../winfx.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: AllowPartiallyTrustedCallers]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
#endif
public MemberAccessException (string message)
: base (message)
{
HResult = Result;
}
protected MemberAccessException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public MemberAccessException (string message, Exception inner)
: base (message, inner)
{
HResult = Result;
}
}
}
[assembly: ComVisible (false)]
@@ -0,0 +1,120 @@
namespace System.Runtime {
internal static class InternalSR {
public static string ArgumentNullOrEmpty(string paramName)
{
return string.Format ("{0} is null or empty");
}
public static string AsyncEventArgsCompletedTwice(Type t)
{
return string.Format ("AsyncEventArgs completed twice for {0}", t);
}
public static string AsyncEventArgsCompletionPending(Type t)
{
return string.Format ("AsyncEventArgs completion pending for {0}", t);
}
public static string BufferAllocationFailed(int size)
{
return string.Format ("Buffer allocation of size {0} failed", size);
}
public static string BufferedOutputStreamQuotaExceeded(int maxSizeQuota)
{
return string.Format ("Buffered output stream quota exceeded (maxSizeQuota={0})", maxSizeQuota);
}
public static string CannotConvertObject(object source, Type t)
{
return string.Format ("Cannot convert object {0} to {1}", source, t);
}
public static string EtwAPIMaxStringCountExceeded(object max)
{
return string.Format ("ETW API max string count exceeded {0}", max);
}
public static string EtwMaxNumberArgumentsExceeded(object max)
{
return string.Format ("ETW max number arguments exceeded {0}", max);
}
public static string EtwRegistrationFailed(object arg)
{
return string.Format ("ETW registration failed {0}", arg);
}
public static string FailFastMessage(string description)
{
return string.Format ("Fail fast: {0}", description);
}
public static string InvalidAsyncResultImplementation(Type t)
{
return string.Format ("Invalid AsyncResult implementation: {0}", t);
}
public static string LockTimeoutExceptionMessage (object timeout)
{
return string.Format ("Lock timeout {0}", timeout);
}
public static string ShipAssertExceptionMessage(object description)
{
return string.Format ("Ship assert exception {0}", description);
}
public static string TaskTimedOutError (object timeout)
{
return string.Format ("Task timed out error {0}", timeout);
}
public static string TimeoutInputQueueDequeue(object timeout)
{
return string.Format ("Timeout input queue dequeue {0}", timeout);
}
public static string TimeoutMustBeNonNegative(object argumentName, object timeout)
{
return string.Format ("Timeout must be non-negative {0} and {1}", argumentName, timeout);
}
public static string TimeoutMustBePositive(string argumentName, object timeout)
{
return string.Format ("Timeout must be positive {0} {1}", argumentName, timeout);
}
public static string TimeoutOnOperation(object timeout)
{
return string.Format ("Timeout on operation {0}", timeout);
}
public static string AsyncResultCompletedTwice (Type t)
{
return string.Format ("AsyncResult Completed Twice for {0}", t);
}
public const string ActionItemIsAlreadyScheduled = "Action Item Is Already Scheduled";
public const string AsyncCallbackThrewException = "Async Callback Threw Exception";
public const string AsyncResultAlreadyEnded = "Async Result Already Ended";
public const string BadCopyToArray = "Bad Copy To Array";
public const string BufferIsNotRightSizeForBufferManager = "Buffer Is Not Right Size For Buffer Manager";
public const string DictionaryIsReadOnly = "Dictionary Is Read Only";
public const string InvalidAsyncResult = "Invalid Async Result";
public const string InvalidAsyncResultImplementationGeneric = "Invalid Async Result Implementation Generic";
public const string InvalidNullAsyncResult = "Invalid Null Async Result";
public const string InvalidSemaphoreExit = "Invalid Semaphore Exit";
public const string KeyCollectionUpdatesNotAllowed = "Key Collection Updates Not Allowed";
public const string KeyNotFoundInDictionary = "Key Not Found In Dictionary";
public const string MustCancelOldTimer = "Must Cancel Old Timer";
public const string NullKeyAlreadyPresent = "Null Key Already Present";
public const string ReadNotSupported = "Read Not Supported";
public const string SFxTaskNotStarted = "SFx Task Not Started";
public const string SeekNotSupported = "Seek Not Supported";
public const string ThreadNeutralSemaphoreAborted = "Thread Neutral Semaphore Aborted";
public const string ValueCollectionUpdatesNotAllowed = "Value Collection Updates Not Allowed";
public const string ValueMustBeNonNegative = "Value Must Be Non Negative";
}
}
@@ -0,0 +1,27 @@
thisdir = class/System.ServiceModel.Internals
SUBDIRS =
include ../../build/rules.make
LIBRARY = System.ServiceModel.Internals.dll
LIB_MCS_FLAGS = \
/unsafe \
/r:System.dll \
/r:System.Xml.dll
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += /d:NET_3_0 \
/r:System.Configuration.dll \
/r:System.Data.dll \
/r:System.Security.dll \
/r:System.Transactions.dll \
/r:System.Messaging.dll \
/r:System.Web.dll \
/r:System.Web.Services.dll \
/r:Mono.Security.dll
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
include ../../build/library.make
@@ -0,0 +1,77 @@
../../build/common/Consts.cs
InternalSR.cs
Assembly/AssemblyInfo.cs
../../../external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ActionItem.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AssertHelper.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncCompletionResult.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgs.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgsCallback.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncWaitHandle.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BackoffTimeoutHelper.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BufferedOutputStream.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CallbackException.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/HopperCache.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/NullableKeyDictionary.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCache.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheItem.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheSettings.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/OrderedDictionary.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ValidatingCollection.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CompletedAsyncResult.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ComputerNameFormat.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ActivityControl.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticEventProvider.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceSource.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DictionaryTraceRecord.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwProvider.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventDescriptor.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogger.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventTraceActivity.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ITraceSourceStringProvider.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/PerformanceCounterNameAttribute.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/StringTraceRecord.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/TraceRecord.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DiagnosticStrings.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DuplicateDetector.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ExceptionTrace.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FastAsyncCallback.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FatalException.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Fx.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FxCop.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/HashHelper.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IAsyncEventArgs.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InputQueue.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InternalBufferManager.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/SafeEventLogWriteHandle.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadCancellationTokenSource.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadScheduler.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadTimer.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/NameGenerator.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyDictionaryInternal.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyKeyedCollection.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ScheduleActionItemAsyncResult.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SignalGate.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SynchronizedPool.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TaskExtensions.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Ticks.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TimeoutHelper.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceChannel.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventLevel.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventOpcode.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TracePayload.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypedAsyncResult.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypeHelper.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/UrlUtility.cs
../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/WaitCallbackActionItem.cs
../../../external/referencesource/System.ServiceModel.Internals/TraceCore.Designer.cs
@@ -321,11 +321,15 @@ namespace System
string [] parameters = Uri.UnescapeDataString (candidate.Query.Substring (1)).Split ('&'); // chop first '?'
foreach (string parameter in parameters) {
string [] pair = parameter.Split ('=');
m.QueryParameters.Add (pair [0], pair [1]);
if (!query_params.ContainsKey (pair [0]))
continue;
string templateName = query_params [pair [0]];
vc.Add (templateName, pair [1]);
if (pair.Length > 0) {
m.QueryParameters.Add (pair [0], pair.Length == 2 ? pair [1] : null);
if (!query_params.ContainsKey (pair [0]))
continue;
if (pair.Length > 1) {
string templateName = query_params [pair [0]];
vc.Add (templateName, pair [1]);
}
}
}
return m;
@@ -461,6 +461,14 @@ namespace MonoTests.System
Assert.AreEqual ("qqq", m.WildcardPathSegments [2], "#5");
}
[Test]
public void MatchIgnoreQueryParamNoValue ()
{
var t = new UriTemplate ("/{a}/*", true);
var m = t.Match (new Uri ("http://s"), new Uri ("http://s/a/b?foo"));
Assert.AreEqual (1, m.QueryParameters.Keys.Count, "#1");
}
[Test]
public void IgnoreTrailingSlash ()
{
+2 -1
View File
@@ -16,6 +16,7 @@ LIB_MCS_FLAGS = \
/r:System.Xml.dll \
/r:System.Core.dll \
/r:System.Runtime.Serialization.dll \
/r:System.ServiceModel.Internals.dll \
$(RESOURCE_FILES:%=/resource:%)
ifneq (2.1, $(FRAMEWORK_VERSION))
@@ -87,4 +88,4 @@ CLEAN_FILES = $(the_libdir_base)plainservice/System.ServiceModel.dll
ifndef intermediate
csproj-local:
$(MAKE) csproj-local intermediate=plainservice/
endif
endif
@@ -0,0 +1,47 @@
//
// Stubs for DiagnosticUtility methods
//
// Copyright 2015 Xamarin Inc
//
using System;
using System.Diagnostics;
namespace System.ServiceModel {
static partial class DiagnosticUtility {
public static Exception ThrowHelperArgumentNullOrEmptyString (string arg)
{
return new ArgumentException ("Argument null or empty", arg);
}
[Conditional("DEBUG")]
public static void DebugAssert(bool condition, string format, params object[] parameters)
{
if (condition)
return;
Console.WriteLine ("Assert failure: " + format, parameters);
Environment.Exit (1);
}
internal static partial class ExceptionUtility {
public static Exception ThrowHelperArgumentNull (string arg)
{
return new ArgumentNullException ("Argument is null", arg);
}
public static Exception ThrowHelperError (Exception e)
{
return e;
}
internal static ArgumentException ThrowHelperArgument(string paramName, string message)
{
return new ArgumentException(message, paramName);
}
}
}
}
@@ -0,0 +1,55 @@
//
// Resource strings referenced by the code.
//
// Copyright 2014 Xamarin Inc
//
// Use the following script to extract strings from .NET strings.resx:
//
// var d = XDocument.Load ("Strings.resx");
// foreach (var j in d.XPathSelectElements ("/root/data")){ var v = j.XPathSelectElement ("value"); Console.WriteLine ("\tpublic const string {0}=\"{1}\";", j.Attribute ("name").Value, v.Value); }
//
using System;
partial class SR
{
public const string BindUriTemplateToNullOrEmptyPathParam = "BindUriTemplateToNullOrEmptyPathParam";
public const string UTAdditionalDefaultIsInvalid = "Additional Defaults IsInvalid key: {0} template: {1}";
public const string UTBadBaseAddress = "BadBaseAddress";
public const string UTBindByNameCalledWithEmptyKey = "BindByNameCalledWithEmptyKey";
public const string UTBindByPositionNoVariables = "BindByPositionNoVariables";
public const string UTBindByPositionWrongCount = "BindByPositionWrongCount";
public const string UTBothLiteralAndNameValueCollectionKey = "BothLiteralAndNameValueCollectionKey";
public const string UTDefaultValueToCompoundSegmentVarFromAdditionalDefaults = "DefaultValueToCompoundSegmentVarFromAdditionalDefaults";
public const string UTDefaultValueToQueryVar = "DefaultValueToQueryVar";
public const string UTDefaultValueToQueryVarFromAdditionalDefaults = "DefaultValueToQueryVarFromAdditionalDefaults {0} does not contain {1}";
public const string UTDefaultValuesAreImmutable = "DefaultValuesAreImmutable";
public const string UTInvalidDefaultPathValue = "InvalidDefaultPathValue";
public const string UTInvalidVarDeclaration = "InvalidVarDeclaration";
public const string UTInvalidWildcardInVariableOrLiteral = "InvalidWildcardInVariableOrLiteral";
public const string UTNullableDefaultAtAdditionalDefaults = "NullableDefaultAtAdditionalDefaults {0} does not contain {1}";
public const string UTNullableDefaultMustBeFollowedWithNullables = "NullableDefaultMustBeFollowedWithNullables";
public const string UTNullableDefaultMustNotBeFollowedWithLiteral = "NullableDefaultMustNotBeFollowedWithLiteral";
public const string UTNullableDefaultMustNotBeFollowedWithWildcard = "NullableDefaultMustNotBeFollowedWithWildcard";
public const string UTQueryCannotEndInAmpersand = "QueryCannotEndInAmpersand";
public const string UTQueryCannotHaveEmptyName = "QueryCannotHaveEmptyName";
public const string UTQueryMustHaveLiteralNames = "QueryMustHaveLiteralNames";
public const string UTQueryNamesMustBeUnique = "QueryNamesMustBeUnique";
public const string UTStarVariableWithDefaults = "StarVariableWithDefaults";
public const string UTStarVariableWithDefaultsFromAdditionalDefaults = "StarVariableWithDefaultsFromAdditionalDefaults";
public const string UTVarNamesMustBeUnique = "VarNamesMustBeUnique";
public const string UTTDuplicate = "TDuplicate";
public const string UTInvalidFormatSegmentOrQueryPart = "InvalidFormatSegmentOrQueryPart";
public const string UTTOtherAmbiguousQueries = "TOtherAmbiguousQueries";
public const string UTDefaultValueToCompoundSegmentVar = "DefaultValueToCompoundSegmentVar";
public const string UTDoesNotSupportAdjacentVarsInCompoundSegment = "DoesNotSupportAdjacentVarsInCompoundSegment";
public const string UTCSRLookupBeforeMatch = "CSRLookupBeforeMatch";
public const string UTQueryCannotHaveCompoundValue = "QueryCannotHaveCompoundValue";
public const string UTTAmbiguousQueries = "UTTAmbiguousQueries";
public static string GetString (string key, params object [] args)
{
if (args.Length == 0)
return key;
return String.Format (key, args);
}
}
@@ -29,11 +29,13 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Net.Security;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
using System.Threading;
using System.Xml;
namespace System.ServiceModel.Channels
{
@@ -124,12 +126,29 @@ namespace System.ServiceModel.Channels
}
try {
return TryReceiveRequest (tout, out ctx);
} catch (XmlException ex) {
Console.WriteLine ("Xml Exception (Dropped Connection?):" + ex.Message);
//on dropped connection,
//whatever you do don't crash
//the whole app. Ignore for now
} catch (SocketException ex) {
Console.WriteLine ("Socket Exception (Dropped Connection?):" + ex.Message);
//on dropped connection,
//whatever you do don't crash
//the whole app. Ignore for now
} catch (IOException ex) {
Console.WriteLine ("I/O Exception (Dropped Connection?):" + ex.Message);
//on dropped connection,
//whatever you do don't crash
//the whole app. Ignore for now
} finally {
lock (async_result_lock) {
CurrentAsyncResult = null;
CurrentAsyncThread = null;
}
}
ctx = null;
return false;
});
RequestContext dummy;
IAsyncResult result;
@@ -5,6 +5,9 @@ using System.ServiceModel.Channels;
using System.ServiceModel.Security;
using System.ServiceModel.Security.Tokens;
using System.Text;
using System.IO;
using System.Xml;
using System.Net.Sockets;
namespace System.ServiceModel.Dispatcher
{
@@ -24,8 +27,34 @@ namespace System.ServiceModel.Dispatcher
using (new OperationContextScope (mrc.OperationContext)) {
try {
process_handlers_chain.ProcessRequestChain (mrc);
}
catch (Exception e) {
} catch (IOException e) {
// FIXME?: On dropped connection do not
// dump a stacktrace, but should be safe
// to dump a console message as in
// default exception handler and
// call error_handlers_chain
Console.WriteLine ("I/O Error (Dropped Connection?): " + e.Message);
mrc.ProcessingException = e;
error_handlers_chain.ProcessRequestChain (mrc);
} catch (SocketException e) {
// FIXME?: On dropped connection do not
// dump a stacktrace, but should be safe
// to dump a console message as in
// default exception handler and
// call error_handlers_chain
Console.WriteLine ("SocketExcpetion (Dropped Connection?): " + e.Message);
mrc.ProcessingException = e;
error_handlers_chain.ProcessRequestChain (mrc);
} catch (XmlException e) {
// FIXME?: On dropped connection do not
// dump a stacktrace, but should be safe
// to dump a console message as in
// default exception handler and
// call error_handlers_chain
Console.WriteLine ("XmlException (Dropped Connection?): " + e.Message);
mrc.ProcessingException = e;
error_handlers_chain.ProcessRequestChain (mrc);
} catch (Exception e) {
// FIXME: this is not really expected use of ChannelDispatcher.ErrorHandlers.
// They are now correctly used in process_handler_chain (namely OperationInvokerHandler).
// For this kind of "outsider" exceptions are actually left thrown
@@ -35,6 +35,9 @@ using System.Threading;
using System.Transactions;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Net.Sockets;
using System.Xml;
using System.IO;
namespace System.ServiceModel.Dispatcher
{
@@ -598,7 +601,10 @@ namespace System.ServiceModel.Dispatcher
if (ProcessErrorWithHandlers (reply, ex, out res))
return;
rc.Reply (res);
if ((!(ex is SocketException)) &&
(!(ex is XmlException)) &&
(!(ex is IOException)))
rc.Reply (res);
reply.Close (owner.DefaultCloseTimeout); // close the channel
} finally {
@@ -41,8 +41,24 @@ System.ServiceModel.Channels/HttpCookieContainerBindingElement.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/UrlSyndicationContent.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Workspace.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/XmlSyndicationContent.cs
../System.ServiceModel.Web/System/UriTemplate.cs
../System.ServiceModel.Web/System/UriTemplateEquivalenceComparer.cs
../System.ServiceModel.Web/System/UriTemplateMatch.cs
../System.ServiceModel.Web/System/UriTemplateMatchException.cs
../../../external/referencesource/System.ServiceModel/Serialization/System/Xml/XmlBinaryNodeType.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplate.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateCompoundPathSegment.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateEquivalenceComparer.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateHelpers.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateLiteralQueryValue.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateLiteralPathSegment.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateMatch.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateMatchException.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateQueryValue.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplatePartType.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplatePathSegment.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateVariablePathSegment.cs
../../../external/referencesource/System.ServiceModel/System/UriTemplateVariableQueryValue.cs
../../../external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelDictionary.cs
../../../external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs
../../../external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStringsVersion1.cs
../../../external/referencesource/System.ServiceModel/System/ServiceModel/XD.cs
../System.ServiceModel.Web/System/UriTemplateTable.cs
ReferenceSources/DiagnosticUtility.cs
ReferenceSources/SR.cs
@@ -762,6 +762,8 @@ namespace System.Xml.Serialization
cp.ReferencedAssemblies.Add ("System.Xml");
if (!cp.ReferencedAssemblies.Contains ("System.Data"))
cp.ReferencedAssemblies.Add ("System.Data");
if (!cp.ReferencedAssemblies.Contains ("System.Web.Services"))
cp.ReferencedAssemblies.Add ("System.Web.Services");
CompilerResults res = comp.CompileAssemblyFromFile (cp, file);
if (res.Errors.HasErrors || res.CompiledAssembly == null) {
@@ -241,6 +241,8 @@ namespace System.Xaml
// change XamlXmlReader too if we change here.
if ((value as string) == String.Empty) // FIXME: there could be some escape syntax.
return "\"\"";
if (value is string)
return (string) value;
var xt = value == null ? XamlLanguage.Null : sctx.GetXamlType (value.GetType ());
var vs = xm.ValueSerializer ?? xt.ValueSerializer;
@@ -80,6 +80,10 @@ namespace System.Diagnostics {
public static void Assert (bool condition, string message,
string detailMessageFormat, params object [] args)
{
if (condition)
// Return early to avoid the string formatting
return;
TraceImpl.Assert (condition,
message,
string.Format (detailMessageFormat, args));
@@ -286,7 +286,7 @@ namespace System.Net.NetworkInformation {
private PingReply SendUnprivileged (IPAddress address, int timeout, byte [] buffer, PingOptions options)
{
DateTime sentTime = DateTime.Now;
DateTime sentTime = DateTime.UtcNow;
Process ping = new Process ();
string args = BuildPingArgs (address, timeout, options);
@@ -301,6 +301,7 @@ namespace System.Net.NetworkInformation {
ping.StartInfo.RedirectStandardOutput = true;
ping.StartInfo.RedirectStandardError = true;
IPStatus status = IPStatus.Unknown;
try {
ping.Start ();
@@ -309,23 +310,21 @@ namespace System.Net.NetworkInformation {
string stderr = ping.StandardError.ReadToEnd ();
#pragma warning restore 219
trip_time = (long) (DateTime.Now - sentTime).TotalMilliseconds;
trip_time = (long) (DateTime.UtcNow - sentTime).TotalMilliseconds;
if (!ping.WaitForExit (timeout) || (ping.HasExited && ping.ExitCode == 2))
return new PingReply (address, buffer, options, trip_time, IPStatus.TimedOut);
if (ping.ExitCode == 1)
return new PingReply (address, buffer, options, trip_time, IPStatus.TtlExpired);
} catch (Exception) {
return new PingReply (address, buffer, options, trip_time, IPStatus.Unknown);
status = IPStatus.TimedOut;
else if (ping.ExitCode == 0)
status = IPStatus.Success;
else if (ping.ExitCode == 1)
status = IPStatus.TtlExpired;
} catch {
} finally {
if (ping != null) {
if (!ping.HasExited)
ping.Kill ();
ping.Dispose ();
}
if (!ping.HasExited)
ping.Kill ();
ping.Dispose ();
}
return new PingReply (address, buffer, options, trip_time, IPStatus.Success);
return new PingReply (address, buffer, options, trip_time, status);
}
// Async
@@ -227,6 +227,8 @@ namespace MonoTests.System.ComponentModel
public MyComponent ()
{
// A workaround for aggressive linker
Disposed -= null;
}
public MyComponent (ISite site)
@@ -1236,14 +1238,11 @@ namespace MonoTests.System.ComponentModel
// Test from bug #76686
Assert.AreEqual (typeof (Int32Converter), TypeDescriptor.GetConverter ((int?) 1).GetType (), "#28");
#if MOBILE
Assert.IsFalse (TypeDescriptor.GetConverter (typeof (Component)) is ComponentConverter, "#29");
Assert.IsFalse (TypeDescriptor.GetConverter (new Component()) is ComponentConverter, "#30");
#else
new ComponentConverter (null); // Needed for MT linker
Assert.IsTrue (TypeDescriptor.GetConverter (typeof (Component)) is ComponentConverter, "#29");
Assert.IsTrue (TypeDescriptor.GetConverter (new Component()) is ComponentConverter, "#30");
#endif
Assert.AreEqual (typeof (NullableConverter), TypeDescriptor.GetConverter (typeof (int?)).GetType (), "#31");
new DateTimeOffsetConverter (); // Needed for MT linker
Assert.AreEqual (typeof (DateTimeOffsetConverter), TypeDescriptor.GetConverter (typeof (DateTimeOffset)).GetType (), "#32");
}
@@ -10,15 +10,23 @@ namespace MonoTests.System.Net.NetworkInformation
[Test]
public void PingFail()
{
#if MONOTOUCH
Assert.Ignore ("Ping implementation is broken on MT (requires sudo access)");
#else
var p = new Ping ().Send ("192.0.2.0");
Assert.AreNotEqual(IPStatus.Success, p.Status);
#endif
}
[Test]
[Test]
public void PingSuccess()
{
#if MONOTOUCH
Assert.Ignore ("Ping implementation is broken on MT (requires sudo access)");
#else
var p = new Ping ().Send ("127.0.0.1");
Assert.AreEqual(IPStatus.Success, p.Status);
#endif
}
}
}
+24 -2
View File
@@ -6,7 +6,7 @@ export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
LIBRARY = corlib.dll
LIBRARY_NAME = mscorlib.dll
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,PFX_LEGACY_3_5 -d:MONO
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,PFX_LEGACY_3_5 -d:MONO -d:MONO_HYBRID_ENCODING_SUPPORT
LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) $(RESOURCE_FILES:%=-resource:%)
#LIBRARY_USE_INTERMEDIATE_FILE = yes
@@ -21,6 +21,10 @@ $(error Unknown framework version)
endif
endif
ifdef BOOTSTRAP_PROFILE
LIB_MCS_FLAGS += --getresourcestrings:ReferenceSources/mscorlib.txt
endif
LIBRARY_COMPILE = $(BOOT_COMPILE)
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
@@ -34,7 +38,7 @@ RESOURCE_FILES = \
resources/collation.cjkKO.bin \
resources/collation.cjkKOlv2.bin
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
DEFAULT_REFERENCES =
@@ -159,3 +163,21 @@ EXTRA_DISTFILES += \
$(vtsdir)/VersionTolerantSerializationTestLib/5.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/6.0/Address.cs \
$(vtsdir)/BinarySerializationOverVersions.cs
#
# Android TimeZoneInfo testing....
#
tzi.exe: System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/common/Consts.cs ../../build/common/Locale.cs ../Mono.Options/Mono.Options/Options.cs ReferenceSources/TimeZoneInfoOptions.cs
mcs /debug+ /out:$@ /unsafe "/d:INSIDE_CORLIB;MONODROID;MOBILE;NET_4_5;NET_4_0;LIBC;SELF_TEST" $^
android-pull-tzdb:
mkdir -p android/tzdb/usr/share/zoneinfo
mkdir -p android/tzdb/misc/zoneinfo/zoneinfo
android_root=`adb shell echo '$$ANDROID_ROOT' | tr -d "\r"` ; \
android_data=`adb shell echo '$$ANDROID_DATA' | tr -d "\r"` ; \
adb $(ADB_TARGET) pull $$android_root/usr/share/zoneinfo android/tzdb/usr/share/zoneinfo ; \
adb $(ADB_TARGET) pull $$android_data/misc/zoneinfo/tzdata android/tzdb/misc/zoneinfo
android-dump-tzdata: tzi.exe android-pull-tzdb
__XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT="`pwd`/android/tzdb" ANDROID_DATA="`pwd`/android/tzdb" mono --debug tzi.exe -o android/tzdata
@@ -1,13 +0,0 @@
namespace System
{
using System;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
[Serializable]
internal sealed class Empty
{
private Empty() {
}
}
}
@@ -0,0 +1,123 @@
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Globalization {
using System.Text;
using System.Runtime.Remoting;
using System;
using System.Security;
//
// Data item for EncodingTable. Along with EncodingTable, they are used by
// System.Text.Encoding.
//
// This class stores a pointer to the internal data and the index into that data
// where our required information is found. We load the code page, flags and uiFamilyCodePage
// immediately because they don't require creating an object. Creating any of the string
// names is delayed until somebody actually asks for them and the names are then cached.
[Serializable]
internal class CodePageDataItem
{
internal int m_dataIndex;
internal int m_uiFamilyCodePage;
internal String m_webName;
internal String m_headerName;
internal String m_bodyName;
internal uint m_flags;
[SecurityCritical]
unsafe internal CodePageDataItem(int dataIndex) {
m_dataIndex = dataIndex;
m_uiFamilyCodePage = EncodingTable.codePageDataPtr[dataIndex].uiFamilyCodePage;
m_flags = EncodingTable.codePageDataPtr[dataIndex].flags;
}
static readonly char [] sep = {'|'};
[System.Security.SecurityCritical]
unsafe internal static String CreateString(string pStrings, uint index)
{
if (pStrings[0] == '|') // |str1|str2|str3
{
return pStrings.Split (sep, StringSplitOptions.RemoveEmptyEntries) [index];
/*
int start = 1;
for (int i = 1; true; i ++)
{
sbyte ch = pStrings[i];
if ((ch == '|') || (ch == 0))
{
if (index == 0)
{
return new String(pStrings, start, i - start);
}
index --;
start = i + 1;
if (ch == 0)
{
break;
}
}
}
throw new ArgumentException("pStrings");
*/
}
else
{
return pStrings;
//return new String(pStrings);
}
}
unsafe public String WebName {
[System.Security.SecuritySafeCritical] // auto-generated
get {
if (m_webName==null) {
m_webName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 0);
}
return m_webName;
}
}
public virtual int UIFamilyCodePage {
get {
return m_uiFamilyCodePage;
}
}
unsafe public String HeaderName {
[System.Security.SecuritySafeCritical] // auto-generated
get {
if (m_headerName==null) {
m_headerName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 1);
}
return m_headerName;
}
}
unsafe public String BodyName {
[System.Security.SecuritySafeCritical] // auto-generated
get {
if (m_bodyName==null) {
m_bodyName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 2);
}
return m_bodyName;
}
}
unsafe public uint Flags {
get {
return (m_flags);
}
}
}
}
@@ -0,0 +1,957 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace System.Globalization
{
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Threading;
using System.Diagnostics.Contracts;
internal static partial class EncodingTable
{
static int GetNumEncodingItems ()
{
return encodingDataPtr.Length;
}
#region "from coreclr/src/classlibnative/nls/encodingdata.cpp"
// as of d921298
static InternalEncodingDataItem ENC (string name, ushort cp) { return new InternalEncodingDataItem () { webName = name, codePage = cp }; }
internal static InternalEncodingDataItem [] encodingDataPtr = new InternalEncodingDataItem [] {
#if FEATURE_CORECLR
// encoding name, codepage.
ENC ("ANSI_X3.4-1968", 20127 ),
ENC ("ANSI_X3.4-1986", 20127 ),
ENC ("ascii", 20127 ),
ENC ("cp367", 20127 ),
ENC ("cp819", 28591 ),
ENC ("csASCII", 20127 ),
ENC ("csISOLatin1", 28591 ),
ENC ("csUnicode11UTF7", 65000 ),
ENC ("IBM367", 20127 ),
ENC ("ibm819", 28591 ),
ENC ("ISO-10646-UCS-2", 1200 ),
ENC ("iso-8859-1", 28591 ),
ENC ("iso-ir-100", 28591 ),
ENC ("iso-ir-6", 20127 ),
ENC ("ISO646-US", 20127 ),
ENC ("iso8859-1", 28591 ),
ENC ("ISO_646.irv:1991", 20127 ),
ENC ("iso_8859-1", 28591 ),
ENC ("iso_8859-1:1987", 28591 ),
ENC ("l1", 28591 ),
ENC ("latin1", 28591 ),
ENC ("ucs-2", 1200 ),
ENC ("unicode", 1200),
ENC ("unicode-1-1-utf-7", 65000 ),
ENC ("unicode-1-1-utf-8", 65001 ),
ENC ("unicode-2-0-utf-7", 65000 ),
ENC ("unicode-2-0-utf-8", 65001 ),
// People get confused about the FFFE here. We can't change this because it'd break existing apps.
// This has been this way for a long time, including in Mlang.
ENC ("unicodeFFFE", 1201), // Big Endian, BOM seems backwards, think of the BOM in little endian order.
ENC ("us", 20127 ),
ENC ("us-ascii", 20127 ),
ENC ("utf-16", 1200 ),
ENC ("UTF-16BE", 1201),
ENC ("UTF-16LE", 1200),
ENC ("utf-32", 12000 ),
ENC ("UTF-32BE", 12001 ),
ENC ("UTF-32LE", 12000 ),
ENC ("utf-7", 65000 ),
ENC ("utf-8", 65001 ),
ENC ("x-unicode-1-1-utf-7", 65000 ),
ENC ("x-unicode-1-1-utf-8", 65001 ),
ENC ("x-unicode-2-0-utf-7", 65000 ),
ENC ("x-unicode-2-0-utf-8", 65001 ),
#else
// Total Items: 455
// encoding name, codepage.
ENC ("437", 437),
ENC ("ANSI_X3.4-1968", 20127),
ENC ("ANSI_X3.4-1986", 20127),
// ENC (L"_autodetect", 50932),
// ENC (L"_autodetect_all", 50001),
// ENC (L"_autodetect_kr", 50949),
ENC ("arabic", 28596),
ENC ("ascii", 20127),
ENC ("ASMO-708", 708),
ENC ("Big5", 950),
ENC ("Big5-HKSCS", 950),
ENC ("CCSID00858", 858),
ENC ("CCSID00924", 20924),
ENC ("CCSID01140", 1140),
ENC ("CCSID01141", 1141),
ENC ("CCSID01142", 1142),
ENC ("CCSID01143", 1143),
ENC ("CCSID01144", 1144),
ENC ("CCSID01145", 1145),
ENC ("CCSID01146", 1146),
ENC ("CCSID01147", 1147),
ENC ("CCSID01148", 1148),
ENC ("CCSID01149", 1149),
ENC ("chinese", 936),
ENC ("cn-big5", 950),
ENC ("CN-GB", 936),
ENC ("CP00858", 858),
ENC ("CP00924", 20924),
ENC ("CP01140", 1140),
ENC ("CP01141", 1141),
ENC ("CP01142", 1142),
ENC ("CP01143", 1143),
ENC ("CP01144", 1144),
ENC ("CP01145", 1145),
ENC ("CP01146", 1146),
ENC ("CP01147", 1147),
ENC ("CP01148", 1148),
ENC ("CP01149", 1149),
ENC ("cp037", 37),
ENC ("cp1025", 21025),
ENC ("CP1026", 1026),
ENC ("cp1256", 1256),
ENC ("CP273", 20273),
ENC ("CP278", 20278),
ENC ("CP280", 20280),
ENC ("CP284", 20284),
ENC ("CP285", 20285),
ENC ("cp290", 20290),
ENC ("cp297", 20297),
ENC ("cp367", 20127),
ENC ("cp420", 20420),
ENC ("cp423", 20423),
ENC ("cp424", 20424),
ENC ("cp437", 437),
ENC ("CP500", 500),
ENC ("cp50227", 50227),
//ENC (L"cp50229", 50229),
ENC ("cp819", 28591),
ENC ("cp850", 850),
ENC ("cp852", 852),
ENC ("cp855", 855),
ENC ("cp857", 857),
ENC ("cp858", 858),
ENC ("cp860", 860),
ENC ("cp861", 861),
ENC ("cp862", 862),
ENC ("cp863", 863),
ENC ("cp864", 864),
ENC ("cp865", 865),
ENC ("cp866", 866),
ENC ("cp869", 869),
ENC ("CP870", 870),
ENC ("CP871", 20871),
ENC ("cp875", 875),
ENC ("cp880", 20880),
ENC ("CP905", 20905),
//ENC (L"cp930", 50930),
//ENC (L"cp933", 50933),
//ENC (L"cp935", 50935),
//ENC (L"cp937", 50937),
//ENC (L"cp939", 50939),
ENC ("csASCII", 20127),
ENC ("csbig5", 950),
ENC ("csEUCKR", 51949),
ENC ("csEUCPkdFmtJapanese", 51932),
ENC ("csGB2312", 936),
ENC ("csGB231280", 936),
ENC ("csIBM037", 37),
ENC ("csIBM1026", 1026),
ENC ("csIBM273", 20273),
ENC ("csIBM277", 20277),
ENC ("csIBM278", 20278),
ENC ("csIBM280", 20280),
ENC ("csIBM284", 20284),
ENC ("csIBM285", 20285),
ENC ("csIBM290", 20290),
ENC ("csIBM297", 20297),
ENC ("csIBM420", 20420),
ENC ("csIBM423", 20423),
ENC ("csIBM424", 20424),
ENC ("csIBM500", 500),
ENC ("csIBM870", 870),
ENC ("csIBM871", 20871),
ENC ("csIBM880", 20880),
ENC ("csIBM905", 20905),
ENC ("csIBMThai", 20838),
ENC ("csISO2022JP", 50221),
ENC ("csISO2022KR", 50225),
ENC ("csISO58GB231280", 936),
ENC ("csISOLatin1", 28591),
ENC ("csISOLatin2", 28592),
ENC ("csISOLatin3", 28593),
ENC ("csISOLatin4", 28594),
ENC ("csISOLatin5", 28599),
ENC ("csISOLatin9", 28605),
ENC ("csISOLatinArabic", 28596),
ENC ("csISOLatinCyrillic", 28595),
ENC ("csISOLatinGreek", 28597),
ENC ("csISOLatinHebrew", 28598),
ENC ("csKOI8R", 20866),
ENC ("csKSC56011987", 949),
ENC ("csPC8CodePage437", 437),
ENC ("csShiftJIS", 932),
ENC ("csUnicode11UTF7", 65000),
ENC ("csWindows31J", 932),
ENC ("cyrillic", 28595),
ENC ("DIN_66003", 20106),
ENC ("DOS-720", 720),
ENC ("DOS-862", 862),
ENC ("DOS-874", 874),
ENC ("ebcdic-cp-ar1", 20420),
ENC ("ebcdic-cp-be", 500),
ENC ("ebcdic-cp-ca", 37),
ENC ("ebcdic-cp-ch", 500),
ENC ("EBCDIC-CP-DK", 20277),
ENC ("ebcdic-cp-es", 20284),
ENC ("ebcdic-cp-fi", 20278),
ENC ("ebcdic-cp-fr", 20297),
ENC ("ebcdic-cp-gb", 20285),
ENC ("ebcdic-cp-gr", 20423),
ENC ("ebcdic-cp-he", 20424),
ENC ("ebcdic-cp-is", 20871),
ENC ("ebcdic-cp-it", 20280),
ENC ("ebcdic-cp-nl", 37),
ENC ("EBCDIC-CP-NO", 20277),
ENC ("ebcdic-cp-roece", 870),
ENC ("ebcdic-cp-se", 20278),
ENC ("ebcdic-cp-tr", 20905),
ENC ("ebcdic-cp-us", 37),
ENC ("ebcdic-cp-wt", 37),
ENC ("ebcdic-cp-yu", 870),
ENC ("EBCDIC-Cyrillic", 20880),
ENC ("ebcdic-de-273+euro", 1141),
ENC ("ebcdic-dk-277+euro", 1142),
ENC ("ebcdic-es-284+euro", 1145),
ENC ("ebcdic-fi-278+euro", 1143),
ENC ("ebcdic-fr-297+euro", 1147),
ENC ("ebcdic-gb-285+euro", 1146),
ENC ("ebcdic-international-500+euro", 1148),
ENC ("ebcdic-is-871+euro", 1149),
ENC ("ebcdic-it-280+euro", 1144),
ENC ("EBCDIC-JP-kana", 20290),
ENC ("ebcdic-Latin9--euro", 20924),
ENC ("ebcdic-no-277+euro", 1142),
ENC ("ebcdic-se-278+euro", 1143),
ENC ("ebcdic-us-37+euro", 1140),
ENC ("ECMA-114", 28596),
ENC ("ECMA-118", 28597),
ENC ("ELOT_928", 28597),
ENC ("euc-cn", 51936),
ENC ("euc-jp", 51932),
ENC ("euc-kr", 51949),
ENC ("Extended_UNIX_Code_Packed_Format_for_Japanese", 51932),
ENC ("GB18030", 54936),
ENC ("GB2312", 936),
ENC ("GB2312-80", 936),
ENC ("GB231280", 936),
ENC ("GBK", 936),
ENC ("GB_2312-80", 936),
ENC ("German", 20106),
ENC ("greek", 28597),
ENC ("greek8", 28597),
ENC ("hebrew", 28598),
ENC ("hz-gb-2312", 52936),
ENC ("IBM-Thai", 20838),
ENC ("IBM00858", 858),
ENC ("IBM00924", 20924),
ENC ("IBM01047", 1047),
ENC ("IBM01140", 1140),
ENC ("IBM01141", 1141),
ENC ("IBM01142", 1142),
ENC ("IBM01143", 1143),
ENC ("IBM01144", 1144),
ENC ("IBM01145", 1145),
ENC ("IBM01146", 1146),
ENC ("IBM01147", 1147),
ENC ("IBM01148", 1148),
ENC ("IBM01149", 1149),
ENC ("IBM037", 37),
ENC ("IBM1026", 1026),
ENC ("IBM273", 20273),
ENC ("IBM277", 20277),
ENC ("IBM278", 20278),
ENC ("IBM280", 20280),
ENC ("IBM284", 20284),
ENC ("IBM285", 20285),
ENC ("IBM290", 20290),
ENC ("IBM297", 20297),
ENC ("IBM367", 20127),
ENC ("IBM420", 20420),
ENC ("IBM423", 20423),
ENC ("IBM424", 20424),
ENC ("IBM437", 437),
ENC ("IBM500", 500),
ENC ("ibm737", 737),
ENC ("ibm775", 775),
ENC ("ibm819", 28591),
ENC ("IBM850", 850),
ENC ("IBM852", 852),
ENC ("IBM855", 855),
ENC ("IBM857", 857),
ENC ("IBM860", 860),
ENC ("IBM861", 861),
ENC ("IBM862", 862),
ENC ("IBM863", 863),
ENC ("IBM864", 864),
ENC ("IBM865", 865),
ENC ("IBM866", 866),
ENC ("IBM869", 869),
ENC ("IBM870", 870),
ENC ("IBM871", 20871),
ENC ("IBM880", 20880),
ENC ("IBM905", 20905),
ENC ("irv", 20105),
ENC ("ISO-10646-UCS-2", 1200),
ENC ("iso-2022-jp", 50220),
ENC ("iso-2022-jpeuc", 51932),
ENC ("iso-2022-kr", 50225),
ENC ("iso-2022-kr-7", 50225),
ENC ("iso-2022-kr-7bit", 50225),
ENC ("iso-2022-kr-8", 51949),
ENC ("iso-2022-kr-8bit", 51949),
ENC ("iso-8859-1", 28591),
ENC ("iso-8859-11", 874),
ENC ("iso-8859-13", 28603),
ENC ("iso-8859-15", 28605),
ENC ("iso-8859-2", 28592),
ENC ("iso-8859-3", 28593),
ENC ("iso-8859-4", 28594),
ENC ("iso-8859-5", 28595),
ENC ("iso-8859-6", 28596),
ENC ("iso-8859-7", 28597),
ENC ("iso-8859-8", 28598),
ENC ("ISO-8859-8 Visual", 28598),
ENC ("iso-8859-8-i", 38598),
ENC ("iso-8859-9", 28599),
ENC ("iso-ir-100", 28591),
ENC ("iso-ir-101", 28592),
ENC ("iso-ir-109", 28593),
ENC ("iso-ir-110", 28594),
ENC ("iso-ir-126", 28597),
ENC ("iso-ir-127", 28596),
ENC ("iso-ir-138", 28598),
ENC ("iso-ir-144", 28595),
ENC ("iso-ir-148", 28599),
ENC ("iso-ir-149", 949),
ENC ("iso-ir-58", 936),
ENC ("iso-ir-6", 20127),
ENC ("ISO646-US", 20127),
ENC ("iso8859-1", 28591),
ENC ("iso8859-2", 28592),
ENC ("ISO_646.irv:1991", 20127),
ENC ("iso_8859-1", 28591),
ENC ("ISO_8859-15", 28605),
ENC ("iso_8859-1:1987", 28591),
ENC ("iso_8859-2", 28592),
ENC ("iso_8859-2:1987", 28592),
ENC ("ISO_8859-3", 28593),
ENC ("ISO_8859-3:1988", 28593),
ENC ("ISO_8859-4", 28594),
ENC ("ISO_8859-4:1988", 28594),
ENC ("ISO_8859-5", 28595),
ENC ("ISO_8859-5:1988", 28595),
ENC ("ISO_8859-6", 28596),
ENC ("ISO_8859-6:1987", 28596),
ENC ("ISO_8859-7", 28597),
ENC ("ISO_8859-7:1987", 28597),
ENC ("ISO_8859-8", 28598),
ENC ("ISO_8859-8:1988", 28598),
ENC ("ISO_8859-9", 28599),
ENC ("ISO_8859-9:1989", 28599),
ENC ("Johab", 1361),
ENC ("koi", 20866),
ENC ("koi8", 20866),
ENC ("koi8-r", 20866),
ENC ("koi8-ru", 21866),
ENC ("koi8-u", 21866),
ENC ("koi8r", 20866),
ENC ("korean", 949),
ENC ("ks-c-5601", 949),
ENC ("ks-c5601", 949),
ENC ("KSC5601", 949),
ENC ("KSC_5601", 949),
ENC ("ks_c_5601", 949),
ENC ("ks_c_5601-1987", 949),
ENC ("ks_c_5601-1989", 949),
ENC ("ks_c_5601_1987", 949),
ENC ("l1", 28591),
ENC ("l2", 28592),
ENC ("l3", 28593),
ENC ("l4", 28594),
ENC ("l5", 28599),
ENC ("l9", 28605),
ENC ("latin1", 28591),
ENC ("latin2", 28592),
ENC ("latin3", 28593),
ENC ("latin4", 28594),
ENC ("latin5", 28599),
ENC ("latin9", 28605),
ENC ("logical", 28598),
ENC ("macintosh", 10000),
ENC ("ms_Kanji", 932),
ENC ("Norwegian", 20108),
ENC ("NS_4551-1", 20108),
ENC ("PC-Multilingual-850+euro", 858),
ENC ("SEN_850200_B", 20107),
ENC ("shift-jis", 932),
ENC ("shift_jis", 932),
ENC ("sjis", 932),
ENC ("Swedish", 20107),
ENC ("TIS-620", 874),
ENC ("ucs-2", 1200),
ENC ("unicode", 1200),
ENC ("unicode-1-1-utf-7", 65000),
ENC ("unicode-1-1-utf-8", 65001),
ENC ("unicode-2-0-utf-7", 65000),
ENC ("unicode-2-0-utf-8", 65001),
// People get confused about the FFFE here. We can't change this because it'd break existing apps.
// This has been this way for a long time, including in Mlang.
ENC ("unicodeFFFE", 1201), // Big Endian, BOM seems backwards, think of the BOM in little endian order.
ENC ("us", 20127),
ENC ("us-ascii", 20127),
ENC ("utf-16", 1200),
ENC ("UTF-16BE", 1201),
ENC ("UTF-16LE", 1200),
ENC ("utf-32", 12000),
ENC ("UTF-32BE", 12001),
ENC ("UTF-32LE", 12000),
ENC ("utf-7", 65000),
ENC ("utf-8", 65001),
ENC ("visual", 28598),
ENC ("windows-1250", 1250),
ENC ("windows-1251", 1251),
ENC ("windows-1252", 1252),
ENC ("windows-1253", 1253),
ENC ("Windows-1254", 1254),
ENC ("windows-1255", 1255),
ENC ("windows-1256", 1256),
ENC ("windows-1257", 1257),
ENC ("windows-1258", 1258),
ENC ("windows-874", 874),
ENC ("x-ansi", 1252),
ENC ("x-Chinese-CNS", 20000),
ENC ("x-Chinese-Eten", 20002),
ENC ("x-cp1250", 1250),
ENC ("x-cp1251", 1251),
ENC ("x-cp20001", 20001),
ENC ("x-cp20003", 20003),
ENC ("x-cp20004", 20004),
ENC ("x-cp20005", 20005),
ENC ("x-cp20261", 20261),
ENC ("x-cp20269", 20269),
ENC ("x-cp20936", 20936),
ENC ("x-cp20949", 20949),
ENC ("x-cp50227", 50227),
//ENC (L"x-cp50229", 50229),
//ENC (L"X-EBCDIC-JapaneseAndUSCanada", 50931),
ENC ("X-EBCDIC-KoreanExtended", 20833),
ENC ("x-euc", 51932),
ENC ("x-euc-cn", 51936),
ENC ("x-euc-jp", 51932),
ENC ("x-Europa", 29001),
ENC ("x-IA5", 20105),
ENC ("x-IA5-German", 20106),
ENC ("x-IA5-Norwegian", 20108),
ENC ("x-IA5-Swedish", 20107),
ENC ("x-iscii-as", 57006),
ENC ("x-iscii-be", 57003),
ENC ("x-iscii-de", 57002),
ENC ("x-iscii-gu", 57010),
ENC ("x-iscii-ka", 57008),
ENC ("x-iscii-ma", 57009),
ENC ("x-iscii-or", 57007),
ENC ("x-iscii-pa", 57011),
ENC ("x-iscii-ta", 57004),
ENC ("x-iscii-te", 57005),
ENC ("x-mac-arabic", 10004),
ENC ("x-mac-ce", 10029),
ENC ("x-mac-chinesesimp", 10008),
ENC ("x-mac-chinesetrad", 10002),
ENC ("x-mac-croatian", 10082),
ENC ("x-mac-cyrillic", 10007),
ENC ("x-mac-greek", 10006),
ENC ("x-mac-hebrew", 10005),
ENC ("x-mac-icelandic", 10079),
ENC ("x-mac-japanese", 10001),
ENC ("x-mac-korean", 10003),
ENC ("x-mac-romanian", 10010),
ENC ("x-mac-thai", 10021),
ENC ("x-mac-turkish", 10081),
ENC ("x-mac-ukrainian", 10017),
ENC ("x-ms-cp932", 932),
ENC ("x-sjis", 932),
ENC ("x-unicode-1-1-utf-7", 65000),
ENC ("x-unicode-1-1-utf-8", 65001),
ENC ("x-unicode-2-0-utf-7", 65000),
ENC ("x-unicode-2-0-utf-8", 65001),
ENC ("x-x-big5", 950),
#endif // FEATURE_CORECLR
};
// Working set optimization:
// 1. code page, family code page stored as unsigned short
// 2. if web/header/body names are the same, only web name is stored; otherwise, we store "|webname|headername|bodyname"
// 3. Move flags before names to fill gap on 64-bit platforms
static InternalCodePageDataItem MapCodePageDataItem (UInt16 cp, UInt16 fcp, string names, uint flags) { return new InternalCodePageDataItem () { codePage = cp, uiFamilyCodePage = fcp, flags = flags, Names = names }; }
//
// Information about codepages.
//
internal static InternalCodePageDataItem [] codePageDataPtr = new InternalCodePageDataItem [] {
#if FEATURE_CORECLR
// Total Items:
// code page, family code page, web name, header name, body name, flags
MapCodePageDataItem( 1200, 1200, "utf-16", MIMECONTF_SAVABLE_BROWSER), // "Unicode"
MapCodePageDataItem( 1201, 1200, "utf-16BE", 0), // Big Endian, old FFFE BOM seems backwards, think of the BOM in little endian order.
MapCodePageDataItem( 12000, 1200, "utf-32", 0), // "Unicode (UTF-32)"
MapCodePageDataItem( 12001, 1200, "utf-32BE", 0), // "Unicode (UTF-32 Big Endian)"
MapCodePageDataItem( 20127, 1252, "us-ascii", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "US-ASCII"
MapCodePageDataItem( 28591, 1252, "iso-8859-1", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Western European (ISO)"
MapCodePageDataItem( 65000, 1200, "utf-7", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "Unicode (UTF-7)"
MapCodePageDataItem( 65001, 1200, "utf-8", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Unicode (UTF-8)"
#else //FEATURE_CORECLR
// Total Items: 146
// code page, family code page, web name, header name, body name, flags
MapCodePageDataItem( 37, 1252, "IBM037", 0), // "IBM EBCDIC (US-Canada)"
MapCodePageDataItem( 437, 1252, "IBM437", 0), // "OEM United States"
MapCodePageDataItem( 500, 1252, "IBM500", 0), // "IBM EBCDIC (International)"
MapCodePageDataItem( 708, 1256, "ASMO-708", MIMECONTF_BROWSER | MIMECONTF_SAVABLE_BROWSER), // "Arabic (ASMO 708)"
// MapCodePageDataItem( 720, 1256, "DOS-720", MIMECONTF_BROWSER | MIMECONTF_SAVABLE_BROWSER), // "Arabic (DOS)"
// MapCodePageDataItem( 737, 1253, "ibm737", 0), // "Greek (DOS)"
// MapCodePageDataItem( 775, 1257, "ibm775", 0), // "Baltic (DOS)"
MapCodePageDataItem( 850, 1252, "ibm850", 0), // "Western European (DOS)"
MapCodePageDataItem( 852, 1250, "ibm852", MIMECONTF_BROWSER | MIMECONTF_SAVABLE_BROWSER), // "Central European (DOS)"
MapCodePageDataItem( 855, 1252, "IBM855", 0), // "OEM Cyrillic"
MapCodePageDataItem( 857, 1254, "ibm857", 0), // "Turkish (DOS)"
MapCodePageDataItem( 858, 1252, "IBM00858", 0), // "OEM Multilingual Latin I"
MapCodePageDataItem( 860, 1252, "IBM860", 0), // "Portuguese (DOS)"
MapCodePageDataItem( 861, 1252, "ibm861", 0), // "Icelandic (DOS)"
MapCodePageDataItem( 862, 1255, "DOS-862", MIMECONTF_BROWSER | MIMECONTF_SAVABLE_BROWSER), // "Hebrew (DOS)"
MapCodePageDataItem( 863, 1252, "IBM863", 0), // "French Canadian (DOS)"
MapCodePageDataItem( 864, 1256, "IBM864", 0), // "Arabic (864)"
MapCodePageDataItem( 865, 1252, "IBM865", 0), // "Nordic (DOS)"
MapCodePageDataItem( 866, 1251, "cp866", MIMECONTF_BROWSER | MIMECONTF_SAVABLE_BROWSER), // "Cyrillic (DOS)"
MapCodePageDataItem( 869, 1253, "ibm869", 0), // "Greek, Modern (DOS)"
MapCodePageDataItem( 870, 1250, "IBM870", 0), // "IBM EBCDIC (Multilingual Latin-2)"
MapCodePageDataItem( 874, 874, "windows-874", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Thai (Windows)"
MapCodePageDataItem( 875, 1253, "cp875", 0), // "IBM EBCDIC (Greek Modern)"
MapCodePageDataItem( 932, 932, "|shift_jis|iso-2022-jp|iso-2022-jp", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Japanese (Shift-JIS)"
MapCodePageDataItem( 936, 936, "gb2312", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Chinese Simplified (GB2312)"
MapCodePageDataItem( 949, 949, "ks_c_5601-1987", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Korean"
MapCodePageDataItem( 950, 950, "big5", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Chinese Traditional (Big5)"
MapCodePageDataItem( 1026, 1254, "IBM1026", 0), // "IBM EBCDIC (Turkish Latin-5)"
MapCodePageDataItem( 1047, 1252, "IBM01047", 0), // "IBM Latin-1"
MapCodePageDataItem( 1140, 1252, "IBM01140", 0), // "IBM EBCDIC (US-Canada-Euro)"
MapCodePageDataItem( 1141, 1252, "IBM01141", 0), // "IBM EBCDIC (Germany-Euro)"
MapCodePageDataItem( 1142, 1252, "IBM01142", 0), // "IBM EBCDIC (Denmark-Norway-Euro)"
MapCodePageDataItem( 1143, 1252, "IBM01143", 0), // "IBM EBCDIC (Finland-Sweden-Euro)"
MapCodePageDataItem( 1144, 1252, "IBM01144", 0), // "IBM EBCDIC (Italy-Euro)"
MapCodePageDataItem( 1145, 1252, "IBM01145", 0), // "IBM EBCDIC (Spain-Euro)"
MapCodePageDataItem( 1146, 1252, "IBM01146", 0), // "IBM EBCDIC (UK-Euro)"
MapCodePageDataItem( 1147, 1252, "IBM01147", 0), // "IBM EBCDIC (France-Euro)"
MapCodePageDataItem( 1148, 1252, "IBM01148", 0), // "IBM EBCDIC (International-Euro)"
MapCodePageDataItem( 1149, 1252, "IBM01149", 0), // "IBM EBCDIC (Icelandic-Euro)"
MapCodePageDataItem( 1200, 1200, "utf-16", MIMECONTF_SAVABLE_BROWSER), // "Unicode"
MapCodePageDataItem( 1201, 1200, "utf-16BE", 0), // Big Endian, old FFFE BOM seems backwards, think of the BOM in little endian order.
MapCodePageDataItem( 1250, 1250, "|windows-1250|windows-1250|iso-8859-2", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Central European (Windows)"
MapCodePageDataItem( 1251, 1251, "|windows-1251|windows-1251|koi8-r", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Cyrillic (Windows)"
MapCodePageDataItem( 1252, 1252, "|Windows-1252|Windows-1252|iso-8859-1", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Western European (Windows)"
MapCodePageDataItem( 1253, 1253, "|windows-1253|windows-1253|iso-8859-7", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Greek (Windows)"
MapCodePageDataItem( 1254, 1254, "|windows-1254|windows-1254|iso-8859-9", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Turkish (Windows)"
MapCodePageDataItem( 1255, 1255, "windows-1255", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Hebrew (Windows)"
MapCodePageDataItem( 1256, 1256, "windows-1256", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Arabic (Windows)"
MapCodePageDataItem( 1257, 1257, "windows-1257", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Baltic (Windows)"
MapCodePageDataItem( 1258, 1258, "windows-1258", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Vietnamese (Windows)"
// MapCodePageDataItem( 1361, 949, "Johab", 0), // "Korean (Johab)"
MapCodePageDataItem( 10000, 1252, "macintosh", 0), // "Western European (Mac)"
/*
MapCodePageDataItem( 10001, 932, "x-mac-japanese", 0), // "Japanese (Mac)"
MapCodePageDataItem( 10002, 950, "x-mac-chinesetrad", 0), // "Chinese Traditional (Mac)"
MapCodePageDataItem( 10003, 949, "x-mac-korean", 0), // "Korean (Mac)"
MapCodePageDataItem( 10004, 1256, "x-mac-arabic", 0), // "Arabic (Mac)"
MapCodePageDataItem( 10005, 1255, "x-mac-hebrew", 0), // "Hebrew (Mac)"
MapCodePageDataItem( 10006, 1253, "x-mac-greek", 0), // "Greek (Mac)"
MapCodePageDataItem( 10007, 1251, "x-mac-cyrillic", 0), // "Cyrillic (Mac)"
MapCodePageDataItem( 10008, 936, "x-mac-chinesesimp", 0), // "Chinese Simplified (Mac)"
MapCodePageDataItem( 10010, 1250, "x-mac-romanian", 0), // "Romanian (Mac)"
MapCodePageDataItem( 10017, 1251, "x-mac-ukrainian", 0), // "Ukrainian (Mac)"
MapCodePageDataItem( 10021, 874, "x-mac-thai", 0), // "Thai (Mac)"
MapCodePageDataItem( 10029, 1250, "x-mac-ce", 0), // "Central European (Mac)"
*/
MapCodePageDataItem( 10079, 1252, "x-mac-icelandic", 0), // "Icelandic (Mac)"
// MapCodePageDataItem( 10081, 1254, "x-mac-turkish", 0), // "Turkish (Mac)"
// MapCodePageDataItem( 10082, 1250, "x-mac-croatian", 0), // "Croatian (Mac)"
MapCodePageDataItem( 12000, 1200, "utf-32", 0), // "Unicode (UTF-32)"
MapCodePageDataItem( 12001, 1200, "utf-32BE", 0), // "Unicode (UTF-32 Big Endian)"
/*
MapCodePageDataItem( 20000, 950, "x-Chinese-CNS", 0), // "Chinese Traditional (CNS)"
MapCodePageDataItem( 20001, 950, "x-cp20001", 0), // "TCA Taiwan"
MapCodePageDataItem( 20002, 950, "x-Chinese-Eten", 0), // "Chinese Traditional (Eten)"
MapCodePageDataItem( 20003, 950, "x-cp20003", 0), // "IBM5550 Taiwan"
MapCodePageDataItem( 20004, 950, "x-cp20004", 0), // "TeleText Taiwan"
MapCodePageDataItem( 20005, 950, "x-cp20005", 0), // "Wang Taiwan"
MapCodePageDataItem( 20105, 1252, "x-IA5", 0), // "Western European (IA5)"
MapCodePageDataItem( 20106, 1252, "x-IA5-German", 0), // "German (IA5)"
MapCodePageDataItem( 20107, 1252, "x-IA5-Swedish", 0), // "Swedish (IA5)"
MapCodePageDataItem( 20108, 1252, "x-IA5-Norwegian", 0), // "Norwegian (IA5)"
*/
MapCodePageDataItem( 20127, 1252, "us-ascii", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "US-ASCII"
// MapCodePageDataItem( 20261, 1252, "x-cp20261", 0), // "T.61"
// MapCodePageDataItem( 20269, 1252, "x-cp20269", 0), // "ISO-6937"
MapCodePageDataItem( 20273, 1252, "IBM273", 0), // "IBM EBCDIC (Germany)"
MapCodePageDataItem( 20277, 1252, "IBM277", 0), // "IBM EBCDIC (Denmark-Norway)"
MapCodePageDataItem( 20278, 1252, "IBM278", 0), // "IBM EBCDIC (Finland-Sweden)"
MapCodePageDataItem( 20280, 1252, "IBM280", 0), // "IBM EBCDIC (Italy)"
MapCodePageDataItem( 20284, 1252, "IBM284", 0), // "IBM EBCDIC (Spain)"
MapCodePageDataItem( 20285, 1252, "IBM285", 0), // "IBM EBCDIC (UK)"
MapCodePageDataItem( 20290, 932, "IBM290", 0), // "IBM EBCDIC (Japanese katakana)"
MapCodePageDataItem( 20297, 1252, "IBM297", 0), // "IBM EBCDIC (France)"
MapCodePageDataItem( 20420, 1256, "IBM420", 0), // "IBM EBCDIC (Arabic)"
// MapCodePageDataItem( 20423, 1253, "IBM423", 0), // "IBM EBCDIC (Greek)"
MapCodePageDataItem( 20424, 1255, "IBM424", 0), // "IBM EBCDIC (Hebrew)"
// MapCodePageDataItem( 20833, 949, "x-EBCDIC-KoreanExtended", 0), // "IBM EBCDIC (Korean Extended)"
// MapCodePageDataItem( 20838, 874, "IBM-Thai", 0), // "IBM EBCDIC (Thai)"
MapCodePageDataItem( 20866, 1251, "koi8-r", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Cyrillic (KOI8-R)"
MapCodePageDataItem( 20871, 1252, "IBM871", 0), // "IBM EBCDIC (Icelandic)"
/*
MapCodePageDataItem( 20880, 1251, "IBM880", 0), // "IBM EBCDIC (Cyrillic Russian)"
MapCodePageDataItem( 20905, 1254, "IBM905", 0), // "IBM EBCDIC (Turkish)"
MapCodePageDataItem( 20924, 1252, "IBM00924", 0), // "IBM Latin-1"
MapCodePageDataItem( 20932, 932, "EUC-JP", 0), // "Japanese (JIS 0208-1990 and 0212-1990)"
MapCodePageDataItem( 20936, 936, "x-cp20936", 0), // "Chinese Simplified (GB2312-80)"
MapCodePageDataItem( 20949, 949, "x-cp20949", 0), // "Korean Wansung"
*/
MapCodePageDataItem( 21025, 1251, "cp1025", 0), // "IBM EBCDIC (Cyrillic Serbian-Bulgarian)"
MapCodePageDataItem( 21866, 1251, "koi8-u", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Cyrillic (KOI8-U)"
MapCodePageDataItem( 28591, 1252, "iso-8859-1", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Western European (ISO)"
MapCodePageDataItem( 28592, 1250, "iso-8859-2", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Central European (ISO)"
MapCodePageDataItem( 28593, 1254, "iso-8859-3", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "Latin 3 (ISO)"
MapCodePageDataItem( 28594, 1257, "iso-8859-4", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Baltic (ISO)"
MapCodePageDataItem( 28595, 1251, "iso-8859-5", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Cyrillic (ISO)"
MapCodePageDataItem( 28596, 1256, "iso-8859-6", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Arabic (ISO)"
MapCodePageDataItem( 28597, 1253, "iso-8859-7", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Greek (ISO)"
MapCodePageDataItem( 28598, 1255, "iso-8859-8", MIMECONTF_BROWSER | MIMECONTF_SAVABLE_BROWSER), // "Hebrew (ISO-Visual)"
MapCodePageDataItem( 28599, 1254, "iso-8859-9", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Turkish (ISO)"
// MapCodePageDataItem( 28603, 1257, "iso-8859-13", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "Estonian (ISO)"
MapCodePageDataItem( 28605, 1252, "iso-8859-15", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Latin 9 (ISO)"
// MapCodePageDataItem( 29001, 1252, "x-Europa", 0), // "Europa"
MapCodePageDataItem( 38598, 1255, "iso-8859-8-i", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Hebrew (ISO-Logical)"
MapCodePageDataItem( 50220, 932, "iso-2022-jp", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "Japanese (JIS)"
MapCodePageDataItem( 50221, 932, "|csISO2022JP|iso-2022-jp|iso-2022-jp", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Japanese (JIS-Allow 1 byte Kana)"
MapCodePageDataItem( 50222, 932, "iso-2022-jp", 0), // "Japanese (JIS-Allow 1 byte Kana - SO/SI)"
// MapCodePageDataItem( 50225, 949, "|iso-2022-kr|euc-kr|iso-2022-kr", MIMECONTF_MAILNEWS), // "Korean (ISO)"
// MapCodePageDataItem( 50227, 936, "x-cp50227", 0), // "Chinese Simplified (ISO-2022)"
//MapCodePageDataItem( 50229, 950, L"x-cp50229", L"x-cp50229", L"x-cp50229", 0}, // "Chinese Traditional (ISO-2022)"
//MapCodePageDataItem( 50930, 932, L"cp930", L"cp930", L"cp930", 0}, // "IBM EBCDIC (Japanese and Japanese Katakana)"
//MapCodePageDataItem( 50931, 932, L"x-EBCDIC-JapaneseAndUSCanada", L"x-EBCDIC-JapaneseAndUSCanada", L"x-EBCDIC-JapaneseAndUSCanada", 0}, // "IBM EBCDIC (Japanese and US-Canada)"
//MapCodePageDataItem( 50933, 949, L"cp933", L"cp933", L"cp933", 0}, // "IBM EBCDIC (Korean and Korean Extended)"
//MapCodePageDataItem( 50935, 936, L"cp935", L"cp935", L"cp935", 0}, // "IBM EBCDIC (Simplified Chinese)"
//MapCodePageDataItem( 50937, 950, L"cp937", L"cp937", L"cp937", 0}, // "IBM EBCDIC (Traditional Chinese)"
//MapCodePageDataItem( 50939, 932, L"cp939", L"cp939", L"cp939", 0}, // "IBM EBCDIC (Japanese and Japanese-Latin)"
MapCodePageDataItem( 51932, 932, "euc-jp", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Japanese (EUC)"
// MapCodePageDataItem( 51936, 936, "EUC-CN", 0), // "Chinese Simplified (EUC)"
MapCodePageDataItem( 51949, 949, "euc-kr", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "Korean (EUC)"
// MapCodePageDataItem( 52936, 936, "hz-gb-2312", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Chinese Simplified (HZ)"
MapCodePageDataItem( 54936, 936, "GB18030", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Chinese Simplified (GB18030)"
MapCodePageDataItem( 57002, 57002, "x-iscii-de", 0), // "ISCII Devanagari"
MapCodePageDataItem( 57003, 57003, "x-iscii-be", 0), // "ISCII Bengali"
MapCodePageDataItem( 57004, 57004, "x-iscii-ta", 0), // "ISCII Tamil"
MapCodePageDataItem( 57005, 57005, "x-iscii-te", 0), // "ISCII Telugu"
MapCodePageDataItem( 57006, 57006, "x-iscii-as", 0), // "ISCII Assamese"
MapCodePageDataItem( 57007, 57007, "x-iscii-or", 0), // "ISCII Oriya"
MapCodePageDataItem( 57008, 57008, "x-iscii-ka", 0), // "ISCII Kannada"
MapCodePageDataItem( 57009, 57009, "x-iscii-ma", 0), // "ISCII Malayalam"
MapCodePageDataItem( 57010, 57010, "x-iscii-gu", 0), // "ISCII Gujarati"
MapCodePageDataItem( 57011, 57011, "x-iscii-pa", 0), // "ISCII Punjabi"
MapCodePageDataItem( 65000, 1200, "utf-7", MIMECONTF_MAILNEWS | MIMECONTF_SAVABLE_MAILNEWS), // "Unicode (UTF-7)"
MapCodePageDataItem( 65001, 1200, "utf-8", MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER), // "Unicode (UTF-8)"
#endif // FEATURE_CORECLR
// End of data.
MapCodePageDataItem( 0, 0, null, 0),
};
#endregion
#region "from coreclr/src/pal/inc/rt/palrt.h"
// modified
const int
//typedef
//enum tagMIMECONTF {
MIMECONTF_MAILNEWS = 0x1,
MIMECONTF_BROWSER = 0x2,
MIMECONTF_MINIMAL = 0x4,
MIMECONTF_IMPORT = 0x8,
MIMECONTF_SAVABLE_MAILNEWS = 0x100,
MIMECONTF_SAVABLE_BROWSER = 0x200,
MIMECONTF_EXPORT = 0x400,
MIMECONTF_PRIVCONVERTER = 0x10000,
MIMECONTF_VALID = 0x20000,
MIMECONTF_VALID_NLS = 0x40000,
MIMECONTF_MIME_IE4 = 0x10000000,
MIMECONTF_MIME_LATEST = 0x20000000,
MIMECONTF_MIME_REGISTRY = 0x40000000
// } MIMECONTF;
;
#endregion
}
#region "from referencesource/mscorlib/system/globalization/encodingtable.cs"
//
// Data table for encoding classes. Used by System.Text.Encoding.
// This class contains two hashtables to allow System.Text.Encoding
// to retrieve the data item either by codepage value or by webName.
//
// Only statics, does not need to be marked with the serializable attribute
internal static partial class EncodingTable
{
//This number is the size of the table in native. The value is retrieved by
//calling the native GetNumEncodingItems().
private static int lastEncodingItem = GetNumEncodingItems() - 1;
//This number is the size of the code page table. Its generated when we walk the table the first time.
private static volatile int lastCodePageItem;
/*
//
// This points to a native data table which maps an encoding name to the correct code page.
//
[SecurityCritical]
unsafe internal static InternalEncodingDataItem* encodingDataPtr = GetEncodingData();
//
// This points to a native data table which stores the properties for the code page, and
// the table is indexed by code page.
//
[SecurityCritical]
unsafe internal static InternalCodePageDataItem* codePageDataPtr = GetCodePageData();
*/
//
// This caches the mapping of an encoding name to a code page.
//
private static Hashtable hashByName = Hashtable.Synchronized(new Hashtable(StringComparer.OrdinalIgnoreCase));
//
// THe caches the data item which is indexed by the code page value.
//
private static Hashtable hashByCodePage = Hashtable.Synchronized(new Hashtable());
[System.Security.SecuritySafeCritical] // static constructors should be safe to call
static EncodingTable()
{
}
// Find the data item by binary searching the table that we have in native.
// nativeCompareOrdinalWC is an internal-only function.
[System.Security.SecuritySafeCritical] // auto-generated
unsafe private static int internalGetCodePageFromName(String name) {
int left = 0;
int right = lastEncodingItem;
int index;
int result;
//Binary search the array until we have only a couple of elements left and then
//just walk those elements.
while ((right - left)>3) {
index = ((right - left)/2) + left;
result = String.Compare (name, encodingDataPtr[index].webName, StringComparison.OrdinalIgnoreCase);
if (result == 0) {
//We found the item, return the associated codepage.
return (encodingDataPtr[index].codePage);
} else if (result<0) {
//The name that we're looking for is less than our current index.
right = index;
} else {
//The name that we're looking for is greater than our current index
left = index;
}
}
//Walk the remaining elements (it'll be 3 or fewer).
for (; left<=right; left++) {
if (String.Compare(name, encodingDataPtr[left].webName, StringComparison.OrdinalIgnoreCase) == 0) {
return (encodingDataPtr[left].codePage);
}
}
// The encoding name is not valid.
throw new ArgumentException(
String.Format(
CultureInfo.CurrentCulture,
Environment.GetResourceString("Argument_EncodingNotSupported"), name), "name");
}
// Return a list of all EncodingInfo objects describing all of our encodings
[System.Security.SecuritySafeCritical] // auto-generated
internal static unsafe EncodingInfo[] GetEncodings()
{
if (lastCodePageItem == 0)
{
int count;
for (count = 0; codePageDataPtr[count].codePage != 0; count++)
{
// Count them
}
lastCodePageItem = count;
}
EncodingInfo[] arrayEncodingInfo = new EncodingInfo[lastCodePageItem];
int i;
for (i = 0; i < lastCodePageItem; i++)
{
arrayEncodingInfo[i] = new EncodingInfo(codePageDataPtr[i].codePage, CodePageDataItem.CreateString(codePageDataPtr[i].Names, 0),
Environment.GetResourceString("Globalization.cp_" + codePageDataPtr[i].codePage));
}
return arrayEncodingInfo;
}
/*=================================GetCodePageFromName==========================
**Action: Given a encoding name, return the correct code page number for this encoding.
**Returns: The code page for the encoding.
**Arguments:
** name the name of the encoding
**Exceptions:
** ArgumentNullException if name is null.
** internalGetCodePageFromName will throw ArgumentException if name is not a valid encoding name.
============================================================================*/
internal static int GetCodePageFromName(String name)
{
if (name==null) {
throw new ArgumentNullException("name");
}
Contract.EndContractBlock();
Object codePageObj;
//
// The name is case-insensitive, but ToLower isn't free. Check for
// the code page in the given capitalization first.
//
codePageObj = hashByName[name];
if (codePageObj!=null) {
return ((int)codePageObj);
}
//Okay, we didn't find it in the hash table, try looking it up in the
//unmanaged data.
int codePage = internalGetCodePageFromName(name);
hashByName[name] = codePage;
return codePage;
}
[System.Security.SecuritySafeCritical] // auto-generated
unsafe internal static CodePageDataItem GetCodePageDataItem(int codepage) {
CodePageDataItem dataItem;
// We synchronize around dictionary gets/sets. There's still a possibility that two threads
// will create a CodePageDataItem and the second will clobber the first in the dictionary.
// However, that's acceptable because the contents are correct and we make no guarantees
// other than that.
//Look up the item in the hashtable.
dataItem = (CodePageDataItem)hashByCodePage[codepage];
//If we found it, return it.
if (dataItem!=null) {
return dataItem;
}
//If we didn't find it, try looking it up now.
//If we find it, add it to the hashtable.
//This is a linear search, but we probably won't be doing it very often.
//
int i = 0;
int data;
while ((data = codePageDataPtr[i].codePage) != 0) {
if (data == codepage) {
dataItem = new CodePageDataItem(i);
hashByCodePage[codepage] = dataItem;
return (dataItem);
}
i++;
}
//Nope, we didn't find it.
return null;
}
/*
[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private unsafe static extern InternalEncodingDataItem *GetEncodingData();
//
// Return the number of encoding data items.
//
[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern int GetNumEncodingItems();
[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private unsafe static extern InternalCodePageDataItem* GetCodePageData();
[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal unsafe static extern byte* nativeCreateOpenFileMapping(
String inSectionName, int inBytesToAllocate, out IntPtr mappedFileHandle);
*/
}
/*=================================InternalEncodingDataItem==========================
**Action: This is used to map a encoding name to a correct code page number. By doing this,
** we can get the properties of this encoding via the InternalCodePageDataItem.
**
** We use this structure to access native data exposed by the native side.
============================================================================*/
[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)]
internal struct InternalEncodingDataItem {
[SecurityCritical]
internal string webName;
internal UInt16 codePage;
}
/*=================================InternalCodePageDataItem==========================
**Action: This is used to access the properties related to a code page.
** We use this structure to access native data exposed by the native side.
============================================================================*/
[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)]
internal struct InternalCodePageDataItem {
internal UInt16 codePage;
internal UInt16 uiFamilyCodePage;
internal uint flags;
[SecurityCritical]
internal string Names;
}
#endregion
}
@@ -6,17 +6,16 @@ namespace System
{
internal static string GetResourceString (string key)
{
return Messages.GetMessage (key);
return key;
}
internal static string GetResourceString (string key, CultureInfo culture)
{
return GetResourceString (key);
return key;
}
internal static string GetResourceString (string key, params object[] values)
{
key = Messages.GetMessage (key);
return string.Format (CultureInfo.InvariantCulture, key, values);
}
}
@@ -40,12 +40,19 @@ namespace System {
internal const int TreatAsI1=0x400;
internal const int TreatAsI2=0x800;
internal const int IsTight=0x1000;
// internal const int NoSpace=0x2000;
internal const int NoSpace=0x2000;
public static int StringToInt (string value, int fromBase, int flags)
public static int StringToInt (string value, int fromBase, int flags)
{
if ((flags & IsTight) == 0)
throw new NotImplementedException ();
unsafe {
return StringToInt (value, fromBase, flags, null);
}
}
public unsafe static int StringToInt (string value, int fromBase, int flags, int* parsePos)
{
if ((flags & (IsTight | NoSpace)) == 0)
throw new NotImplementedException (flags.ToString ());
if (value == null)
return 0;
@@ -54,7 +61,6 @@ namespace System {
uint result = 0;
int digitValue;
int i = 0;
int len = value.Length;
bool negative = false;
@@ -63,6 +69,8 @@ namespace System {
throw new ArgumentOutOfRangeException ("Empty string");
}
int i = parsePos == null ? 0 : *parsePos;
//Check for a sign
if (value [i] == '-') {
if (fromBase != 10)
@@ -91,17 +99,19 @@ namespace System {
}
while (i < len) {
char c = value [i++];
char c = value [i];
if (Char.IsNumber (c)) {
digitValue = c - '0';
} else if (Char.IsLetter (c)) {
digitValue = Char.ToLowerInvariant (c) - 'a' + 10;
} else {
if (chars > 0) {
throw new FormatException ("Additional unparsable characters are at the end of the string.");
}
if (i == 0)
throw new FormatException ("Could not find any parsable digits.");
throw new FormatException ("Could not find any parsable digits.");
if ((flags & IsTight) != 0)
throw new FormatException ("Additional unparsable characters are at the end of the string.");
break;
}
if (digitValue >= fromBase) {
@@ -118,11 +128,15 @@ namespace System {
result = res;
chars++;
++i;
}
if (chars == 0)
throw new FormatException ("Could not find any parsable digits.");
if (parsePos != null)
*parsePos = i;
return negative ? -(int)result : (int)result;
}
@@ -149,8 +163,15 @@ namespace System {
public static long StringToLong (string value, int fromBase, int flags)
{
if ((flags & IsTight) == 0)
throw new NotImplementedException ();
unsafe {
return StringToLong (value, fromBase, flags, null);
}
}
public unsafe static long StringToLong (string value, int fromBase, int flags, int* parsePos)
{
if ((flags & (IsTight | NoSpace)) == 0)
throw new NotImplementedException (flags.ToString ());
if (value == null)
return 0;
@@ -159,7 +180,6 @@ namespace System {
int digitValue = -1;
long result = 0;
int i = 0;
int len = value.Length;
bool negative = false;
@@ -168,6 +188,8 @@ namespace System {
throw new ArgumentOutOfRangeException ("Empty string");
}
int i = parsePos == null ? 0 : *parsePos;
//Check for a sign
if (value [i] == '-') {
if (fromBase != 10)
@@ -187,19 +209,19 @@ namespace System {
}
while (i < len) {
char c = value[i++];
char c = value[i];
if (Char.IsNumber (c)) {
digitValue = c - '0';
} else if (Char.IsLetter (c)) {
digitValue = Char.ToLowerInvariant (c) - 'a' + 10;
} else {
if (chars > 0) {
throw new FormatException ("Additional unparsable "
+ "characters are at the end of the string.");
} else {
throw new FormatException ("Could not find any parsable"
+ " digits.");
}
if (i == 0)
throw new FormatException ("Could not find any parsable digits.");
if ((flags & IsTight) != 0)
throw new FormatException ("Additional unparsable characters are at the end of the string.");
break;
}
if (digitValue >= fromBase) {
@@ -214,11 +236,15 @@ namespace System {
result = fromBase * result + digitValue;
chars++;
++i;
}
if (chars == 0)
throw new FormatException ("Could not find any parsable digits.");
if (parsePos != null)
*parsePos = i;
return negative ? -result : result;
}
@@ -360,4 +386,4 @@ namespace System {
}
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,434 +0,0 @@
//
// System.Globalization.CharUnicodeInfo.cs
//
// Author:
// Atsushi Enomoto <[email protected]>
//
// (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;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
namespace System.Globalization
{
public static class CharUnicodeInfo
{
static CharUnicodeInfo ()
{
unsafe {
GetDataTablePointers (CategoryDataVersion,
out category_data, out category_astral_index, out numeric_data,
out numeric_data_values, out to_lower_data_low, out to_lower_data_high,
out to_upper_data_low, out to_upper_data_high);
category_check_pair = category_astral_index != null
? (byte)UnicodeCategory.Surrogate
: (byte)0xff;
}
}
private readonly unsafe static byte *category_data;
private readonly unsafe static ushort *category_astral_index;
private readonly unsafe static byte *numeric_data; // unused
private readonly unsafe static double *numeric_data_values; // unused
private readonly unsafe static ushort *to_lower_data_low;
private readonly unsafe static ushort *to_lower_data_high;
private readonly unsafe static ushort *to_upper_data_low;
private readonly unsafe static ushort *to_upper_data_high;
// UnicodeCategory.Surrogate if astral plane
// categories are available, 0xff otherwise.
private readonly static byte category_check_pair;
private const int CategoryDataVersion = 4;
[MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
private unsafe static extern void GetDataTablePointers (int category_data_version,
out byte *category_data, out ushort *category_astral_index, out byte *numeric_data,
out double *numeric_data_values, out ushort *to_lower_data_low, out ushort *to_lower_data_high,
out ushort *to_upper_data_low, out ushort *to_upper_data_high);
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");
if (((uint)index)>=((uint)s.Length))
throw new ArgumentOutOfRangeException("index");
return GetNumericValue (s [index]);
}
public static UnicodeCategory GetUnicodeCategory (char ch)
{
return (InternalGetUnicodeCategory(ch)) ;
}
public static UnicodeCategory GetUnicodeCategory (string s, int index)
{
if (s==null)
throw new ArgumentNullException("s");
if (((uint)index)>=((uint)s.Length)) {
throw new ArgumentOutOfRangeException("index");
}
Contract.EndContractBlock();
return InternalGetUnicodeCategory(s, index);
}
internal static char ToLowerInvariant (char c)
{
unsafe {
if (c <= ((char)0x24cf))
return (char) to_lower_data_low [c];
if (c >= ((char)0xff21))
return (char) to_lower_data_high[c - 0xff21];
}
return c;
}
public static char ToUpperInvariant (char c)
{
unsafe {
if (c <= ((char)0x24e9))
return (char) to_upper_data_low [c];
if (c >= ((char)0xff21))
return (char) to_upper_data_high [c - 0xff21];
}
return c;
}
internal unsafe static UnicodeCategory InternalGetUnicodeCategory (int ch)
{
return (UnicodeCategory)(category_data [ch]);
}
internal static UnicodeCategory InternalGetUnicodeCategory (string value, int index) {
Contract.Assert(value != null, "value can not be null");
Contract.Assert(index < value.Length, "index < value.Length");
UnicodeCategory c = GetUnicodeCategory (value [index]);
if ((byte)c == category_check_pair &&
Char.IsSurrogatePair (value, index)) {
int u = Char.ConvertToUtf32 (value [index], value [index + 1]);
unsafe {
// ConvertToUtf32 guarantees 0x10000 <= u <= 0x10ffff
int x = (category_astral_index [(u - 0x10000) >> 8] << 8) + (u & 0xff);
c = (UnicodeCategory)category_data [x];
}
}
return c;
}
internal const char HIGH_SURROGATE_START = '\ud800';
internal const char HIGH_SURROGATE_END = '\udbff';
internal const char LOW_SURROGATE_START = '\udc00';
internal const char LOW_SURROGATE_END = '\udfff';
internal static bool IsWhiteSpace(String s, int index)
{
Contract.Assert(s != null, "s!=null");
Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length");
UnicodeCategory uc = GetUnicodeCategory(s, index);
// In Unicode 3.0, U+2028 is the only character which is under the category "LineSeparator".
// And U+2029 is th eonly character which is under the category "ParagraphSeparator".
switch (uc) {
case (UnicodeCategory.SpaceSeparator):
case (UnicodeCategory.LineSeparator):
case (UnicodeCategory.ParagraphSeparator):
return (true);
}
return (false);
}
internal static bool IsWhiteSpace(char c)
{
UnicodeCategory uc = GetUnicodeCategory(c);
// In Unicode 3.0, U+2028 is the only character which is under the category "LineSeparator".
// And U+2029 is th eonly character which is under the category "ParagraphSeparator".
switch (uc) {
case (UnicodeCategory.SpaceSeparator):
case (UnicodeCategory.LineSeparator):
case (UnicodeCategory.ParagraphSeparator):
return (true);
}
return (false);
}
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ namespace System.IO {
private bool m_disposed;
public BinaryReader(Stream input)
: this(input, Encoding.UTF8UnmarkedUnsafe)
: this(input, EncodingHelper.UTF8UnmarkedUnsafe)
{
}
+2 -2
View File
@@ -51,11 +51,11 @@ namespace System.IO {
int maxCharsPerRound;
bool disposed;
protected BinaryWriter() : this (Stream.Null, Encoding.UTF8UnmarkedUnsafe)
protected BinaryWriter() : this (Stream.Null, EncodingHelper.UTF8UnmarkedUnsafe)
{
}
public BinaryWriter(Stream output) : this(output, Encoding.UTF8UnmarkedUnsafe)
public BinaryWriter(Stream output) : this(output, EncodingHelper.UTF8UnmarkedUnsafe)
{
}
+1 -1
View File
@@ -575,7 +575,7 @@ namespace System.IO
public static void WriteAllText (string path, string contents)
{
WriteAllText (path, contents, Encoding.UTF8Unmarked);
WriteAllText (path, contents, EncodingHelper.UTF8Unmarked);
}
public static void WriteAllText (string path, string contents, Encoding encoding)
+2 -2
View File
@@ -328,7 +328,7 @@ namespace System.IO {
return 0;
if (input_buffer [0] == 0xef && input_buffer [1] == 0xbb && input_buffer [2] == 0xbf){
this.encoding = Encoding.UTF8Unmarked;
this.encoding = EncodingHelper.UTF8Unmarked;
return 3;
}
@@ -343,7 +343,7 @@ namespace System.IO {
if (input_buffer [0] == 0 && input_buffer [1] == 0
&& input_buffer [2] == 0xfe && input_buffer [3] == 0xff)
{
this.encoding = Encoding.BigEndianUTF32;
this.encoding = EncodingHelper.BigEndianUTF32;
return 4;
}
+4 -4
View File
@@ -59,10 +59,10 @@ namespace System.IO {
readonly bool leave_open;
IDecoupledTask async_task;
public new static readonly StreamWriter Null = new StreamWriter (Stream.Null, Encoding.UTF8Unmarked, 1);
public new static readonly StreamWriter Null = new StreamWriter (Stream.Null, EncodingHelper.UTF8Unmarked, 1);
public StreamWriter (Stream stream)
: this (stream, Encoding.UTF8Unmarked, DefaultBufferSize) {}
: this (stream, EncodingHelper.UTF8Unmarked, DefaultBufferSize) {}
public StreamWriter (Stream stream, Encoding encoding)
: this (stream, encoding, DefaultBufferSize) {}
@@ -102,10 +102,10 @@ namespace System.IO {
}
public StreamWriter (string path)
: this (path, false, Encoding.UTF8Unmarked, DefaultFileBufferSize) {}
: this (path, false, EncodingHelper.UTF8Unmarked, DefaultFileBufferSize) {}
public StreamWriter (string path, bool append)
: this (path, append, Encoding.UTF8Unmarked, DefaultFileBufferSize) {}
: this (path, append, EncodingHelper.UTF8Unmarked, DefaultFileBufferSize) {}
public StreamWriter (string path, bool append, Encoding encoding)
: this (path, append, encoding, DefaultFileBufferSize) {}
@@ -583,8 +583,7 @@ namespace System.Reflection.Emit {
{
if (method == null)
throw new ArgumentNullException ("method");
if (method.DeclaringType.Module != this)
throw new InvalidOperationException ("The method is not in this module");
return new MethodToken (GetToken (method));
}
@@ -201,13 +201,9 @@ namespace System.Reflection {
}
}
[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
UnitySerializationHolder.GetAssemblyData (this, info, context);
throw new NotImplementedException ();
}
public virtual bool IsDefined (Type attributeType, bool inherit)
+1 -4
View File
@@ -122,10 +122,7 @@ namespace System.Reflection {
[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
UnitySerializationHolder.GetModuleData (this, info, context);
throw new NotImplementedException ();
}
[ComVisible (true)]
@@ -34,14 +34,30 @@ using System.Runtime.InteropServices;
using System.Reflection.Emit;
#endif
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace System.Reflection {
abstract class RuntimeAssembly : Assembly
{
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
UnitySerializationHolder.GetUnitySerializationInfo (info,
UnitySerializationHolder.AssemblyUnity,
this.FullName,
this);
}
}
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Assembly))]
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
class MonoAssembly : Assembly {
class MonoAssembly : RuntimeAssembly
{
public
override
Type GetType (string name, bool throwOnError, bool ignoreCase)
@@ -34,7 +34,7 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Security;
using System.Security.Permissions;
using System.Runtime.Serialization;
namespace System.Reflection {
@@ -267,6 +267,14 @@ namespace System.Reflection {
return res;
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
UnitySerializationHolder.GetUnitySerializationInfo (info, UnitySerializationHolder.ModuleUnity, this.ScopeName, this.GetRuntimeAssembly ());
}
#if !NET_2_1
public
@@ -291,5 +299,10 @@ namespace System.Reflection {
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
internal RuntimeAssembly GetRuntimeAssembly ()
{
return (RuntimeAssembly)assembly;
}
}
}
@@ -77,6 +77,13 @@ namespace System.Runtime.Serialization
}
}
// Constructor
[CLSCompliant (false)]
public SerializationInfo (Type type, IFormatterConverter converter, bool requireSameTokenInPartialTrust) : this (type, converter)
{
}
// Constructor
[CLSCompliant (false)]
public SerializationInfo (Type type, IFormatterConverter converter)
@@ -38,7 +38,7 @@ namespace System.Security.Cryptography {
public class HMACRIPEMD160 : HMAC {
public HMACRIPEMD160 ()
: this (KeyBuilder.Key (8))
: this (KeyBuilder.Key (64))
{
}
@@ -52,7 +52,7 @@ namespace System.Security.Cryptography {
public class HMACSHA1 : HMAC {
public HMACSHA1 ()
: this (KeyBuilder.Key (8))
: this (KeyBuilder.Key (64))
{
}
@@ -38,7 +38,7 @@ namespace System.Security.Cryptography {
public class HMACSHA256 : HMAC {
public HMACSHA256 ()
: this (KeyBuilder.Key (8))
: this (KeyBuilder.Key (64))
{
}
@@ -49,7 +49,7 @@ namespace System.Security.Cryptography {
#endif
public HMACSHA384 ()
: this (KeyBuilder.Key (8))
: this (KeyBuilder.Key (128))
{
}
@@ -49,7 +49,7 @@ namespace System.Security.Cryptography {
#endif
public HMACSHA512 ()
: this (KeyBuilder.Key (8))
: this (KeyBuilder.Key (128))
{
}
@@ -0,0 +1,195 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
namespace System.Text
{
internal static class EncodingHelper
{
//
// Only internal, to be used by the class libraries: Unmarked and non-input-validating
//
internal static Encoding UTF8Unmarked {
get {
if (utf8EncodingWithoutMarkers == null) {
lock (lockobj){
if (utf8EncodingWithoutMarkers == null){
utf8EncodingWithoutMarkers = new UTF8Encoding (false, false);
utf8EncodingWithoutMarkers.setReadOnly ();
}
}
}
return utf8EncodingWithoutMarkers;
}
}
//
// Only internal, to be used by the class libraries: Unmarked and non-input-validating
//
internal static Encoding UTF8UnmarkedUnsafe {
get {
if (utf8EncodingUnsafe == null) {
lock (lockobj){
if (utf8EncodingUnsafe == null){
utf8EncodingUnsafe = new UTF8Encoding (false, false);
utf8EncodingUnsafe.setReadOnly (false);
utf8EncodingUnsafe.DecoderFallback = new DecoderReplacementFallback (String.Empty);
utf8EncodingUnsafe.setReadOnly ();
}
}
}
return utf8EncodingUnsafe;
}
}
// Get the standard big-endian UTF-32 encoding object.
internal static Encoding BigEndianUTF32
{
get {
if (bigEndianUTF32Encoding == null) {
lock (lockobj) {
if (bigEndianUTF32Encoding == null) {
bigEndianUTF32Encoding = new UTF32Encoding (true, true);
bigEndianUTF32Encoding.setReadOnly ();
}
}
}
return bigEndianUTF32Encoding;
}
}
static volatile Encoding utf8EncodingWithoutMarkers;
static volatile Encoding utf8EncodingUnsafe;
static volatile Encoding bigEndianUTF32Encoding;
static readonly object lockobj = new object ();
[MethodImpl (MethodImplOptions.InternalCall)]
extern internal static string InternalCodePage (ref int code_page);
internal static Encoding GetDefaultEncoding ()
{
Encoding enc = null;
// See if the underlying system knows what
// code page handler we should be using.
int code_page = 1;
string code_page_name = InternalCodePage (ref code_page);
try {
if (code_page == -1)
enc = Encoding.GetEncoding (code_page_name);
else {
// map the codepage from internal to our numbers
code_page = code_page & 0x0fffffff;
switch (code_page){
case 1: code_page = 20127; break; // ASCIIEncoding.ASCII_CODE_PAGE
case 2: code_page = 65007; break; // UTF7Encoding.UTF7_CODE_PAGE
case 3: code_page = 65001; break; // UTF8Encoding.UTF8_CODE_PAGE
case 4: code_page = 1200; break; // UnicodeEncoding.UNICODE_CODE_PAGE
case 5: code_page = 1201; break; // UnicodeEncoding.BIG_UNICODE_CODE_PAGE
case 6: code_page = 1252; break; // Latin1Encoding.ISOLATIN_CODE_PAGE
}
enc = Encoding.GetEncoding (code_page);
}
} catch (NotSupportedException) {
// code_page is not supported on underlying platform
enc = EncodingHelper.UTF8Unmarked;
} catch (ArgumentException) {
// code_page_name is not a valid code page, or is
// not supported by underlying OS
enc = EncodingHelper.UTF8Unmarked;
}
return enc;
}
// Loaded copy of the "I18N" assembly. We need to move
// this into a class in "System.Private" eventually.
private static Assembly i18nAssembly;
private static bool i18nDisabled;
// Invoke a specific method on the "I18N" manager object.
// Returns NULL if the method failed.
internal static Object InvokeI18N (String name, params Object[] args)
{
lock (lockobj) {
// Bail out if we previously detected that there
// is insufficent engine support for I18N handling.
if (i18nDisabled) {
return null;
}
// Find or load the "I18N" assembly.
if (i18nAssembly == null) {
try {
try {
i18nAssembly = Assembly.Load (Consts.AssemblyI18N);
} catch (NotImplementedException) {
// Assembly loading unsupported by the engine.
i18nDisabled = true;
return null;
}
if (i18nAssembly == null) {
return null;
}
} catch (SystemException) {
return null;
}
}
// Find the "I18N.Common.Manager" class.
Type managerClass;
try {
managerClass = i18nAssembly.GetType ("I18N.Common.Manager");
} catch (NotImplementedException) {
// "GetType" is not supported by the engine.
i18nDisabled = true;
return null;
}
if (managerClass == null) {
return null;
}
// Get the value of the "PrimaryManager" property.
Object manager;
try {
manager = managerClass.InvokeMember
("PrimaryManager",
BindingFlags.GetProperty |
BindingFlags.Static |
BindingFlags.Public,
null, null, null, null, null, null);
if (manager == null) {
return null;
}
} catch (MissingMethodException) {
return null;
} catch (SecurityException) {
return null;
} catch (NotImplementedException) {
// "InvokeMember" is not supported by the engine.
i18nDisabled = true;
return null;
}
// Invoke the requested method on the manager.
try {
return managerClass.InvokeMember
(name,
BindingFlags.InvokeMethod |
BindingFlags.Instance |
BindingFlags.Public,
null, manager, args, null, null, null);
} catch (MissingMethodException) {
return null;
} catch (SecurityException) {
return null;
}
}
}
}
}
@@ -31,6 +31,11 @@ using System;
[Serializable]
internal class Latin1Encoding : Encoding
{
// until we change the callers:
internal static string _ (string arg) {
return arg;
}
// Magic number used by Windows for the ISO Latin1 code page.
internal const int ISOLATIN_CODE_PAGE = 28591;
+2 -2
View File
@@ -125,11 +125,11 @@ namespace System
// UTF-8 ZWNBSP (zero-width non-breaking space).
//
int code_page = 0;
Encoding.InternalCodePage (ref code_page);
EncodingHelper.InternalCodePage (ref code_page);
if (code_page != -1 && ((code_page & 0x0fffffff) == 3 // UTF8Encoding.UTF8_CODE_PAGE
|| ((code_page & 0x10000000) != 0)))
inputEncoding = outputEncoding = Encoding.UTF8Unmarked;
inputEncoding = outputEncoding = EncodingHelper.UTF8Unmarked;
else
inputEncoding = outputEncoding = Encoding.Default;
}
-157
View File
@@ -1,157 +0,0 @@
//
// System.DBNull.cs
//
// Authors:
// Duncan Mak ([email protected])
// Ben Maurer ([email protected])
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// (C) 2003 Ben Maurer
//
//
// 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.Runtime.Serialization;
using System.Runtime.InteropServices;
namespace System
{
[Serializable]
[ComVisible (true)]
public sealed class DBNull : ISerializable, IConvertible
{
// Fields
public static readonly DBNull Value = new DBNull ();
// Private constructor
private DBNull ()
{
}
private DBNull (SerializationInfo info, StreamingContext context)
{
throw new NotSupportedException ();
}
// Methods
public void GetObjectData (SerializationInfo info, StreamingContext context)
{
UnitySerializationHolder.GetDBNullData (this, info, context);
}
public TypeCode GetTypeCode ()
{
return TypeCode.DBNull;
}
bool IConvertible.ToBoolean (IFormatProvider provider)
{
throw new InvalidCastException ();
}
byte IConvertible.ToByte (IFormatProvider provider)
{
throw new InvalidCastException ();
}
char IConvertible.ToChar (IFormatProvider provider)
{
throw new InvalidCastException ();
}
DateTime IConvertible.ToDateTime (IFormatProvider provider)
{
throw new InvalidCastException ();
}
decimal IConvertible.ToDecimal (IFormatProvider provider)
{
throw new InvalidCastException ();
}
double IConvertible.ToDouble (IFormatProvider provider)
{
throw new InvalidCastException ();
}
short IConvertible.ToInt16 (IFormatProvider provider)
{
throw new InvalidCastException ();
}
int IConvertible.ToInt32 (IFormatProvider provider)
{
throw new InvalidCastException ();
}
long IConvertible.ToInt64 (IFormatProvider provider)
{
throw new InvalidCastException ();
}
sbyte IConvertible.ToSByte (IFormatProvider provider)
{
throw new InvalidCastException ();
}
float IConvertible.ToSingle (IFormatProvider provider)
{
throw new InvalidCastException ();
}
object IConvertible.ToType (Type targetType, IFormatProvider provider)
{
if (targetType == typeof (string))
return String.Empty;
if (targetType == typeof (DBNull))
return this;
throw new InvalidCastException ();
}
ushort IConvertible.ToUInt16 (IFormatProvider provider)
{
throw new InvalidCastException ();
}
uint IConvertible.ToUInt32 (IFormatProvider provider)
{
throw new InvalidCastException ();
}
ulong IConvertible.ToUInt64 (IFormatProvider provider)
{
throw new InvalidCastException ();
}
public override string ToString ()
{
return String.Empty;
}
public string ToString (IFormatProvider provider)
{
return String.Empty;
}
}
}
+25
View File
@@ -0,0 +1,25 @@
#if MONOTOUCH && FULL_AOT_RUNTIME
using Crimson.CommonCrypto;
namespace System
{
partial struct Guid
{
public static Guid NewGuid ()
{
byte[] b = new byte [16];
Cryptor.GetRandom (b);
Guid res = new Guid (b);
// Mask in Variant 1-0 in Bit[7..6]
res._d = (byte) ((res._d & 0x3fu) | 0x80u);
// Mask in Version 4 (random based Guid) in Bits[15..13]
res._c = (short) ((res._c & 0x0fffu) | 0x4000u);
return res;
}
}
}
#endif
+9 -746
View File
@@ -11,10 +11,6 @@
// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com)
// Copyright 2012, 2014 Xamarin, Inc (http://www.xamarin.com)
//
// References
// 1. UUIDs and GUIDs (DRAFT), Section 3.4
// http://www.ics.uci.edu/~ejw/authoring/uuid-guid/draft-leach-uuids-guids-01.txt
//
// 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
@@ -35,508 +31,27 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
#if MONOTOUCH && FULL_AOT_RUNTIME
using Crimson.CommonCrypto;
#endif
namespace System {
[Serializable]
[StructLayout (LayoutKind.Sequential)]
[ComVisible (true)]
public struct Guid : IFormattable, IComparable, IComparable<Guid>, IEquatable<Guid> {
#if MONOTOUCH
static Guid () {
if (MonoTouchAOTHelper.FalseFlag) {
var comparer = new System.Collections.Generic.GenericComparer <Guid> ();
var eqcomparer = new System.Collections.Generic.GenericEqualityComparer <Guid> ();
}
}
#endif
private int _a; //_timeLow;
private short _b; //_timeMid;
private short _c; //_timeHighAndVersion;
private byte _d; //_clockSeqHiAndReserved;
private byte _e; //_clockSeqLow;
private byte _f; //_node0;
private byte _g; //_node1;
private byte _h; //_node2;
private byte _i; //_node3;
private byte _j; //_node4;
private byte _k; //_node5;
enum Format {
N, // 00000000000000000000000000000000
D, // 00000000-0000-0000-0000-000000000000
B, // {00000000-0000-0000-0000-000000000000}
P, // (00000000-0000-0000-0000-000000000000)
X, // {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
}
struct GuidParser
{
private string _src;
private int _length;
private int _cur;
public GuidParser (string src)
{
_src = src.Trim ();
_cur = 0;
_length = _src.Length;
}
void Reset ()
{
_cur = 0;
_length = _src.Length;
}
bool Eof {
get { return _cur >= _length; }
}
public static bool HasHyphen (Format format)
{
switch (format) {
case Format.D:
case Format.B:
case Format.P:
return true;
default:
return false;
}
}
bool TryParseNDBP (Format format, out Guid guid)
{
ulong a, b, c;
guid = new Guid ();
if (format == Format.B && !ParseChar ('{'))
return false;
if (format == Format.P && !ParseChar ('('))
return false;
if (!ParseHex (8, true, out a))
return false;
var has_hyphen = HasHyphen (format);
if (has_hyphen && !ParseChar ('-'))
return false;
if (!ParseHex (4, true, out b))
return false;
if (has_hyphen && !ParseChar ('-'))
return false;
if (!ParseHex (4, true, out c))
return false;
if (has_hyphen && !ParseChar ('-'))
return false;
var d = new byte [8];
for (int i = 0; i < d.Length; i++) {
ulong dd;
if (!ParseHex (2, true, out dd))
return false;
if (i == 1 && has_hyphen && !ParseChar ('-'))
return false;
d [i] = (byte) dd;
}
if (format == Format.B && !ParseChar ('}'))
return false;
if (format == Format.P && !ParseChar (')'))
return false;
if (!Eof)
return false;
guid = new Guid ((int) a, (short) b, (short) c, d);
return true;
}
bool TryParseX (out Guid guid)
{
ulong a, b, c;
guid = new Guid ();
if (!(ParseChar ('{')
&& ParseHexPrefix ()
&& ParseHex (8, false, out a)
&& ParseCharWithWhiteSpaces (',')
&& ParseHexPrefix ()
&& ParseHex (4, false, out b)
&& ParseCharWithWhiteSpaces (',')
&& ParseHexPrefix ()
&& ParseHex (4, false, out c)
&& ParseCharWithWhiteSpaces (',')
&& ParseCharWithWhiteSpaces ('{'))) {
return false;
}
var d = new byte [8];
for (int i = 0; i < d.Length; ++i) {
ulong dd;
if (!(ParseHexPrefix () && ParseHex (2, false, out dd)))
return false;
d [i] = (byte) dd;
if (i != 7 && !ParseCharWithWhiteSpaces (','))
return false;
}
if (!(ParseCharWithWhiteSpaces ('}') && ParseCharWithWhiteSpaces ('}')))
return false;
if (!Eof)
return false;
guid = new Guid ((int) a, (short) b, (short) c, d);
return true;
}
bool ParseHexPrefix ()
{
// It can be prefixed with whitespaces
for (; _cur < _length - 1; ++_cur) {
var ch = _src [_cur];
if (ch == '0') {
++_cur;
return _src [_cur++] == 'x';
}
if (!char.IsWhiteSpace (ch))
break;
}
return false;
}
bool ParseCharWithWhiteSpaces (char c)
{
while (!Eof) {
var ch = _src [_cur++];
if (ch == c)
return true;
if (!char.IsWhiteSpace (ch))
break;
}
return false;
}
bool ParseChar (char c)
{
if (!Eof && _src [_cur] == c) {
_cur++;
return true;
}
return false;
}
bool ParseHex (int length, bool strict, out ulong res)
{
res = 0;
for (int i = 0; i < length; i++) {
if (Eof)
return !(strict && (i + 1 != length));
char c = _src [_cur];
if (Char.IsDigit (c)) {
res = res * 16 + c - '0';
_cur++;
continue;
}
if (c >= 'a' && c <= 'f') {
res = res * 16 + c - 'a' + 10;
_cur++;
continue;
}
if (c >= 'A' && c <= 'F') {
res = res * 16 + c - 'A' + 10;
_cur++;
continue;
}
if (!strict)
return true;
return false; //!(strict && (i + 1 != length));
}
return true;
}
public bool Parse (Format format, out Guid guid)
{
if (format == Format.X)
return TryParseX (out guid);
return TryParseNDBP (format, out guid);
}
public bool Parse (out Guid guid)
{
switch (_length) {
case 32:
if (TryParseNDBP (Format.N, out guid))
return true;
break;
case 36:
if (TryParseNDBP (Format.D, out guid))
return true;
break;
case 38:
switch (_src [0]) {
case '{':
if (TryParseNDBP (Format.B, out guid))
return true;
break;
case '(':
if (TryParseNDBP (Format.P, out guid))
return true;
break;
}
break;
}
Reset ();
return TryParseX (out guid);
}
}
private static void CheckNull (object o)
{
if (o == null) {
throw new ArgumentNullException (Locale.GetText ("Value cannot be null."));
}
}
private static void CheckLength (byte[] o, int l)
{
if (o . Length != l) {
throw new ArgumentException (String.Format (Locale.GetText ("Array should be exactly {0} bytes long."), l));
}
}
private static void CheckArray (byte[] o, int l)
{
CheckNull (o);
CheckLength (o, l);
}
public Guid (byte[] b)
{
CheckArray (b, 16);
_a = Mono.Security.BitConverterLE.ToInt32 (b, 0);
_b = Mono.Security.BitConverterLE.ToInt16 (b, 4);
_c = Mono.Security.BitConverterLE.ToInt16 (b, 6);
_d = b [8];
_e = b [9];
_f = b [10];
_g = b [11];
_h = b [12];
_i = b [13];
_j = b [14];
_k = b [15];
}
public Guid (string g)
{
CheckNull (g);
Guid guid;
if (!new GuidParser (g).Parse (out guid))
throw CreateFormatException (g);
this = guid;
}
static Exception CreateFormatException (string s)
{
return new FormatException (string.Format ("Invalid Guid format: {0}", s));
}
public Guid (int a, short b, short c, byte[] d)
{
CheckArray (d, 8);
_a = (int) a;
_b = (short) b;
_c = (short) c;
_d = d [0];
_e = d [1];
_f = d [2];
_g = d [3];
_h = d [4];
_i = d [5];
_j = d [6];
_k = d [7];
}
public Guid (int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k)
{
_a = a;
_b = b;
_c = c;
_d = d;
_e = e;
_f = f;
_g = g;
_h = h;
_i = i;
_j = j;
_k = k;
}
[CLSCompliant (false)]
public Guid (uint a, ushort b, ushort c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k)
: this((int) a, (short) b, (short) c, d, e, f, g, h, i, j, k)
{
}
public static readonly Guid Empty = new Guid (0,0,0,0,0,0,0,0,0,0,0);
private static int Compare (int x, int y)
{
return ((uint)x < (uint)y) ? -1 : 1;
}
public int CompareTo (object value)
{
if (value == null)
return 1;
if (!(value is Guid)) {
throw new ArgumentException ("value", Locale.GetText (
"Argument of System.Guid.CompareTo should be a Guid."));
}
return CompareTo ((Guid)value);
}
public override bool Equals (object o)
{
if (o is Guid)
return CompareTo ((Guid)o) == 0;
return false;
}
public int CompareTo (Guid value)
{
if (_a != value._a) {
return Compare (_a, value._a);
}
if (_b != value._b) {
return Compare (_b, value._b);
}
if (_c != value._c) {
return Compare (_c, value._c);
}
if (_d != value._d) {
return Compare (_d, value._d);
}
if (_e != value._e) {
return Compare (_e, value._e);
}
if (_f != value._f) {
return Compare (_f, value._f);
}
if (_g != value._g) {
return Compare (_g, value._g);
}
if (_h != value._h) {
return Compare (_h, value._h);
}
if (_i != value._i) {
return Compare (_i, value._i);
}
if (_j != value._j) {
return Compare (_j, value._j);
}
if (_k != value._k) {
return Compare (_k, value._k);
}
return 0;
}
public bool Equals (Guid g)
{
return CompareTo (g) == 0;
}
public override int GetHashCode ()
{
int res;
res = (int) _a;
res = res ^ ((int) _b << 16 | _c);
res = res ^ ((int) _d << 24);
res = res ^ ((int) _e << 16);
res = res ^ ((int) _f << 8);
res = res ^ ((int) _g);
res = res ^ ((int) _h << 24);
res = res ^ ((int) _i << 16);
res = res ^ ((int) _j << 8);
res = res ^ ((int) _k);
return res;
}
private static char ToHex (int b)
{
return (char)((b<0xA)?('0' + b):('a' + b - 0xA));
}
#if !FULL_AOT_RUNTIME
using System.Security.Cryptography;
namespace System
{
partial struct Guid
{
private static object _rngAccess = new object ();
private static RandomNumberGenerator _rng;
private static RandomNumberGenerator _fastRng;
#endif
#if FULL_AOT_RUNTIME && !MONOTOUCH
// NSA approved random generator.
static void LameRandom (byte [] b)
{
var r = new Random ();
r.NextBytes (b);
}
#endif
// generated as per section 3.4 of the specification
public static Guid NewGuid ()
{
byte[] b = new byte [16];
#if !FULL_AOT_RUNTIME
// thread-safe access to the prng
lock (_rngAccess) {
if (_rng == null)
_rng = RandomNumberGenerator.Create ();
_rng.GetBytes (b);
}
#elif MONOTOUCH
Cryptor.GetRandom (b);
#else
LameRandom (b);
#endif
Guid res = new Guid (b);
// Mask in Variant 1-0 in Bit[7..6]
@@ -547,7 +62,6 @@ namespace System {
return res;
}
#if !FULL_AOT_RUNTIME
// used in ModuleBuilder so mcs doesn't need to invoke
// CryptoConfig for simple assemblies.
internal static byte[] FastNewGuidArray ()
@@ -572,258 +86,7 @@ namespace System {
return guid;
}
#endif
public byte[] ToByteArray ()
{
byte[] res = new byte[16];
byte[] tmp;
int d = 0;
int s;
tmp = Mono.Security.BitConverterLE.GetBytes(_a);
for (s=0; s<4; ++s) {
res[d++] = tmp[s];
}
tmp = Mono.Security.BitConverterLE.GetBytes(_b);
for (s=0; s<2; ++s) {
res[d++] = tmp[s];
}
tmp = Mono.Security.BitConverterLE.GetBytes(_c);
for (s=0; s<2; ++s) {
res[d++] = tmp[s];
}
res[8] = _d;
res[9] = _e;
res[10] = _f;
res[11] = _g;
res[12] = _h;
res[13] = _i;
res[14] = _j;
res[15] = _k;
return res;
}
static void AppendInt (StringBuilder builder, int value) {
builder.Append (ToHex ((value >> 28) & 0xf));
builder.Append (ToHex ((value >> 24) & 0xf));
builder.Append (ToHex ((value >> 20) & 0xf));
builder.Append (ToHex ((value >> 16) & 0xf));
builder.Append (ToHex ((value >> 12) & 0xf));
builder.Append (ToHex ((value >> 8) & 0xf));
builder.Append (ToHex ((value >> 4) & 0xf));
builder.Append (ToHex (value & 0xf));
}
static void AppendShort (StringBuilder builder, short value) {
builder.Append (ToHex ((value >> 12) & 0xf));
builder.Append (ToHex ((value >> 8) & 0xf));
builder.Append (ToHex ((value >> 4) & 0xf));
builder.Append (ToHex (value & 0xf));
}
static void AppendByte (StringBuilder builder, byte value) {
builder.Append (ToHex ((value >> 4) & 0xf));
builder.Append (ToHex (value & 0xf));
}
string ToString (Format format)
{
int length;
switch (format) {
case Format.B:
case Format.P:
length = 38;
break;
case Format.D:
length = 36;
break;
case Format.N:
length = 32;
break;
case Format.X:
length = 68;
break;
default:
throw new NotImplementedException (format.ToString ());
}
StringBuilder res = new StringBuilder (length);
bool has_hyphen = GuidParser.HasHyphen (format);
if (format == Format.P) {
res.Append ('(');
} else if (format == Format.B) {
res.Append ('{');
} else if (format == Format.X) {
res.Append ('{').Append ('0').Append ('x');
}
AppendInt (res, _a);
if (has_hyphen) {
res.Append ('-');
} else if (format == Format.X) {
res.Append (',').Append ('0').Append ('x');
}
AppendShort (res, _b);
if (has_hyphen) {
res.Append ('-');
} else if (format == Format.X) {
res.Append (',').Append ('0').Append ('x');
}
AppendShort (res, _c);
if (has_hyphen) {
res.Append ('-');
}
if (format == Format.X) {
res.Append (',').Append ('{').Append ('0').Append ('x');
AppendByte (res, _d);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _e);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _f);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _g);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _h);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _i);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _j);
res.Append (',').Append ('0').Append ('x');
AppendByte (res, _k);
res.Append ('}').Append ('}');;
} else {
AppendByte (res, _d);
AppendByte (res, _e);
if (has_hyphen) {
res.Append ('-');
}
AppendByte (res, _f);
AppendByte (res, _g);
AppendByte (res, _h);
AppendByte (res, _i);
AppendByte (res, _j);
AppendByte (res, _k);
if (format == Format.P) {
res.Append (')');
} else if (format == Format.B) {
res.Append ('}');
}
}
return res.ToString ();
}
public override string ToString ()
{
return ToString (Format.D);
}
public string ToString (string format)
{
return ToString (ParseFormat (format));
}
// provider value is never used
public string ToString (string format, IFormatProvider provider)
{
return ToString (format);
}
public static bool operator == (Guid a, Guid b)
{
return a.Equals(b);
}
public static bool operator != (Guid a, Guid b)
{
return !( a.Equals (b) );
}
public static Guid Parse (string input)
{
if (input == null)
throw new ArgumentNullException ("input");
Guid guid;
if (!TryParse (input, out guid))
throw CreateFormatException (input);
return guid;
}
public static Guid ParseExact (string input, string format)
{
if (input == null)
throw new ArgumentNullException ("input");
if (format == null)
throw new ArgumentNullException ("format");
Guid guid;
if (!TryParseExact (input, format, out guid))
throw CreateFormatException (input);
return guid;
}
public static bool TryParse (string input, out Guid result)
{
if (input == null) {
result = Empty;
return false;
}
var parser = new GuidParser (input);
return parser.Parse (out result);
}
public static bool TryParseExact (string input, string format, out Guid result)
{
if (input == null || format == null) {
result = Empty;
return false;
}
var parser = new GuidParser (input);
return parser.Parse (ParseFormat (format), out result);
}
static Format ParseFormat (string format)
{
if (string.IsNullOrEmpty (format))
return Format.D;
switch (format [0]) {
case 'N':
case 'n':
return Format.N;
case 'D':
case 'd':
return Format.D;
case 'B':
case 'b':
return Format.B;
case 'P':
case 'p':
return Format.P;
case 'X':
case 'x':
return Format.X;
}
throw new FormatException (
"Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\", \"b\", \"X\" or \"x\""
);
}
}
}
#endif
@@ -1,69 +0,0 @@
//
// System.MethodAccessException.cs
//
// Authors:
// Duncan Mak ([email protected])
// Andreas Nahr ([email protected])
//
// 2002 (C) 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.
//
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
namespace System
{
[Serializable]
[ComVisible (true)]
public class MethodAccessException : MemberAccessException
{
const int Result = unchecked ((int)0x80131510);
// Constructors
public MethodAccessException ()
: base (Locale.GetText ("Attempt to access a private/protected method failed."))
{
HResult = Result;
}
public MethodAccessException (string message)
: base (message)
{
HResult = Result;
}
protected MethodAccessException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public MethodAccessException (string message, Exception inner)
:base (message, inner)
{
HResult = Result;
}
}
}
@@ -1,37 +0,0 @@
//
// System.MidpointRounding.cs
//
// Copyright (C) 2004-2005 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.
//
using System.Runtime.InteropServices;
namespace System
{
[ComVisible (true)]
public enum MidpointRounding
{
ToEven = 0,
AwayFromZero = 1
}
}
@@ -1,85 +0,0 @@
//
// System.MissingFieldException.cs
//
// Authors:
// Duncan Mak ([email protected])
// Andreas Nahr ([email protected])
//
// 2002 (C) 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.
//
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
namespace System
{
[Serializable]
[ComVisible (true)]
public class MissingFieldException : MissingMemberException
{
const int Result = unchecked ((int)0x80131511);
// Constructors
public MissingFieldException ()
: base (Locale.GetText ("Cannot find requested field."))
{
HResult = Result;
}
public MissingFieldException (string message)
: base (message)
{
HResult = Result;
}
protected MissingFieldException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public MissingFieldException (string message, Exception inner)
: base (message, inner)
{
HResult = Result;
}
public MissingFieldException (string className, string fieldName)
: base (className, fieldName)
{
HResult = Result;
}
public override string Message {
get {
if (ClassName == null)
return base.Message;
String msg = Locale.GetText ("Field '{0}.{1}' not found.");
return String.Format (msg, ClassName, MemberName);
}
}
}
}
@@ -1,102 +0,0 @@
//
// System.MissingMemberException.cs
//
// Authors:
// Duncan Mak ([email protected])
// Andreas Nahr ([email protected])
//
// (C) 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.
//
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
namespace System
{
[Serializable]
[ComVisible (true)]
public class MissingMemberException : MemberAccessException
{
const int Result = unchecked ((int)0x80131512);
// Fields
protected string ClassName;
protected string MemberName;
protected byte[] Signature;
public MissingMemberException ()
: base (Locale.GetText ("Cannot find the requested class member."))
{
HResult = Result;
}
public MissingMemberException (string message)
: base (message)
{
HResult = Result;
}
public MissingMemberException (string message, Exception inner)
: base (message, inner)
{
HResult = Result;
}
protected MissingMemberException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
ClassName = info.GetString ("MMClassName");
MemberName = info.GetString ("MMMemberName");
Signature = (byte[]) info.GetValue ("MMSignature", typeof(byte[]));
}
public MissingMemberException (string className, string memberName)
{
ClassName = className;
MemberName = memberName;
HResult = Result;
}
// Methods
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
info.AddValue ("MMClassName", ClassName);
info.AddValue ("MMMemberName", MemberName);
info.AddValue ("MMSignature", Signature);
}
public override string Message {
get {
if (ClassName == null)
return base.Message;
String msg = Locale.GetText ("Member {0}.{1} not found.");
return String.Format (msg, ClassName, MemberName);
}
}
}
}
@@ -1,81 +0,0 @@
//
// System.MissingMethodException.cs
//
// Author:
// Andreas Nahr ([email protected])
//
//
// 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.Runtime.Serialization;
using System.Runtime.InteropServices;
namespace System
{
[Serializable]
[ComVisible (true)]
public class MissingMethodException : MissingMemberException
{
const int Result = unchecked ((int)0x80131513);
public MissingMethodException ()
: base (Locale.GetText ("Cannot find the requested method."))
{
HResult = Result;
}
public MissingMethodException (string message)
: base (message)
{
HResult = Result;
}
protected MissingMethodException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public MissingMethodException (string message, Exception inner)
: base (message, inner)
{
HResult = Result;
}
public MissingMethodException (string className, string methodName)
: base (className, methodName)
{
HResult = Result;
}
public override string Message {
get {
if (ClassName == null)
return base.Message;
String msg = Locale.GetText ("Method not found: '{0}.{1}'.");
return String.Format (msg, ClassName, MemberName);
}
}
}
}
+10 -1
View File
@@ -51,7 +51,16 @@ namespace System
abstract class RuntimeType : TypeInfo
{
internal RuntimeAssembly GetRuntimeAssembly ()
{
return (RuntimeAssembly) Assembly;
}
internal virtual bool IsSzArray {
get {
return IsArrayImpl () && GetArrayRank () == 1;
}
}
}
[Serializable]
@@ -656,7 +665,7 @@ namespace System
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
UnitySerializationHolder.GetTypeData (this, info, context);
UnitySerializationHolder.GetUnitySerializationInfo(info, this);
}
public override string ToString()
-146
View File
@@ -1,146 +0,0 @@
//
// System.Random.cs
//
// Authors:
// Bob Smith ([email protected])
// Ben Maurer ([email protected])
// Sebastien Pouliot <[email protected]>
//
// (C) 2001 Bob Smith. http://www.thestuff.net
// (C) 2003 Ben Maurer
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
// Copyright 2013 Xamarin Inc. (http://www.xamarin.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.Runtime.InteropServices;
namespace System
{
[Serializable]
[ComVisible (true)]
public class Random
{
uint x;
uint y;
uint z;
uint c;
public Random ()
: this (Environment.TickCount)
{
}
public Random (int Seed)
{
x = (uint) Seed;
y = (uint) 987654321;
z = (uint) 43219876;
c = (uint) 6543217;
}
uint JKiss ()
{
x = 314527869 * x + 1234567;
y ^= y << 5;
y ^= y >> 7;
y ^= y << 22;
ulong t = ((ulong) 4294584393 * z + c);
c = (uint) (t >> 32);
z = (uint) t;
return (x + y + z);
}
public virtual int Next (int minValue, int maxValue)
{
if (minValue > maxValue)
throw new ArgumentOutOfRangeException ("Maximum value is less than minimal value.");
// special case: a difference of one (or less) will always return the minimum
// e.g. -1,-1 or -1,0 will always return -1
uint diff = (uint) (maxValue - minValue);
if (diff <= 1)
return minValue;
return minValue + ((int) (JKiss () % diff));
}
public virtual int Next (int maxValue)
{
if (maxValue < 0)
throw new ArgumentOutOfRangeException ("Maximum value is less than minimal value.");
return maxValue > 0 ? (int)(JKiss () % maxValue) : 0;
}
public virtual int Next ()
{
// returns a non-negative, [0 - Int32.MacValue], random number
// but we want to avoid calls to Math.Abs (call cost and branching cost it requires)
// and the fact it would throw for Int32.MinValue (so roughly 1 time out of 2^32)
int random = (int) JKiss ();
while (random == Int32.MinValue)
random = (int) JKiss ();
int mask = random >> 31;
random ^= mask;
return random + (mask & 1);
}
public virtual void NextBytes (byte [] buffer)
{
if (buffer == null)
throw new ArgumentNullException ("buffer");
// each random `int` can fill 4 bytes
int p = 0;
uint random;
for (int i = 0; i < (buffer.Length >> 2); i++) {
random = JKiss ();
buffer [p++] = (byte) (random >> 24);
buffer [p++] = (byte) (random >> 16);
buffer [p++] = (byte) (random >> 8);
buffer [p++] = (byte) random;
}
if (p == buffer.Length)
return;
// complete the array
random = JKiss ();
while (p < buffer.Length) {
buffer [p++] = (byte) random;
random >>= 8;
}
}
public virtual double NextDouble ()
{
// return a double value between [0,1]
return Sample ();
}
protected virtual double Sample ()
{
// a single 32 bits random value is not enough to create a random double value
uint a = JKiss () >> 6; // Upper 26 bits
uint b = JKiss () >> 5; // Upper 27 bits
return (a * 134217728.0 + b) / 9007199254740992.0;
}
}
}
+47
View File
@@ -51,6 +51,7 @@ using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using Mono.Globalization.Unicode;
using System.Diagnostics.Contracts;
namespace System
{
@@ -3222,5 +3223,51 @@ namespace System
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static int GetLOSLimit ();
#region "from referencesource" // and actually we replaced some parts.
// Helper for encodings so they can talk to our buffer directly
// stringLength must be the exact size we'll expect
[System.Security.SecurityCritical] // auto-generated
unsafe static internal String CreateStringFromEncoding(
byte* bytes, int byteLength, Encoding encoding)
{
Contract.Requires(bytes != null);
Contract.Requires(byteLength >= 0);
// Get our string length
int stringLength = encoding.GetCharCount(bytes, byteLength, null);
Contract.Assert(stringLength >= 0, "stringLength >= 0");
// They gave us an empty string if they needed one
// 0 bytelength might be possible if there's something in an encoder
if (stringLength == 0)
return String.Empty;
String s = FastAllocateString(stringLength);
fixed(char* pTempChars = &s.start_char)
{
int doubleCheck = encoding.GetChars(bytes, byteLength, pTempChars, stringLength, null);
Contract.Assert(stringLength == doubleCheck,
"Expected encoding.GetChars to return same length as encoding.GetCharCount");
}
return s;
}
// our own implementation for CLR icall.
unsafe internal static int nativeCompareOrdinalIgnoreCaseWC (string name, sbyte *strBBytes)
{
for (int i = 0; i < name.Length; i++) {
sbyte b = *(strBBytes + i);
if (b < 0)
throw new ArgumentException ();
int ret = char.ToUpper ((char) b) - char.ToUpper (name [i]);
if (ret != 0)
return ret;
}
return 0;
}
#endregion
}
}
@@ -680,6 +680,13 @@ namespace System {
var isDst = zone.IsDaylightSavingTime (time.Value);
Console.WriteLine ("\tDate({0}): Offset({1}) IsDST({2})", time.Value, offset, isDst);
}
if (zone.transitions != null) {
Console.WriteLine ("Transitions for: {0}", path);
foreach (var transition in zone.transitions) {
Console.WriteLine ("\t Date({0}): {1}", transition.Key, transition.Value);
}
}
}
#endif
}
+10
View File
@@ -1618,6 +1618,16 @@ namespace System {
}
}
internal Type GetRootElementType()
{
Type rootElementType = this;
while (rootElementType.HasElementType)
rootElementType = rootElementType.GetElementType();
return rootElementType;
}
#if !MOBILE
void _Type.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
@@ -1,122 +0,0 @@
//
// System.UnitySerializationHolder.cs
//
// Author:
// Lluis Sanchez Gual ([email protected])
//
// (C) 2003 Lluis Sanchez Gual
//
// 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.Reflection;
using System.Runtime.Serialization;
namespace System
{
[Serializable]
internal class UnitySerializationHolder : IObjectReference, ISerializable
{
string _data;
UnityType _unityType;
string _assemblyName;
// FIXME: there must be other types that use UnitySerializationHolder for
// serialization, but I don't know yet which ones.
enum UnityType: byte
{
DBNull = 2,
Type = 4,
Module = 5,
Assembly = 6
}
UnitySerializationHolder (SerializationInfo info, StreamingContext ctx)
{
_data = info.GetString ("Data");
_unityType = (UnityType) info.GetInt32 ("UnityType");
_assemblyName = info.GetString ("AssemblyName");
}
public static void GetTypeData (Type instance, SerializationInfo info, StreamingContext ctx)
{
info.AddValue ("Data", instance.FullName);
info.AddValue ("UnityType", (int) UnityType.Type);
info.AddValue ("AssemblyName", instance.Assembly.FullName);
info.SetType (typeof (UnitySerializationHolder));
}
public static void GetDBNullData (DBNull instance, SerializationInfo info, StreamingContext ctx)
{
info.AddValue ("Data", null);
info.AddValue ("UnityType", (int) UnityType.DBNull);
info.AddValue ("AssemblyName", instance.GetType().Assembly.FullName);
info.SetType (typeof (UnitySerializationHolder));
}
public static void GetAssemblyData (Assembly instance, SerializationInfo info, StreamingContext ctx)
{
info.AddValue ("Data", instance.FullName);
info.AddValue ("UnityType", (int) UnityType.Assembly);
info.AddValue ("AssemblyName", instance.FullName);
info.SetType (typeof (UnitySerializationHolder));
}
public static void GetModuleData (Module instance, SerializationInfo info, StreamingContext ctx)
{
info.AddValue ("Data", instance.ScopeName);
info.AddValue ("UnityType", (int) UnityType.Module);
info.AddValue ("AssemblyName", instance.Assembly.FullName);
info.SetType (typeof (UnitySerializationHolder));
}
public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
{
// Not needed.
throw new NotSupportedException();
}
public virtual object GetRealObject (StreamingContext context)
{
switch (_unityType) {
case UnityType.Type: {
Assembly assembly = Assembly.Load (_assemblyName);
return assembly.GetType (_data);
}
case UnityType.DBNull:
return DBNull.Value;
case UnityType.Module: {
Assembly assembly = Assembly.Load (_assemblyName);
return assembly.GetModule (_data);
}
case UnityType.Assembly:
return Assembly.Load (_data);
default:
throw new NotSupportedException (Locale.GetText
("UnitySerializationHolder does not support this type."));
}
}
}
}
@@ -360,6 +360,32 @@ namespace MonoTests.System.Reflection.Emit
Assert.AreEqual ("Frub", mi.Name);
}
[Test]
public void GetMethodTokenCrossMethodBuilders ()
{
AssemblyBuilder ab = genAssembly ();
ModuleBuilder moduleb = ab.DefineDynamicModule ("foo.dll", "foo.dll");
TypeBuilder tb = moduleb.DefineType ("foo");
MethodBuilder mb = tb.DefineMethod("Frub", MethodAttributes.Static, null, new Type[] { typeof(IntPtr) });
int tok = mb.GetToken().Token;
mb.SetImplementationFlags(MethodImplAttributes.NoInlining);
ILGenerator ilgen = mb.GetILGenerator();
ilgen.Emit(OpCodes.Ret);
tb.CreateType ();
var mi = (MethodInfo) moduleb.ResolveMember (tok);
Assert.IsNotNull (mi);
ModuleBuilder moduleb2 = ab.DefineDynamicModule ("foo2.dll", "foo2.dll");
var tok2 = moduleb2.GetMethodToken (mi).Token;
MethodBase mi2 = moduleb.ResolveMethod (tok2);
Assert.IsNotNull (mi2);
Assert.AreEqual ("Frub", mi.Name);
}
[Test]
public void ResolveMemberField ()
{
@@ -0,0 +1,98 @@
// VisibilityTest.cs
//
//
// Author:
// Marius Ungureanu <[email protected]>
//
// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.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 !MONOTOUCH
using System;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MonoTests.System.Reflection.VisibilityTypes
{
[TestFixture]
public class VisibilityTests
{
[Test]
public void TestsExportedTypes ()
{
var types = typeof (VisibilityTests).Assembly.GetExportedTypes ();
// Test visibility means that the class is public by applying and on the 'public' visibility of the nested items.
CollectionAssert.DoesNotContain (types, typeof (InternalClass));
CollectionAssert.Contains (types, typeof (PublicClass));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+InternalNested", true));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+PrivateNested", true));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+ProtectedNested", true));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+PublicNested", true));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+InternalNested", true));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+PrivateNested", true));
CollectionAssert.DoesNotContain (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+ProtectedNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+PublicNested", true));
}
[Test]
public void TestsModuleTypes ()
{
var types = typeof (VisibilityTests).Module.GetTypes ();
// Test that all the types defined exist.
CollectionAssert.Contains (types, typeof (InternalClass));
CollectionAssert.Contains (types, typeof (PublicClass));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+InternalNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+PrivateNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+ProtectedNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+InternalClass+PublicNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+InternalNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+PrivateNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+ProtectedNested", true));
CollectionAssert.Contains (types, Type.GetType ("MonoTests.System.Reflection.VisibilityTypes.VisibilityTests+PublicClass+PublicNested", true));
}
class InternalClass
{
internal class InternalNested {}
private class PrivateNested {}
protected class ProtectedNested {}
public class PublicNested {}
}
public class PublicClass
{
internal class InternalNested {}
private class PrivateNested {}
protected class ProtectedNested {}
public class PublicNested {}
}
}
}
#endif
@@ -26,8 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_5
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -40,12 +38,15 @@ namespace MonoTests.System.Runtime.CompilerServices
[TestFixture]
public class AsyncTaskMethodBuilderTest
{
#if !MONOTOUCH
// For some reason MT excludes CallContext handling
[Test]
public void CallContextFlow ()
{
CallContext.LogicalSetData ("name0", "0");
Task.WhenAll (Work ("A"), Work ("B")).Wait ();
Assert.IsTrue (Task.WhenAll (Work ("A"), Work ("B")).Wait (4000), "#0");
Assert.IsNull (CallContext.LogicalGetData ("A"), "#A");
Assert.IsNull (CallContext.LogicalGetData ("B"), "#B");
}
@@ -60,7 +61,6 @@ namespace MonoTests.System.Runtime.CompilerServices
var found = CallContext.LogicalGetData ("name");
Assert.AreEqual (name, found, "#2" + name);
}
#endif
}
}
#endif
@@ -416,12 +416,14 @@ namespace MonoTests.System.Security.Cryptography {
[Test]
public void Invariants ()
{
var hmac = new HMACRIPEMD160 ();
Assert.IsTrue (hmac.CanReuseTransform, "HMACRIPEMD160.CanReuseTransform");
Assert.IsTrue (hmac.CanTransformMultipleBlocks, "HMACRIPEMD160.CanTransformMultipleBlocks");
Assert.AreEqual ("RIPEMD160", hmac.HashName, "HMACRIPEMD160.HashName");
Assert.AreEqual (160, hmac.HashSize, "HMACRIPEMD160.HashSize");
Assert.AreEqual (1, hmac.InputBlockSize, "HMACRIPEMD160.InputBlockSize");
Assert.AreEqual (1, hmac.OutputBlockSize, "HMACRIPEMD160.OutputBlockSize");
Assert.AreEqual (64, hmac.Key.Length, "HMACRIPEMD160.Key.Length");
Assert.AreEqual ("System.Security.Cryptography.HMACRIPEMD160", hmac.ToString (), "HMACRIPEMD160.ToString()");
}
@@ -88,6 +88,7 @@ public class HMACSHA1Test : KeyedHashAlgorithmTest {
Assert.AreEqual (160, algo.HashSize, "HMACSHA1.HashSize");
Assert.AreEqual (1, algo.InputBlockSize, "HMACSHA1.InputBlockSize");
Assert.AreEqual (1, algo.OutputBlockSize, "HMACSHA1.OutputBlockSize");
Assert.AreEqual (64, algo.Key.Length, "HMACSHA1.Key.Length");
Assert.AreEqual ("System.Security.Cryptography.HMACSHA1", algo.ToString (), "HMACSHA1.ToString()");
}
@@ -68,12 +68,14 @@ namespace MonoTests.System.Security.Cryptography {
[Test]
public void Invariants ()
{
var algo = new HMACSHA256 ();
Assert.IsTrue (algo.CanReuseTransform, "HMACSHA256.CanReuseTransform");
Assert.IsTrue (algo.CanTransformMultipleBlocks, "HMACSHA256.CanTransformMultipleBlocks");
Assert.AreEqual ("SHA256", algo.HashName, "HMACSHA256.HashName");
Assert.AreEqual (256, algo.HashSize, "HMACSHA256.HashSize");
Assert.AreEqual (1, algo.InputBlockSize, "HMACSHA256.InputBlockSize");
Assert.AreEqual (1, algo.OutputBlockSize, "HMACSHA256.OutputBlockSize");
Assert.AreEqual (64, algo.Key.Length, "HMACSHA256.Key.Length");
Assert.AreEqual ("System.Security.Cryptography.HMACSHA256", algo.ToString (), "HMACSHA256.ToString()");
}
@@ -89,6 +89,7 @@ namespace MonoTests.System.Security.Cryptography {
Assert.AreEqual (384, algo.HashSize, "HMACSHA384.HashSize");
Assert.AreEqual (1, algo.InputBlockSize, "HMACSHA384.InputBlockSize");
Assert.AreEqual (1, algo.OutputBlockSize, "HMACSHA384.OutputBlockSize");
Assert.AreEqual (128, algo.Key.Length, "HMACSHA384.Key.Length");
Assert.AreEqual ("System.Security.Cryptography.HMACSHA384", algo.ToString (), "HMACSHA384.ToString()");
}
@@ -88,6 +88,7 @@ namespace MonoTests.System.Security.Cryptography {
Assert.AreEqual (512, algo.HashSize, "HMACSHA512.HashSize");
Assert.AreEqual (1, algo.InputBlockSize, "HMACSHA512.InputBlockSize");
Assert.AreEqual (1, algo.OutputBlockSize, "HMACSHA512.OutputBlockSize");
Assert.AreEqual (128, algo.Key.Length, "HMACSHA512.Key.Length");
Assert.AreEqual ("System.Security.Cryptography.HMACSHA512", algo.ToString (), "HMACSHA512.ToString()");
}
@@ -253,7 +253,7 @@ namespace MonoTests.System.Text
var chars = new char[] { '9', '8', '7', '6', '5' };
var ret = enc.GetChars (bytes, 0, bytes.Length, chars, 0);
Assert.That (ret, Is.EqualTo (4), "ret"); // FIXME: Wrong it should be 2
Assert.That (ret, Is.EqualTo (2), "ret");
Assert.That (chars [0], Is.EqualTo ('0'), "chars[0]");
Assert.That (chars [1], Is.EqualTo ('1'), "chars[1]");
Assert.That (chars [2], Is.EqualTo ('7'), "chars[2]");
@@ -57,7 +57,7 @@ namespace MonoTests.System.Text
public void GetEncodingForAllInfo ()
{
foreach (EncodingInfo i in Encoding.GetEncodings ())
Assert.IsNotNull (i.GetEncoding (), "codepage " + i);
Assert.IsNotNull (i.GetEncoding (), "codepage " + i.CodePage);
}
void GetEncoding (int id, List<int> list) {
Loaded 100 of 222 files, more files were not shown because too many files have changed in this diff. Show more