From: Marek Safar Date: Sun, 24 Jun 2012 15:45:24 +0000 (-0700) Subject: Merge pull request #347 from JamesB7/master X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=3d43cfdfccc1aa699e599c39f91fb41231304da9;hp=074a90260c3b8b86444248703bc35bd0be6ae7cf;p=mono.git Merge pull request #347 from JamesB7/master .NET 4.5 .cctor crash fix for ComIStreamMarshaler --- diff --git a/configure.in b/configure.in index 06638c2a522..347142e94ce 100644 --- a/configure.in +++ b/configure.in @@ -418,7 +418,7 @@ AM_ICONV() AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes) -AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h) +AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h libproc.h) AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h) AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h], [], [], [#include @@ -1483,12 +1483,11 @@ if test x$target_win32 = xno; then exit (0); } + volatile char*__ptr = NULL; static void * loop (void *ignored) { - char *ptr = NULL; - - *ptr = 0; + *__ptr = 0; return NULL; } @@ -2019,6 +2018,8 @@ if test "x$try_shared_handles" != "xyes"; then AC_SUBST(DISABLE_SHARED_HANDLES) fi +AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes) + AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check']) AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes]) @@ -2612,7 +2613,8 @@ case "$host" in done if test "x$X11" = "xlibX11.so"; then - AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]); + AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? Assuming libX11.so.6...]); + X11=libX11.so.6 fi ;; esac @@ -2669,17 +2671,17 @@ fi AM_CONDITIONAL(MONO_DEBUGGER_SUPPORTED, test x$mono_debugger_supported = xyes) AC_MSG_RESULT($mono_debugger_supported) -AC_ARG_ENABLE(icall-symbol-map,[ --enable-icall-symbol-map Generate tables which map icall functions to their C symbols], icall_symbol_map=$enableval, icall_symbol_map=no) +AC_ARG_ENABLE(icall-symbol-map,[ --enable-icall-symbol-map Generate tables which map icall functions to their C symbols], icall_symbol_map=$enableval, icall_symbol_map=no) if test "x$icall_symbol_map" = "xyes"; then AC_DEFINE(ENABLE_ICALL_SYMBOL_MAP, 1, [Icall symbol map enabled]) fi -AC_ARG_ENABLE(icall-export,[ --enable-icall-export Export icall functions], icall_export=$enableval, icall_export=no) +AC_ARG_ENABLE(icall-export,[ --enable-icall-export Export icall functions], icall_export=$enableval, icall_export=no) if test "x$icall_export" = "xyes"; then AC_DEFINE(ENABLE_ICALL_EXPORT, 1, [Icall export enabled]) fi -AC_ARG_ENABLE(icall-tables,[ --disable-icall-tables Disable the runtime lookup of icalls], icall_tables=$enableval, icall_tables=yes) +AC_ARG_ENABLE(icall-tables,[ --disable-icall-tables Disable the runtime lookup of icalls], icall_tables=$enableval, icall_tables=yes) if test "x$icall_tables" = "xno"; then AC_DEFINE(DISABLE_ICALL_TABLES, 1, [Icall tables disabled]) fi @@ -2832,6 +2834,14 @@ AC_CHECK_HEADER([malloc.h], [AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1], [Define to 1 if you have /usr/include/malloc.h.])],,) +if test x"$GCC" = xyes; then + # Implicit function declarations are not 64 bit safe + # Do this late, since this causes lots of configure tests to fail + CFLAGS="$CFLAGS -Werror-implicit-function-declaration" + # jay has a lot of implicit declarations + JAY_CFLAGS="-Wno-implicit-function-declaration" +fi + # When --disable-shared is used, libtool transforms libmono-2.0.la into libmono-2.0.so # instead of libmono-static.a if test "x$enable_shared" = "xno"; then @@ -3185,6 +3195,7 @@ fi echo 'IL_FLAGS = /debug' >> $mcs_topdir/build/config.make echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $mcs_topdir/build/config.make echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $mcs_topdir/build/config.make + echo "JAY_CFLAGS = $JAY_CFLAGS" >> $mcs_topdir/build/config.make case $INSTALL in [[\\/$]]* | ?:[[\\/]]* ) mcs_INSTALL=$INSTALL ;; @@ -3232,6 +3243,10 @@ fi if test x$with_profile4 != xyes; then echo "DEFAULT_PROFILE = net_2_0" >> $srcdir/$mcsdir/build/config.make fi + + if test "x$test_bcl_opt" = "xyes"; then + echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make + fi fi diff --git a/eglib/src/gpath.c b/eglib/src/gpath.c index 4ae2f8f5e9e..14343494d80 100644 --- a/eglib/src/gpath.c +++ b/eglib/src/gpath.c @@ -88,6 +88,24 @@ g_build_path (const gchar *separator, const gchar *first_element, ...) return g_string_free (path, FALSE); } +static gchar* +strrchr_seperator (const gchar* filename) +{ +#ifdef G_OS_WIN32 + char *p2; +#endif + char *p; + + p = strrchr (filename, G_DIR_SEPARATOR); +#ifdef G_OS_WIN32 + p2 = strrchr (filename, '/'); + if (p2 > p) + p = p2; +#endif + + return p; +} + gchar * g_path_get_dirname (const gchar *filename) { @@ -95,7 +113,7 @@ g_path_get_dirname (const gchar *filename) size_t count; g_return_val_if_fail (filename != NULL, NULL); - p = strrchr (filename, G_DIR_SEPARATOR); + p = strrchr_seperator (filename); if (p == NULL) return g_strdup ("."); if (p == filename) @@ -119,7 +137,7 @@ g_path_get_basename (const char *filename) return g_strdup ("."); /* No separator -> filename */ - r = strrchr (filename, G_DIR_SEPARATOR); + r = strrchr_seperator (filename); if (r == NULL) return g_strdup (filename); @@ -127,7 +145,7 @@ g_path_get_basename (const char *filename) if (r [1] == 0){ char *copy = g_strdup (filename); copy [r-filename] = 0; - r = strrchr (copy, G_DIR_SEPARATOR); + r = strrchr_seperator (copy); if (r == NULL){ g_free (copy); diff --git a/eglib/test/path.c b/eglib/test/path.c index aa13ece6f77..e3832a04be4 100644 --- a/eglib/test/path.c +++ b/eglib/test/path.c @@ -129,15 +129,16 @@ test_buildfname () return FAILED ("1 Got wrong result, got: %s", s); g_free (s); - s = g_build_filename ("/", "a", NULL); #ifdef G_OS_WIN32 - if (strcmp (s, "\\a") != 0) + s = g_build_filename ("C:\\", "a", NULL); + if (strcmp (s, "C:\\a") != 0) #else + s = g_build_filename ("/", "a", NULL); if (strcmp (s, "/a") != 0) #endif return FAILED ("1 Got wrong result, got: %s", s); -#ifndef OS_WIN32 +#ifndef G_OS_WIN32 s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL); if (strcmp (s, "/foo/bar/tolo/meo/") != 0) return FAILED ("1 Got wrong result, got: %s", s); @@ -157,6 +158,11 @@ test_dirname () return FAILED ("Expected c:\\home, got %s", s); g_free (s); + s = g_path_get_dirname ("c:/home/miguel"); + if (strcmp (s, "c:/home") != 0) + return FAILED ("Expected c:/home, got %s", s); + g_free (s); + s = g_path_get_dirname ("c:\\home\\dingus\\"); if (strcmp (s, "c:\\home\\dingus") != 0) return FAILED ("Expected c:\\home\\dingus, got %s", s); @@ -209,10 +215,20 @@ test_basename () return FAILED ("1 Expected dingus, got %s", s); g_free (s); + s = g_path_get_basename ("c:/home/dingus/"); + if (strcmp (s, "dingus") != 0) + return FAILED ("1 Expected dingus, got %s", s); + g_free (s); + s = g_path_get_basename ("c:\\home\\dingus"); if (strcmp (s, "dingus") != 0) return FAILED ("2 Expected dingus, got %s", s); g_free (s); + + s = g_path_get_basename ("c:/home/dingus"); + if (strcmp (s, "dingus") != 0) + return FAILED ("2 Expected dingus, got %s", s); + g_free (s); #else s = g_path_get_basename (""); if (strcmp (s, ".") != 0) diff --git a/eglib/test/string-util.c b/eglib/test/string-util.c index 3dbd738aba7..6c8b8892e94 100644 --- a/eglib/test/string-util.c +++ b/eglib/test/string-util.c @@ -414,6 +414,8 @@ test_strstrip () RESULT test_filename_to_uri () { +#ifdef G_OS_WIN32 +#else char *s; urit ("/a", "file:///a"); @@ -432,6 +434,7 @@ test_filename_to_uri () urit ("/@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "file:///@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); errit ("a"); errit ("./hola"); +#endif return OK; } @@ -443,6 +446,8 @@ test_filename_to_uri () RESULT test_filename_from_uri () { +#ifdef G_OS_WIN32 +#else char *s; fileit ("file:///a", "/a"); @@ -456,6 +461,7 @@ test_filename_from_uri () ferrit ("file:///%"); ferrit ("file:///%0"); ferrit ("file:///%jj"); +#endif return OK; } diff --git a/libgc/configure.in b/libgc/configure.in index f4b43792912..97d548f03a4 100644 --- a/libgc/configure.in +++ b/libgc/configure.in @@ -122,6 +122,7 @@ case "$THREADS" in else THREADDLLIBS="$PTHREAD_LIBS" fi + AC_DEFINE(THREAD_LOCAL_ALLOC) ;; *-*-solaris*) AC_DEFINE(GC_SOLARIS_THREADS) diff --git a/libgc/darwin_stop_world.c b/libgc/darwin_stop_world.c index 516b12c94c0..a1051f5ac4e 100644 --- a/libgc/darwin_stop_world.c +++ b/libgc/darwin_stop_world.c @@ -79,7 +79,7 @@ void GC_push_all_stacks() { kern_return_t r; GC_thread p; pthread_t me; - ptr_t lo, hi; + ptr_t lo, hi, altstack_lo, altstack_hi; #if defined(POWERPC) ppc_thread_state_t state; mach_msg_type_number_t thread_state_count = PPC_THREAD_STATE_COUNT; @@ -252,6 +252,16 @@ void GC_push_all_stacks() { hi = GC_stackbottom; else hi = p->stack_end; + + if (p->altstack && lo >= p->altstack && lo <= p->altstack + p->altstack_size) { + altstack_lo = lo; + altstack_hi = p->altstack + p->altstack_size; + lo = (char*)p->stack; + hi = (char*)p->stack + p->stack_size; + } else { + altstack_lo = NULL; + } + #if DEBUG_THREADS GC_printf3("Darwin: Stack for thread 0x%lx = [%lx,%lx)\n", (unsigned long) p -> id, @@ -259,7 +269,10 @@ void GC_push_all_stacks() { (unsigned long) hi ); #endif - GC_push_all_stack(lo,hi); + if (lo) + GC_push_all_stack(lo,hi); + if (altstack_lo) + GC_push_all_stack(altstack_lo,altstack_hi); } /* for(p=GC_threads[i]...) */ } /* for(i=0;ialtstack && lo >= p->altstack && lo <= p->altstack + p->altstack_size) + hi = p->altstack + p->altstack_size; + /* FIXME: Need to scan the normal stack too, but how ? */ + # ifdef STACK_GROWS_UP /* We got them backwards! */ GC_push_all_stack(hi, lo); diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 4b3d825fbc7..75c9009d0f1 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -69,6 +69,7 @@ # if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \ defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) || \ defined(GC_NETBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC) || \ + defined(GC_FREEBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC) || \ defined(GC_OPENBSD_THREADS) # define USE_PTHREAD_SPECIFIC # endif @@ -215,6 +216,10 @@ static int GC_setspecific (GC_key_t key, void *value) { static GC_bool keys_initialized; +static pthread_t main_pthread_self; +static void *main_stack, *main_altstack; +static int main_stack_size, main_altstack_size; + #ifdef MONO_DEBUGGER_SUPPORTED #include "include/libgc-mono-debugger.h" #endif @@ -848,6 +853,30 @@ int GC_thread_is_registered (void) return ptr ? 1 : 0; } +void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size) +{ + GC_thread thread; + + LOCK(); + thread = (void *)GC_lookup_thread(pthread_self()); + if (thread) { + thread->stack = stack; + thread->stack_size = stack_size; + thread->altstack = altstack; + thread->altstack_size = altstack_size; + } else { + /* + * This happens if we are called before GC_thr_init (). + */ + main_pthread_self = pthread_self (); + main_stack = stack; + main_stack_size = stack_size; + main_altstack = altstack; + main_altstack_size = altstack_size; + } + UNLOCK(); +} + #ifdef HANDLE_FORK /* Remove all entries from the GC_threads table, except the */ /* one for the current thread. We need to do this in the child */ @@ -1083,6 +1112,12 @@ void GC_thr_init() gc_thread_vtable->thread_created (pthread_self (), &t->stop_info.stack_ptr); # endif #endif + if (pthread_self () == main_pthread_self) { + t->stack = main_stack; + t->stack_size = main_stack_size; + t->altstack = main_altstack; + t->altstack_size = main_altstack_size; + } GC_stop_init(); diff --git a/libgc/solaris_threads.c b/libgc/solaris_threads.c index a0321b157e4..8ca8fa3b3a2 100644 --- a/libgc/solaris_threads.c +++ b/libgc/solaris_threads.c @@ -648,6 +648,10 @@ int GC_thread_register_foreign (void *base_addr) return 0; } +void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size) +{ +} + /* Solaris 2/Intel uses an initial stack size limit slightly bigger than the SPARC default of 8 MB. Account for this to warn only if the user has raised the limit beyond the default. diff --git a/libgc/win32_threads.c b/libgc/win32_threads.c index 9662eb186ce..a60363b4d6f 100644 --- a/libgc/win32_threads.c +++ b/libgc/win32_threads.c @@ -85,6 +85,10 @@ int GC_thread_is_registered (void) #endif } +void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size) +{ +} + /* * This may be called from DllMain, and hence operates under unusual * constraints. diff --git a/mcs/CodingStyle b/mcs/CodingStyle index aa78389f7b7..6a3528e7c6a 100644 --- a/mcs/CodingStyle +++ b/mcs/CodingStyle @@ -35,15 +35,6 @@ a MonoTODO, this will be useful in the future for our automated tools that can assist in developers porting their code. -* Supporting .NET 1.2, .NET 1.1 and .NET 1.0 builds - - The defines NET_1_1 and NET_2_0 are used to include - features. When NET_2_0 is defined, it also implies that the - NET_1_1 is defined. - - To have code which is only available in an old version, use ONLY_1_0, - ONLY_1_1 - * Tagging buggy code If there is a bug in your implementation tag the problem by using diff --git a/mcs/build/platforms/darwin.make b/mcs/build/platforms/darwin.make index 266d5c807ed..de94a445eb8 100644 --- a/mcs/build/platforms/darwin.make +++ b/mcs/build/platforms/darwin.make @@ -4,7 +4,7 @@ # PLATFORM_DEBUG_FLAGS = -debug -PLATFORM_MCS_FLAGS = -optimize +PLATFORM_MCS_FLAGS = PLATFORM_RUNTIME = $(RUNTIME) PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac, diff --git a/mcs/build/platforms/linux.make b/mcs/build/platforms/linux.make index 8149f09b0a0..a70984716ee 100644 --- a/mcs/build/platforms/linux.make +++ b/mcs/build/platforms/linux.make @@ -4,7 +4,7 @@ # PLATFORM_DEBUG_FLAGS = -debug -PLATFORM_MCS_FLAGS = -optimize +PLATFORM_MCS_FLAGS = PLATFORM_RUNTIME = $(RUNTIME) PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = diff --git a/mcs/build/platforms/win32.make b/mcs/build/platforms/win32.make index b71633d9803..3a98d99a4a9 100644 --- a/mcs/build/platforms/win32.make +++ b/mcs/build/platforms/win32.make @@ -4,7 +4,7 @@ # PLATFORM_DEBUG_FLAGS = /debug+ /debug:full -PLATFORM_MCS_FLAGS = /nologo /optimize +PLATFORM_MCS_FLAGS = /nologo PLATFORM_RUNTIME = PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = diff --git a/mcs/build/rules.make b/mcs/build/rules.make index b96a8ca24cc..d1d2832be4d 100644 --- a/mcs/build/rules.make +++ b/mcs/build/rules.make @@ -109,6 +109,10 @@ endif include $(topdir)/build/profiles/$(PROFILE).make -include $(topdir)/build/config.make +ifdef BCL_OPTIMIZE +PROFILE_MCS_FLAGS += -optimize +endif + ifdef OVERRIDE_TARGET_ALL all: all.override else diff --git a/mcs/build/tests.make b/mcs/build/tests.make index 8e8bb22b728..1d2a512447d 100644 --- a/mcs/build/tests.make +++ b/mcs/build/tests.make @@ -93,7 +93,7 @@ run-test-ondotnet-lib: test-local ok=:; \ $(TEST_HARNESS) $(test_assemblies) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) $(TEST_HARNESS_OUTPUT_ONDOTNET) -xml=TestResult-ondotnet-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) || ok=false; \ $(TEST_HARNESS_POSTPROC_ONDOTNET) ; $$ok - + endif # test_assemblies diff --git a/mcs/class/Accessibility/Assembly/AssemblyInfo.cs b/mcs/class/Accessibility/Assembly/AssemblyInfo.cs index ae046c851ad..82a24e7fa83 100644 --- a/mcs/class/Accessibility/Assembly/AssemblyInfo.cs +++ b/mcs/class/Accessibility/Assembly/AssemblyInfo.cs @@ -62,17 +62,7 @@ using System.Runtime.InteropServices; [assembly: ImportedFromTypeLib ("Accessibility")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: TypeLibVersion (1, 1)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] - [assembly: ComCompatibleVersion (1, 0, 3300, 0)] - [assembly: TypeLibVersion (1, 10)] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: TypeLibVersion (1, 1)] +[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/Cscompmgd/Assembly/AssemblyInfo.cs b/mcs/class/Cscompmgd/Assembly/AssemblyInfo.cs index 65bb82d8b51..454b5aee2b4 100644 --- a/mcs/class/Cscompmgd/Assembly/AssemblyInfo.cs +++ b/mcs/class/Cscompmgd/Assembly/AssemblyInfo.cs @@ -49,20 +49,14 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile ("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyTitle ("cscompmgd.dll")] - [assembly: AssemblyDefaultAlias ("cscompmgd.dll")] - [assembly: AssemblyDescription ("cscompmgd.dll")] - [assembly: AssemblyCompany (Consts.MonoCompany)] - [assembly: AssemblyProduct (Consts.MonoProduct)] - [assembly: AssemblyCopyright (Consts.MonoCopyright)] - [assembly: SatelliteContractVersion (Consts.VsVersion)] - [assembly: AssemblyInformationalVersion (Consts.VsFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: NeutralResourcesLanguage ("en-US")] - [assembly: ReliabilityContract (Consistency.MayCorruptProcess, Cer.None)] -#elif (NET_1_1 || NET_1_0) - [assembly: AssemblyDescription ("Managed interface for C# compiler")] - [assembly: AssemblyTitle ("Managed C# Compiler")] -#endif +[assembly: AssemblyTitle ("cscompmgd.dll")] +[assembly: AssemblyDefaultAlias ("cscompmgd.dll")] +[assembly: AssemblyDescription ("cscompmgd.dll")] +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: SatelliteContractVersion (Consts.VsVersion)] +[assembly: AssemblyInformationalVersion (Consts.VsFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] +[assembly: NeutralResourcesLanguage ("en-US")] +[assembly: ReliabilityContract (Consistency.MayCorruptProcess, Cer.None)] diff --git a/mcs/class/CustomMarshalers/Assembly/AssemblyInfo.cs b/mcs/class/CustomMarshalers/Assembly/AssemblyInfo.cs index e9261c44aa4..0f297530ca6 100644 --- a/mcs/class/CustomMarshalers/Assembly/AssemblyInfo.cs +++ b/mcs/class/CustomMarshalers/Assembly/AssemblyInfo.cs @@ -41,19 +41,15 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile ("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyTitle ("CustomMarshalers.dll")] - [assembly: AssemblyDescription ("CustomMarshalers.dll")] - [assembly: AssemblyDefaultAlias ("CustomMarshalers.dll")] - - [assembly: AssemblyCompany (Consts.MonoCompany)] - [assembly: AssemblyProduct (Consts.MonoProduct)] - [assembly: AssemblyCopyright (Consts.MonoCopyright)] - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] - - [assembly: CLSCompliant (true)] - [assembly: ComVisible (false)] -#elif NET_1_1 -#elif NET_1_0 -#endif +[assembly: AssemblyTitle ("CustomMarshalers.dll")] +[assembly: AssemblyDescription ("CustomMarshalers.dll")] +[assembly: AssemblyDefaultAlias ("CustomMarshalers.dll")] + +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] + +[assembly: CLSCompliant (true)] +[assembly: ComVisible (false)] diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2DataReader.cs b/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2DataReader.cs index aaf3e5c2ada..a5761603e4d 100644 --- a/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2DataReader.cs +++ b/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2DataReader.cs @@ -404,7 +404,6 @@ namespace IBM.Data.DB2 #region Read -#if !NET_1_0 public bool HasRows { get @@ -418,7 +417,6 @@ namespace IBM.Data.DB2 return hasRows; } } -#endif public bool Read() { @@ -588,19 +586,11 @@ namespace IBM.Data.DB2 // TODO: need better implementation for big BLOBs byte[] sourceArray = (byte[])this[col]; -#if NET_1_0 - if(buffer == null) - { - Array.Copy(sourceArray, (int)fieldOffset, buffer, bufferOffset, length); - } - return sourceArray.Length; -#else if(buffer == null) { Array.Copy(sourceArray, fieldOffset, buffer, bufferOffset, length); } return sourceArray.LongLength; -#endif } #endregion diff --git a/mcs/class/IKVM.Reflection/Assembly.cs b/mcs/class/IKVM.Reflection/Assembly.cs index 6a56f394178..f627e9692f4 100644 --- a/mcs/class/IKVM.Reflection/Assembly.cs +++ b/mcs/class/IKVM.Reflection/Assembly.cs @@ -36,6 +36,11 @@ namespace IKVM.Reflection this.universe = universe; } + public sealed override string ToString() + { + return FullName; + } + public abstract Type[] GetTypes(); public abstract AssemblyName GetName(); public abstract string ImageRuntimeVersion { get; } diff --git a/mcs/class/IKVM.Reflection/AssemblyName.cs b/mcs/class/IKVM.Reflection/AssemblyName.cs index 8452f1bbf00..50408a83b27 100644 --- a/mcs/class/IKVM.Reflection/AssemblyName.cs +++ b/mcs/class/IKVM.Reflection/AssemblyName.cs @@ -334,7 +334,14 @@ namespace IKVM.Reflection // HACK use the real AssemblyName to convert PublicKey to PublicKeyToken StringBuilder sb = new StringBuilder("Foo, PublicKey=", 20 + publicKey.Length * 2); AppendPublicKey(sb, publicKey); - return new System.Reflection.AssemblyName(sb.ToString()).GetPublicKeyToken(); + string str = sb.ToString(); + if (str == "Foo, PublicKey=00000000000000000400000000000000") + { + // MONOBUG workaround Mono 2.10 bug (fixed in 2.11) + // it does not return the correct public key token for the ECMA key + return new byte[] { 0xB7, 0x7A, 0x5C, 0x56, 0x19, 0x34, 0xE0, 0x89 }; + } + return new System.Reflection.AssemblyName(str).GetPublicKeyToken(); } private static void AppendPublicKey(StringBuilder sb, byte[] publicKey) diff --git a/mcs/class/IKVM.Reflection/CustomModifiers.cs b/mcs/class/IKVM.Reflection/CustomModifiers.cs index 499a120b574..e8670614e96 100644 --- a/mcs/class/IKVM.Reflection/CustomModifiers.cs +++ b/mcs/class/IKVM.Reflection/CustomModifiers.cs @@ -32,14 +32,13 @@ namespace IKVM.Reflection { public struct CustomModifiers : IEquatable, IEnumerable { - private static readonly Type ModOpt = new MarkerType(); - private static readonly Type ModReq = new MarkerType(); - private static readonly Type Initial = ModOpt; + // note that FromReqOpt assumes that Initial == ModOpt + private static Type Initial { get { return MarkerType.ModOpt; } } private readonly Type[] types; internal CustomModifiers(List list) { - bool required = Initial == ModReq; + bool required = Initial == MarkerType.ModReq; int count = list.Count; foreach (CustomModifiersBuilder.Item item in list) { @@ -50,14 +49,14 @@ namespace IKVM.Reflection } } types = new Type[count]; - required = Initial == ModReq; + required = Initial == MarkerType.ModReq; int index = 0; foreach (CustomModifiersBuilder.Item item in list) { if (item.required != required) { required = item.required; - types[index++] = required ? ModReq : ModOpt; + types[index++] = required ? MarkerType.ModReq : MarkerType.ModOpt; } types[index++] = item.type; } @@ -79,13 +78,13 @@ namespace IKVM.Reflection { this.types = types; this.index = -1; - this.required = Initial == ModReq; + this.required = Initial == MarkerType.ModReq; } void System.Collections.IEnumerator.Reset() { this.index = -1; - this.required = Initial == ModReq; + this.required = Initial == MarkerType.ModReq; } public Entry Current @@ -104,12 +103,12 @@ namespace IKVM.Reflection { return false; } - else if (types[index] == ModOpt) + else if (types[index] == MarkerType.ModOpt) { required = false; index++; } - else if (types[index] == ModReq) + else if (types[index] == MarkerType.ModReq) { required = true; index++; @@ -247,7 +246,7 @@ namespace IKVM.Reflection Type[] result = types; for (int i = 0; i < types.Length; i++) { - if (types[i] == ModOpt || types[i] == ModReq) + if (types[i] == MarkerType.ModOpt || types[i] == MarkerType.ModReq) { continue; } @@ -275,7 +274,7 @@ namespace IKVM.Reflection Type mode = Initial; do { - Type cmod = br.ReadByte() == Signature.ELEMENT_TYPE_CMOD_REQD ? ModReq : ModOpt; + Type cmod = br.ReadByte() == Signature.ELEMENT_TYPE_CMOD_REQD ? MarkerType.ModReq : MarkerType.ModOpt; if (mode != cmod) { mode = cmod; @@ -304,6 +303,7 @@ namespace IKVM.Reflection List list = null; if (opt != null && opt.Length != 0) { + Debug.Assert(Initial == MarkerType.ModOpt); list = new List(opt); } if (req != null && req.Length != 0) @@ -312,7 +312,7 @@ namespace IKVM.Reflection { list = new List(); } - list.Add(ModReq); + list.Add(MarkerType.ModReq); list.AddRange(req); } if (list == null) diff --git a/mcs/class/IKVM.Reflection/Emit/ILGenerator.cs b/mcs/class/IKVM.Reflection/Emit/ILGenerator.cs index d18ec5e5240..56ffe5e86f3 100644 --- a/mcs/class/IKVM.Reflection/Emit/ILGenerator.cs +++ b/mcs/class/IKVM.Reflection/Emit/ILGenerator.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2008-2011 Jeroen Frijters + Copyright (C) 2008-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -116,43 +116,12 @@ namespace IKVM.Reflection.Emit } } - sealed class MarkerType : Type - { - public override Type BaseType - { - get { throw new InvalidOperationException(); } - } - - public override TypeAttributes Attributes - { - get { throw new InvalidOperationException(); } - } - - public override string Name - { - get { throw new InvalidOperationException(); } - } - - public override string FullName - { - get { throw new InvalidOperationException(); } - } - - public override Module Module - { - get { throw new InvalidOperationException(); } - } - } - public sealed class ILGenerator { - private static readonly Type FAULT = new MarkerType(); - private static readonly Type FINALLY = new MarkerType(); - private static readonly Type FILTER = new MarkerType(); private readonly ModuleBuilder moduleBuilder; private readonly ByteBuffer code; - private readonly List locals = new List(); - private List localCustomModifiers; + private readonly SignatureHelper locals; + private int localsCount; private readonly List tokenFixups = new List(); private readonly List labels = new List(); private readonly List labelStackHeight = new List(); @@ -183,7 +152,7 @@ namespace IKVM.Reflection.Emit internal int tryLength; internal int handlerOffset; internal int handlerLength; - internal Type exceptionType; // FINALLY = finally block, FILTER = handler with filter, FAULT = fault block + internal Type exceptionType; // MarkerType.Finally = finally block, MarkerType.Filter = handler with filter, MarkerType.Fault = fault block internal int filterOffset; internal ExceptionBlock(int ordinal) @@ -245,6 +214,7 @@ namespace IKVM.Reflection.Emit { this.code = new ByteBuffer(initialCapacity); this.moduleBuilder = moduleBuilder; + this.locals = SignatureHelper.GetLocalVarSigHelper(moduleBuilder); if (moduleBuilder.symbolWriter != null) { scope = new Scope(null); @@ -305,7 +275,7 @@ namespace IKVM.Reflection.Emit UpdateStack(1); if (exceptionType == null) { - if (block.exceptionType != FILTER || block.handlerOffset != 0) + if (block.exceptionType != MarkerType.Filter || block.handlerOffset != 0) { throw new ArgumentNullException("exceptionType"); } @@ -330,7 +300,7 @@ namespace IKVM.Reflection.Emit exceptionStack.Push(block); } block.exceptionType = exceptionType; - if (exceptionType == FILTER) + if (exceptionType == MarkerType.Filter) { block.filterOffset = code.Position; } @@ -354,17 +324,17 @@ namespace IKVM.Reflection.Emit public void BeginExceptFilterBlock() { - BeginCatchBlock(FILTER); + BeginCatchBlock(MarkerType.Filter); } public void BeginFaultBlock() { - BeginFinallyFaultBlock(FAULT); + BeginFinallyFaultBlock(MarkerType.Fault); } public void BeginFinallyBlock() { - BeginFinallyFaultBlock(FINALLY); + BeginFinallyFaultBlock(MarkerType.Finally); } private void BeginFinallyFaultBlock(Type type) @@ -411,7 +381,7 @@ namespace IKVM.Reflection.Emit ExceptionBlock block = exceptionStack.Pop(); if (exceptionBlockAssistanceMode == EBAM_COMPAT || (exceptionBlockAssistanceMode == EBAM_CLEVER && stackHeight != -1)) { - if (block.filterOffset != 0 || (block.exceptionType != FINALLY && block.exceptionType != FAULT)) + if (block.filterOffset != 0 || (block.exceptionType != MarkerType.Finally && block.exceptionType != MarkerType.Fault)) { Emit(OpCodes.Leave, block.labelEnd); } @@ -447,8 +417,8 @@ namespace IKVM.Reflection.Emit public LocalBuilder DeclareLocal(Type localType, bool pinned) { - LocalBuilder local = new LocalBuilder(localType, locals.Count, pinned); - locals.Add(local); + LocalBuilder local = new LocalBuilder(localType, localsCount++, pinned); + locals.AddArgument(localType, pinned); if (scope != null) { scope.locals.Add(local); @@ -458,22 +428,13 @@ namespace IKVM.Reflection.Emit public LocalBuilder __DeclareLocal(Type localType, bool pinned, CustomModifiers customModifiers) { - if (!customModifiers.IsEmpty) + LocalBuilder local = new LocalBuilder(localType, localsCount++, pinned); + locals.__AddArgument(localType, pinned, customModifiers); + if (scope != null) { - if (localCustomModifiers == null) - { - localCustomModifiers = new List(); - } - // we lazily fill up the list (to sync with the locals list) and we don't need to - // make sure that the list has the same length as the locals list, because - // Signature.WriteLocalVarSig() can tolerate that. - while (localCustomModifiers.Count < locals.Count) - { - localCustomModifiers.Add(new CustomModifiers()); - } - localCustomModifiers.Add(customModifiers); + scope.locals.Add(local); } - return DeclareLocal(localType, pinned); + return local; } public Label DefineLabel() @@ -781,7 +742,7 @@ namespace IKVM.Reflection.Emit public void Emit(OpCode opc, string str) { Emit(opc); - code.Write(0x70000000 | moduleBuilder.UserStrings.Add(str)); + code.Write(moduleBuilder.GetStringConstant(str).Token); } public void Emit(OpCode opc, Type type) @@ -801,7 +762,7 @@ namespace IKVM.Reflection.Emit { Emit(opcode); UpdateStack(opcode, signature.HasThis, signature.ReturnType, signature.ParameterCount); - code.Write(0x11000000 | moduleBuilder.StandAloneSig.FindOrAddRecord(moduleBuilder.Blobs.Add(signature.GetSignature(moduleBuilder)))); + code.Write(moduleBuilder.GetSignatureToken(signature).Token); } public void EmitCall(OpCode opc, MethodInfo method, Type[] optionalParameterTypes) @@ -819,20 +780,7 @@ namespace IKVM.Reflection.Emit { Emit(opc); UpdateStack(opc, method.HasThis, method.ReturnType, method.ParameterCount + optionalParameterTypes.Length); - ByteBuffer sig = new ByteBuffer(16); - method.MethodSignature.WriteMethodRefSig(moduleBuilder, sig, optionalParameterTypes, customModifiers); - MemberRefTable.Record record = new MemberRefTable.Record(); - if (method.Module == moduleBuilder) - { - record.Class = method.MetadataToken; - } - else - { - record.Class = moduleBuilder.GetTypeTokenForMemberRef(method.DeclaringType ?? method.Module.GetModuleType()); - } - record.Name = moduleBuilder.Strings.Add(method.Name); - record.Signature = moduleBuilder.Blobs.Add(sig); - code.Write(0x0A000000 | moduleBuilder.MemberRef.FindOrAddRecord(record)); + code.Write(moduleBuilder.__GetMethodToken(method, optionalParameterTypes, customModifiers).Token); } } @@ -848,12 +796,18 @@ namespace IKVM.Reflection.Emit public void EmitCalli(OpCode opc, CallingConvention callingConvention, Type returnType, Type[] parameterTypes) { - __EmitCalli(opc, moduleBuilder.universe.MakeStandAloneMethodSig(callingConvention, returnType, new CustomModifiers(), parameterTypes, null)); + SignatureHelper sig = SignatureHelper.GetMethodSigHelper(moduleBuilder, callingConvention, returnType); + sig.AddArguments(parameterTypes, null, null); + Emit(opc, sig); } public void EmitCalli(OpCode opc, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes) { - __EmitCalli(opc, moduleBuilder.universe.MakeStandAloneMethodSig(callingConvention, returnType, new CustomModifiers(), parameterTypes, optionalParameterTypes, null)); + SignatureHelper sig = SignatureHelper.GetMethodSigHelper(moduleBuilder, callingConvention, returnType); + sig.AddArguments(parameterTypes, null, null); + sig.AddSentinel(); + sig.AddArguments(optionalParameterTypes, null, null); + Emit(opc, sig); } public void __EmitCalli(OpCode opc, __StandAloneMethodSig sig) @@ -969,7 +923,7 @@ namespace IKVM.Reflection.Emit int localVarSigTok = 0; int rva; - if (locals.Count == 0 && exceptions.Count == 0 && maxStack <= 8 && code.Length < 64 && !fatHeader) + if (localsCount == 0 && exceptions.Count == 0 && maxStack <= 8 && code.Length < 64 && !fatHeader) { rva = WriteTinyHeaderAndCode(bb); } @@ -1057,11 +1011,9 @@ namespace IKVM.Reflection.Emit bb.Align(4); int rva = bb.Position; - if (locals.Count != 0) + if (localsCount != 0) { - ByteBuffer localVarSig = new ByteBuffer(locals.Count + 2); - Signature.WriteLocalVarSig(moduleBuilder, localVarSig, locals, localCustomModifiers); - localVarSigTok = 0x11000000 | moduleBuilder.StandAloneSig.FindOrAddRecord(moduleBuilder.Blobs.Add(localVarSig)); + localVarSigTok = moduleBuilder.GetSignatureToken(locals).Token; } const byte CorILMethod_FatFormat = 0x03; @@ -1119,15 +1071,15 @@ namespace IKVM.Reflection.Emit bb.Write((short)(dataSize >> 8)); foreach (ExceptionBlock block in exceptions) { - if (block.exceptionType == FAULT) + if (block.exceptionType == MarkerType.Fault) { bb.Write((int)COR_ILEXCEPTION_CLAUSE_FAULT); } - else if (block.exceptionType == FILTER) + else if (block.exceptionType == MarkerType.Filter) { bb.Write((int)COR_ILEXCEPTION_CLAUSE_FILTER); } - else if (block.exceptionType == FINALLY) + else if (block.exceptionType == MarkerType.Finally) { bb.Write((int)COR_ILEXCEPTION_CLAUSE_FINALLY); } @@ -1139,7 +1091,7 @@ namespace IKVM.Reflection.Emit bb.Write(block.tryLength); bb.Write(block.handlerOffset); bb.Write(block.handlerLength); - if (block.exceptionType != FAULT && block.exceptionType != FILTER && block.exceptionType != FINALLY) + if (block.exceptionType != MarkerType.Fault && block.exceptionType != MarkerType.Filter && block.exceptionType != MarkerType.Finally) { bb.Write(moduleBuilder.GetTypeTokenForMemberRef(block.exceptionType)); } @@ -1156,15 +1108,15 @@ namespace IKVM.Reflection.Emit bb.Write((short)0); foreach (ExceptionBlock block in exceptions) { - if (block.exceptionType == FAULT) + if (block.exceptionType == MarkerType.Fault) { bb.Write(COR_ILEXCEPTION_CLAUSE_FAULT); } - else if (block.exceptionType == FILTER) + else if (block.exceptionType == MarkerType.Filter) { bb.Write(COR_ILEXCEPTION_CLAUSE_FILTER); } - else if (block.exceptionType == FINALLY) + else if (block.exceptionType == MarkerType.Finally) { bb.Write(COR_ILEXCEPTION_CLAUSE_FINALLY); } @@ -1176,7 +1128,7 @@ namespace IKVM.Reflection.Emit bb.Write((byte)block.tryLength); bb.Write((short)block.handlerOffset); bb.Write((byte)block.handlerLength); - if (block.exceptionType != FAULT && block.exceptionType != FILTER && block.exceptionType != FINALLY) + if (block.exceptionType != MarkerType.Fault && block.exceptionType != MarkerType.Filter && block.exceptionType != MarkerType.Finally) { bb.Write(moduleBuilder.GetTypeTokenForMemberRef(block.exceptionType)); } diff --git a/mcs/class/IKVM.Reflection/Emit/ModuleBuilder.cs b/mcs/class/IKVM.Reflection/Emit/ModuleBuilder.cs index 41ebeffcddb..c7b5bd77059 100644 --- a/mcs/class/IKVM.Reflection/Emit/ModuleBuilder.cs +++ b/mcs/class/IKVM.Reflection/Emit/ModuleBuilder.cs @@ -499,6 +499,11 @@ namespace IKVM.Reflection.Emit return symbolWriter.DefineDocument(url, language, languageVendor, documentType); } + public int __GetAssemblyToken(Assembly assembly) + { + return ImportAssemblyRef(assembly); + } + public TypeToken GetTypeToken(string name) { return new TypeToken(GetType(name, true, false).MetadataToken); @@ -579,6 +584,30 @@ namespace IKVM.Reflection.Emit } } + // new in .NET 4.5 + public MethodToken GetMethodToken(MethodInfo method, IEnumerable optionalParameterTypes) + { + return __GetMethodToken(method, Util.ToArray(optionalParameterTypes), null); + } + + public MethodToken __GetMethodToken(MethodInfo method, Type[] optionalParameterTypes, CustomModifiers[] customModifiers) + { + ByteBuffer sig = new ByteBuffer(16); + method.MethodSignature.WriteMethodRefSig(this, sig, optionalParameterTypes, customModifiers); + MemberRefTable.Record record = new MemberRefTable.Record(); + if (method.Module == this) + { + record.Class = method.MetadataToken; + } + else + { + record.Class = GetTypeTokenForMemberRef(method.DeclaringType ?? method.Module.GetModuleType()); + } + record.Name = Strings.Add(method.Name); + record.Signature = Blobs.Add(sig); + return new MethodToken(0x0A000000 | MemberRef.FindOrAddRecord(record)); + } + // when we refer to a method on a generic type definition in the IL stream, // we need to use a MemberRef (even if the method is in the same module) internal MethodToken GetMethodTokenForIL(MethodInfo method) @@ -609,6 +638,17 @@ namespace IKVM.Reflection.Emit } } + // new in .NET 4.5 + public MethodToken GetConstructorToken(ConstructorInfo constructor, IEnumerable optionalParameterTypes) + { + return GetMethodToken(constructor.GetMethodInfo(), optionalParameterTypes); + } + + public MethodToken __GetConstructorToken(ConstructorInfo constructor, Type[] optionalParameterTypes, CustomModifiers[] customModifiers) + { + return __GetMethodToken(constructor.GetMethodInfo(), optionalParameterTypes, customModifiers); + } + internal int ImportMember(MethodBase member) { int token; @@ -687,9 +727,7 @@ namespace IKVM.Reflection.Emit { // We can't write the AssemblyRef record here yet, because the identity of the assembly can still change // (if it's an AssemblyBuilder). - // We set the high bit of rid in the token to make sure we emit obviously broken metadata, - // if we forget to patch up the token somewhere. - token = 0x23800001 + referencedAssemblies.Count; + token = AllocPseudoToken(); referencedAssemblies.Add(asm, token); } return token; @@ -697,30 +735,11 @@ namespace IKVM.Reflection.Emit internal void FillAssemblyRefTable() { - int[] realtokens = new int[referencedAssemblies.Count]; foreach (KeyValuePair kv in referencedAssemblies) { - if ((kv.Value & 0x7F800000) == 0x23800000) - { - realtokens[(kv.Value & 0x7FFFFF) - 1] = FindOrAddAssemblyRef(kv.Key.GetName(), false); - } - } - // now fixup the resolution scopes in TypeRef - for (int i = 0; i < this.TypeRef.records.Length; i++) - { - int resolutionScope = this.TypeRef.records[i].ResolutionScope; - if ((resolutionScope & 0x7F800000) == 0x23800000) - { - this.TypeRef.records[i].ResolutionScope = realtokens[(resolutionScope & 0x7FFFFF) - 1]; - } - } - // and implementation in ExportedType - for (int i = 0; i < this.ExportedType.records.Length; i++) - { - int implementation = this.ExportedType.records[i].Implementation; - if ((implementation & 0x7F800000) == 0x23800000) + if (IsPseudoToken(kv.Value)) { - this.ExportedType.records[i].Implementation = realtokens[(implementation & 0x7FFFFF) - 1]; + RegisterTokenFixup(kv.Value, FindOrAddAssemblyRef(kv.Key.GetName(), false)); } } } @@ -1582,6 +1601,14 @@ namespace IKVM.Reflection.Emit } } } + + internal void FixupPseudoToken(ref int token) + { + if (IsPseudoToken(token)) + { + token = ResolvePseudoToken(token); + } + } } struct UnmanagedExport diff --git a/mcs/class/IKVM.Reflection/Emit/SignatureHelper.cs b/mcs/class/IKVM.Reflection/Emit/SignatureHelper.cs index 9c6c3504594..b70ace82169 100644 --- a/mcs/class/IKVM.Reflection/Emit/SignatureHelper.cs +++ b/mcs/class/IKVM.Reflection/Emit/SignatureHelper.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2008-2011 Jeroen Frijters + Copyright (C) 2008-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,65 +29,168 @@ using IKVM.Reflection.Writer; namespace IKVM.Reflection.Emit { - public sealed class SignatureHelper + public abstract class SignatureHelper { - private readonly ModuleBuilder module; - private readonly byte type; - private readonly List args = new List(); - private readonly List locals = new List(); - private readonly List customModifiers = new List(); - private readonly List optionalArgs = new List(); - private Type returnType; - private CustomModifiers returnTypeCustomModifiers; - private CallingConventions callingConvention; - private CallingConvention unmanagedCallConv; - private bool unmanaged; - private bool optional; - - private SignatureHelper(ModuleBuilder module, byte type) - { - this.module = module; + protected readonly byte type; + protected ushort paramCount; + + sealed class Lazy : SignatureHelper + { + private readonly List args = new List(); + + internal Lazy(byte type) + : base(type) + { + } + + internal override Type ReturnType + { + get { return args[0]; } + } + + public override byte[] GetSignature() + { + throw new NotSupportedException(); + } + + internal override ByteBuffer GetSignature(ModuleBuilder module) + { + ByteBuffer bb = new ByteBuffer(16); + Signature.WriteSignatureHelper(module, bb, type, paramCount, args); + return bb; + } + + public override void AddSentinel() + { + args.Add(MarkerType.Sentinel); + } + + public override void __AddArgument(Type argument, bool pinned, CustomModifiers customModifiers) + { + if (pinned) + { + args.Add(MarkerType.Pinned); + } + foreach (CustomModifiers.Entry mod in customModifiers) + { + args.Add(mod.IsRequired ? MarkerType.ModReq : MarkerType.ModOpt); + args.Add(mod.Type); + } + args.Add(argument); + paramCount++; + } + } + + sealed class Eager : SignatureHelper + { + private readonly ModuleBuilder module; + private readonly ByteBuffer bb = new ByteBuffer(16); + private readonly Type returnType; + + internal Eager(ModuleBuilder module, byte type, Type returnType) + : base(type) + { + this.module = module; + this.returnType = returnType; + bb.Write(type); + if (type != Signature.FIELD) + { + // space for parameterCount + bb.Write((byte)0); + } + } + + internal override Type ReturnType + { + get { return returnType; } + } + + public override byte[] GetSignature() + { + return GetSignature(null).ToArray(); + } + + internal override ByteBuffer GetSignature(ModuleBuilder module) + { + if (type != Signature.FIELD) + { + bb.Position = 1; + bb.Insert(MetadataWriter.GetCompressedIntLength(paramCount) - bb.GetCompressedIntLength()); + bb.WriteCompressedInt(paramCount); + } + return bb; + } + + public override void AddSentinel() + { + bb.Write(Signature.SENTINEL); + } + + public override void __AddArgument(Type argument, bool pinned, CustomModifiers customModifiers) + { + if (pinned) + { + bb.Write(Signature.ELEMENT_TYPE_PINNED); + } + foreach (CustomModifiers.Entry mod in customModifiers) + { + bb.Write(mod.IsRequired ? Signature.ELEMENT_TYPE_CMOD_REQD : Signature.ELEMENT_TYPE_CMOD_OPT); + Signature.WriteTypeSpec(module, bb, mod.Type); + } + Signature.WriteTypeSpec(module, bb, argument ?? module.universe.System_Void); + paramCount++; + } + } + + private SignatureHelper(byte type) + { this.type = type; } internal bool HasThis { - get { return (callingConvention & CallingConventions.HasThis) != 0; } + get { return (type & Signature.HASTHIS) != 0; } } - internal Type ReturnType + internal abstract Type ReturnType { - get { return returnType; } + get; } internal int ParameterCount { - get { return args.Count + optionalArgs.Count; } + get { return paramCount; } + } + + private static SignatureHelper Create(Module mod, byte type, Type returnType) + { + ModuleBuilder mb = mod as ModuleBuilder; + return mb == null + ? (SignatureHelper)new Lazy(type) + : new Eager(mb, type, returnType); } public static SignatureHelper GetFieldSigHelper(Module mod) { - return new SignatureHelper(mod as ModuleBuilder, Signature.FIELD); + return Create(mod, Signature.FIELD, null); } public static SignatureHelper GetLocalVarSigHelper() { - return new SignatureHelper(null, Signature.LOCAL_SIG); + return new Lazy(Signature.LOCAL_SIG); } public static SignatureHelper GetLocalVarSigHelper(Module mod) { - return new SignatureHelper(mod as ModuleBuilder, Signature.LOCAL_SIG); + return Create(mod, Signature.LOCAL_SIG, null); } public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes) { - SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY); - sig.returnType = returnType; - foreach (Type type in parameterTypes) - { - sig.AddArgument(type); - } + SignatureHelper sig = Create(mod, Signature.PROPERTY, returnType); + sig.AddArgument(returnType); + sig.paramCount = 0; + sig.AddArguments(parameterTypes, null, null); return sig; } @@ -98,10 +201,14 @@ namespace IKVM.Reflection.Emit public static SignatureHelper GetPropertySigHelper(Module mod, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers) { - SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY); - sig.callingConvention = callingConvention; - sig.returnType = returnType; - sig.returnTypeCustomModifiers = CustomModifiers.FromReqOpt(requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers); + byte type = Signature.PROPERTY; + if ((callingConvention & CallingConventions.HasThis) != 0) + { + type |= Signature.HASTHIS; + } + SignatureHelper sig = Create(mod, type, returnType); + sig.AddArgument(returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers); + sig.paramCount = 0; sig.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers); return sig; } @@ -118,78 +225,67 @@ namespace IKVM.Reflection.Emit public static SignatureHelper GetMethodSigHelper(Module mod, CallingConvention unmanagedCallConv, Type returnType) { - SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, 0); - sig.returnType = returnType; - sig.unmanaged = true; - sig.unmanagedCallConv = unmanagedCallConv; + byte type; + switch (unmanagedCallConv) + { + case CallingConvention.Cdecl: + type = 0x01; // C + break; + case CallingConvention.StdCall: + case CallingConvention.Winapi: + type = 0x02; // STDCALL + break; + case CallingConvention.ThisCall: + type = 0x03; // THISCALL + break; + case CallingConvention.FastCall: + type = 0x04; // FASTCALL + break; + default: + throw new ArgumentOutOfRangeException("unmanagedCallConv"); + } + SignatureHelper sig = Create(mod, type, returnType); + sig.AddArgument(returnType); + sig.paramCount = 0; return sig; } public static SignatureHelper GetMethodSigHelper(Module mod, CallingConventions callingConvention, Type returnType) { - SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, 0); - sig.returnType = returnType; - sig.callingConvention = callingConvention; - return sig; - } - - public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes) - { - SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, 0); - sig.returnType = returnType; - sig.callingConvention = CallingConventions.Standard; - foreach (Type type in parameterTypes) + byte type = 0; + if ((callingConvention & CallingConventions.HasThis) != 0) { - sig.AddArgument(type); + type |= Signature.HASTHIS; } - return sig; - } - - public byte[] GetSignature() - { - if (module == null) + if ((callingConvention & CallingConventions.ExplicitThis) != 0) { - throw new NotSupportedException(); + type |= Signature.EXPLICITTHIS; } - return GetSignature(module).ToArray(); - } - - internal ByteBuffer GetSignature(ModuleBuilder module) - { - ByteBuffer bb = new ByteBuffer(16); - switch (type) + if ((callingConvention & CallingConventions.VarArgs) != 0) { - case 0: - if (unmanaged) - { - Signature.WriteStandAloneMethodSig(module, bb, module.universe.MakeStandAloneMethodSig(unmanagedCallConv, returnType, returnTypeCustomModifiers, args.ToArray(), customModifiers.ToArray())); - } - else - { - Signature.WriteStandAloneMethodSig(module, bb, module.universe.MakeStandAloneMethodSig(callingConvention, returnType, returnTypeCustomModifiers, args.ToArray(), optionalArgs.ToArray(), customModifiers.ToArray())); - } - break; - case Signature.FIELD: - FieldSignature.Create(args[0], customModifiers[0]).WriteSig(module, bb); - break; - case Signature.PROPERTY: - Signature.WritePropertySig(module, bb, callingConvention, returnType, returnTypeCustomModifiers, args.ToArray(), customModifiers.ToArray()); - break; - case Signature.LOCAL_SIG: - Signature.WriteLocalVarSig(module, bb, locals, customModifiers); - break; - default: - throw new InvalidOperationException(); + type |= Signature.VARARG; } - return bb; + SignatureHelper sig = Create(mod, type, returnType); + sig.AddArgument(returnType); + sig.paramCount = 0; + return sig; } - public void AddSentinel() + public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes) { - optional = true; - callingConvention |= CallingConventions.VarArgs; + SignatureHelper sig = Create(mod, 0, returnType); + sig.AddArgument(returnType); + sig.paramCount = 0; + sig.AddArguments(parameterTypes, null, null); + return sig; } + public abstract byte[] GetSignature(); + + internal abstract ByteBuffer GetSignature(ModuleBuilder module); + + public abstract void AddSentinel(); + public void AddArgument(Type clsArgument) { AddArgument(clsArgument, false); @@ -205,28 +301,16 @@ namespace IKVM.Reflection.Emit __AddArgument(argument, false, CustomModifiers.FromReqOpt(requiredCustomModifiers, optionalCustomModifiers)); } - public void __AddArgument(Type argument, bool pinned, CustomModifiers customModifiers) - { - if (type == Signature.LOCAL_SIG) - { - locals.Add(new LocalBuilder(argument, 0, pinned)); - } - else if (optional) - { - this.optionalArgs.Add(argument); - } - else - { - this.args.Add(argument); - } - this.customModifiers.Add(customModifiers); - } + public abstract void __AddArgument(Type argument, bool pinned, CustomModifiers customModifiers); public void AddArguments(Type[] arguments, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers) { - for (int i = 0; i < arguments.Length; i++) + if (arguments != null) { - __AddArgument(arguments[i], false, CustomModifiers.FromReqOpt(requiredCustomModifiers[i], optionalCustomModifiers[i])); + for (int i = 0; i < arguments.Length; i++) + { + __AddArgument(arguments[i], false, CustomModifiers.FromReqOpt(Util.NullSafeElementAt(requiredCustomModifiers, i), Util.NullSafeElementAt(optionalCustomModifiers, i))); + } } } } diff --git a/mcs/class/IKVM.Reflection/Enums.cs b/mcs/class/IKVM.Reflection/Enums.cs index 79333401cf3..65b1209845b 100644 --- a/mcs/class/IKVM.Reflection/Enums.cs +++ b/mcs/class/IKVM.Reflection/Enums.cs @@ -235,6 +235,7 @@ namespace IKVM.Reflection Private = 2, } + [Flags] public enum ResourceLocation { Embedded = 1, diff --git a/mcs/class/IKVM.Reflection/IKVM.Reflection.csproj b/mcs/class/IKVM.Reflection/IKVM.Reflection.csproj index a103ec10086..e7e7ad30cf2 100644 --- a/mcs/class/IKVM.Reflection/IKVM.Reflection.csproj +++ b/mcs/class/IKVM.Reflection/IKVM.Reflection.csproj @@ -76,8 +76,6 @@ - - diff --git a/mcs/class/IKVM.Reflection/Impl/CryptoConvert.cs b/mcs/class/IKVM.Reflection/Impl/CryptoConvert.cs deleted file mode 100644 index 14687dee382..00000000000 --- a/mcs/class/IKVM.Reflection/Impl/CryptoConvert.cs +++ /dev/null @@ -1,743 +0,0 @@ -// -// CryptoConvert.cs - Crypto Convertion Routines -// -// Author: -// Sebastien Pouliot -// -// (C) 2003 Motus Technologies Inc. (http://www.motus.com) -// Copyright (C) 2004-2006 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. -// -// [JF-20081013] begin modifications for IKVM -#define INSIDE_CORLIB -// end modifications for IKVM - -using System; -using System.Globalization; -using System.Security.Cryptography; -using System.Text; - -namespace Mono.Security.Cryptography { - -#if INSIDE_CORLIB - internal -#else - public -#endif - sealed class CryptoConvert { - - private CryptoConvert () - { - } - - static private int ToInt32LE (byte [] bytes, int offset) - { - return (bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]; - } - - static private uint ToUInt32LE (byte [] bytes, int offset) - { - return (uint)((bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]); - } - - static private byte [] GetBytesLE (int val) - { - return new byte [] { - (byte) (val & 0xff), - (byte) ((val >> 8) & 0xff), - (byte) ((val >> 16) & 0xff), - (byte) ((val >> 24) & 0xff) - }; - } - - static private byte[] Trim (byte[] array) - { - for (int i=0; i < array.Length; i++) { - if (array [i] != 0x00) { - byte[] result = new byte [array.Length - i]; - Buffer.BlockCopy (array, i, result, 0, result.Length); - return result; - } - } - return null; - } - - // convert the key from PRIVATEKEYBLOB to RSA - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/private_key_blobs.asp - // e.g. SNK files, PVK files - static public RSA FromCapiPrivateKeyBlob (byte[] blob) - { - return FromCapiPrivateKeyBlob (blob, 0); - } - - static public RSA FromCapiPrivateKeyBlob (byte[] blob, int offset) - { - if (blob == null) - throw new ArgumentNullException ("blob"); - if (offset >= blob.Length) - throw new ArgumentException ("blob is too small."); - - RSAParameters rsap = new RSAParameters (); - try { - if ((blob [offset] != 0x07) || // PRIVATEKEYBLOB (0x07) - (blob [offset+1] != 0x02) || // Version (0x02) - (blob [offset+2] != 0x00) || // Reserved (word) - (blob [offset+3] != 0x00) || - (ToUInt32LE (blob, offset+8) != 0x32415352)) // DWORD magic = RSA2 - throw new CryptographicException ("Invalid blob header"); - - // ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...) - // int algId = ToInt32LE (blob, offset+4); - - // DWORD bitlen - int bitLen = ToInt32LE (blob, offset+12); - - // DWORD public exponent - byte[] exp = new byte [4]; - Buffer.BlockCopy (blob, offset+16, exp, 0, 4); - Array.Reverse (exp); - rsap.Exponent = Trim (exp); - - int pos = offset+20; - // BYTE modulus[rsapubkey.bitlen/8]; - int byteLen = (bitLen >> 3); - rsap.Modulus = new byte [byteLen]; - Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen); - Array.Reverse (rsap.Modulus); - pos += byteLen; - - // BYTE prime1[rsapubkey.bitlen/16]; - int byteHalfLen = (byteLen >> 1); - rsap.P = new byte [byteHalfLen]; - Buffer.BlockCopy (blob, pos, rsap.P, 0, byteHalfLen); - Array.Reverse (rsap.P); - pos += byteHalfLen; - - // BYTE prime2[rsapubkey.bitlen/16]; - rsap.Q = new byte [byteHalfLen]; - Buffer.BlockCopy (blob, pos, rsap.Q, 0, byteHalfLen); - Array.Reverse (rsap.Q); - pos += byteHalfLen; - - // BYTE exponent1[rsapubkey.bitlen/16]; - rsap.DP = new byte [byteHalfLen]; - Buffer.BlockCopy (blob, pos, rsap.DP, 0, byteHalfLen); - Array.Reverse (rsap.DP); - pos += byteHalfLen; - - // BYTE exponent2[rsapubkey.bitlen/16]; - rsap.DQ = new byte [byteHalfLen]; - Buffer.BlockCopy (blob, pos, rsap.DQ, 0, byteHalfLen); - Array.Reverse (rsap.DQ); - pos += byteHalfLen; - - // BYTE coefficient[rsapubkey.bitlen/16]; - rsap.InverseQ = new byte [byteHalfLen]; - Buffer.BlockCopy (blob, pos, rsap.InverseQ, 0, byteHalfLen); - Array.Reverse (rsap.InverseQ); - pos += byteHalfLen; - - // ok, this is hackish but CryptoAPI support it so... - // note: only works because CRT is used by default - // http://bugzilla.ximian.com/show_bug.cgi?id=57941 - rsap.D = new byte [byteLen]; // must be allocated - if (pos + byteLen + offset <= blob.Length) { - // BYTE privateExponent[rsapubkey.bitlen/8]; - Buffer.BlockCopy (blob, pos, rsap.D, 0, byteLen); - Array.Reverse (rsap.D); - } - } - catch (Exception e) { - throw new CryptographicException ("Invalid blob.", e); - } - - RSA rsa = null; - try { - rsa = RSA.Create (); - rsa.ImportParameters (rsap); - } - catch (CryptographicException ce) { - // this may cause problem when this code is run under - // the SYSTEM identity on Windows (e.g. ASP.NET). See - // http://bugzilla.ximian.com/show_bug.cgi?id=77559 - try { - CspParameters csp = new CspParameters (); - csp.Flags = CspProviderFlags.UseMachineKeyStore; - rsa = new RSACryptoServiceProvider (csp); - rsa.ImportParameters (rsap); - } - catch { - // rethrow original, not the later, exception if this fails - throw ce; - } - } - return rsa; - } - - static public DSA FromCapiPrivateKeyBlobDSA (byte[] blob) - { - return FromCapiPrivateKeyBlobDSA (blob, 0); - } - - static public DSA FromCapiPrivateKeyBlobDSA (byte[] blob, int offset) - { - if (blob == null) - throw new ArgumentNullException ("blob"); - if (offset >= blob.Length) - throw new ArgumentException ("blob is too small."); - - DSAParameters dsap = new DSAParameters (); - try { - if ((blob [offset] != 0x07) || // PRIVATEKEYBLOB (0x07) - (blob [offset + 1] != 0x02) || // Version (0x02) - (blob [offset + 2] != 0x00) || // Reserved (word) - (blob [offset + 3] != 0x00) || - (ToUInt32LE (blob, offset + 8) != 0x32535344)) // DWORD magic - throw new CryptographicException ("Invalid blob header"); - - int bitlen = ToInt32LE (blob, offset + 12); - int bytelen = bitlen >> 3; - int pos = offset + 16; - - dsap.P = new byte [bytelen]; - Buffer.BlockCopy (blob, pos, dsap.P, 0, bytelen); - Array.Reverse (dsap.P); - pos += bytelen; - - dsap.Q = new byte [20]; - Buffer.BlockCopy (blob, pos, dsap.Q, 0, 20); - Array.Reverse (dsap.Q); - pos += 20; - - dsap.G = new byte [bytelen]; - Buffer.BlockCopy (blob, pos, dsap.G, 0, bytelen); - Array.Reverse (dsap.G); - pos += bytelen; - - dsap.X = new byte [20]; - Buffer.BlockCopy (blob, pos, dsap.X, 0, 20); - Array.Reverse (dsap.X); - pos += 20; - - dsap.Counter = ToInt32LE (blob, pos); - pos += 4; - - dsap.Seed = new byte [20]; - Buffer.BlockCopy (blob, pos, dsap.Seed, 0, 20); - Array.Reverse (dsap.Seed); - pos += 20; - } - catch (Exception e) { - throw new CryptographicException ("Invalid blob.", e); - } - - DSA dsa = null; - try { - dsa = (DSA)DSA.Create (); - dsa.ImportParameters (dsap); - } - catch (CryptographicException ce) { - // this may cause problem when this code is run under - // the SYSTEM identity on Windows (e.g. ASP.NET). See - // http://bugzilla.ximian.com/show_bug.cgi?id=77559 - try { - CspParameters csp = new CspParameters (); - csp.Flags = CspProviderFlags.UseMachineKeyStore; - dsa = new DSACryptoServiceProvider (csp); - dsa.ImportParameters (dsap); - } - catch { - // rethrow original, not the later, exception if this fails - throw ce; - } - } - return dsa; - } - - static public byte[] ToCapiPrivateKeyBlob (RSA rsa) - { - RSAParameters p = rsa.ExportParameters (true); - int keyLength = p.Modulus.Length; // in bytes - byte[] blob = new byte [20 + (keyLength << 2) + (keyLength >> 1)]; - - blob [0] = 0x07; // Type - PRIVATEKEYBLOB (0x07) - blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02) - // [2], [3] // RESERVED - Always 0 - blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN) - blob [8] = 0x52; // Magic - RSA2 (ASCII in hex) - blob [9] = 0x53; - blob [10] = 0x41; - blob [11] = 0x32; - - byte[] bitlen = GetBytesLE (keyLength << 3); - blob [12] = bitlen [0]; // bitlen - blob [13] = bitlen [1]; - blob [14] = bitlen [2]; - blob [15] = bitlen [3]; - - // public exponent (DWORD) - int pos = 16; - int n = p.Exponent.Length; - while (n > 0) - blob [pos++] = p.Exponent [--n]; - // modulus - pos = 20; - byte[] part = p.Modulus; - int len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - // private key - part = p.P; - len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - - part = p.Q; - len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - - part = p.DP; - len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - - part = p.DQ; - len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - - part = p.InverseQ; - len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - - part = p.D; - len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - - return blob; - } - - static public byte[] ToCapiPrivateKeyBlob (DSA dsa) - { - DSAParameters p = dsa.ExportParameters (true); - int keyLength = p.P.Length; // in bytes - - // header + P + Q + G + X + count + seed - byte[] blob = new byte [16 + keyLength + 20 + keyLength + 20 + 4 + 20]; - - blob [0] = 0x07; // Type - PRIVATEKEYBLOB (0x07) - blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02) - // [2], [3] // RESERVED - Always 0 - blob [5] = 0x22; // ALGID - blob [8] = 0x44; // Magic - blob [9] = 0x53; - blob [10] = 0x53; - blob [11] = 0x32; - - byte[] bitlen = GetBytesLE (keyLength << 3); - blob [12] = bitlen [0]; - blob [13] = bitlen [1]; - blob [14] = bitlen [2]; - blob [15] = bitlen [3]; - - int pos = 16; - byte[] part = p.P; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, keyLength); - pos += keyLength; - - part = p.Q; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, 20); - pos += 20; - - part = p.G; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, keyLength); - pos += keyLength; - - part = p.X; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, 20); - pos += 20; - - Buffer.BlockCopy (GetBytesLE (p.Counter), 0, blob, pos, 4); - pos += 4; - - part = p.Seed; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, 20); - - return blob; - } - - static public RSA FromCapiPublicKeyBlob (byte[] blob) - { - return FromCapiPublicKeyBlob (blob, 0); - } - - static public RSA FromCapiPublicKeyBlob (byte[] blob, int offset) - { - if (blob == null) - throw new ArgumentNullException ("blob"); - if (offset >= blob.Length) - throw new ArgumentException ("blob is too small."); - - try { - if ((blob [offset] != 0x06) || // PUBLICKEYBLOB (0x06) - (blob [offset+1] != 0x02) || // Version (0x02) - (blob [offset+2] != 0x00) || // Reserved (word) - (blob [offset+3] != 0x00) || - (ToUInt32LE (blob, offset+8) != 0x31415352)) // DWORD magic = RSA1 - throw new CryptographicException ("Invalid blob header"); - - // ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...) - // int algId = ToInt32LE (blob, offset+4); - - // DWORD bitlen - int bitLen = ToInt32LE (blob, offset+12); - - // DWORD public exponent - RSAParameters rsap = new RSAParameters (); - rsap.Exponent = new byte [3]; - rsap.Exponent [0] = blob [offset+18]; - rsap.Exponent [1] = blob [offset+17]; - rsap.Exponent [2] = blob [offset+16]; - - int pos = offset+20; - // BYTE modulus[rsapubkey.bitlen/8]; - int byteLen = (bitLen >> 3); - rsap.Modulus = new byte [byteLen]; - Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen); - Array.Reverse (rsap.Modulus); - - RSA rsa = null; - try { - rsa = RSA.Create (); - rsa.ImportParameters (rsap); - } - catch (CryptographicException) { - // this may cause problem when this code is run under - // the SYSTEM identity on Windows (e.g. ASP.NET). See - // http://bugzilla.ximian.com/show_bug.cgi?id=77559 - CspParameters csp = new CspParameters (); - csp.Flags = CspProviderFlags.UseMachineKeyStore; - rsa = new RSACryptoServiceProvider (csp); - rsa.ImportParameters (rsap); - } - return rsa; - } - catch (Exception e) { - throw new CryptographicException ("Invalid blob.", e); - } - } - - static public DSA FromCapiPublicKeyBlobDSA (byte[] blob) - { - return FromCapiPublicKeyBlobDSA (blob, 0); - } - - static public DSA FromCapiPublicKeyBlobDSA (byte[] blob, int offset) - { - if (blob == null) - throw new ArgumentNullException ("blob"); - if (offset >= blob.Length) - throw new ArgumentException ("blob is too small."); - - try { - if ((blob [offset] != 0x06) || // PUBLICKEYBLOB (0x06) - (blob [offset + 1] != 0x02) || // Version (0x02) - (blob [offset + 2] != 0x00) || // Reserved (word) - (blob [offset + 3] != 0x00) || - (ToUInt32LE (blob, offset + 8) != 0x31535344)) // DWORD magic - throw new CryptographicException ("Invalid blob header"); - - int bitlen = ToInt32LE (blob, offset + 12); - DSAParameters dsap = new DSAParameters (); - int bytelen = bitlen >> 3; - int pos = offset + 16; - - dsap.P = new byte [bytelen]; - Buffer.BlockCopy (blob, pos, dsap.P, 0, bytelen); - Array.Reverse (dsap.P); - pos += bytelen; - - dsap.Q = new byte [20]; - Buffer.BlockCopy (blob, pos, dsap.Q, 0, 20); - Array.Reverse (dsap.Q); - pos += 20; - - dsap.G = new byte [bytelen]; - Buffer.BlockCopy (blob, pos, dsap.G, 0, bytelen); - Array.Reverse (dsap.G); - pos += bytelen; - - dsap.Y = new byte [bytelen]; - Buffer.BlockCopy (blob, pos, dsap.Y, 0, bytelen); - Array.Reverse (dsap.Y); - pos += bytelen; - - dsap.Counter = ToInt32LE (blob, pos); - pos += 4; - - dsap.Seed = new byte [20]; - Buffer.BlockCopy (blob, pos, dsap.Seed, 0, 20); - Array.Reverse (dsap.Seed); - pos += 20; - - DSA dsa = (DSA)DSA.Create (); - dsa.ImportParameters (dsap); - return dsa; - } - catch (Exception e) { - throw new CryptographicException ("Invalid blob.", e); - } - } - - static public byte[] ToCapiPublicKeyBlob (RSA rsa) - { - RSAParameters p = rsa.ExportParameters (false); - int keyLength = p.Modulus.Length; // in bytes - byte[] blob = new byte [20 + keyLength]; - - blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06) - blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02) - // [2], [3] // RESERVED - Always 0 - blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN) - blob [8] = 0x52; // Magic - RSA1 (ASCII in hex) - blob [9] = 0x53; - blob [10] = 0x41; - blob [11] = 0x31; - - byte[] bitlen = GetBytesLE (keyLength << 3); - blob [12] = bitlen [0]; // bitlen - blob [13] = bitlen [1]; - blob [14] = bitlen [2]; - blob [15] = bitlen [3]; - - // public exponent (DWORD) - int pos = 16; - int n = p.Exponent.Length; - while (n > 0) - blob [pos++] = p.Exponent [--n]; - // modulus - pos = 20; - byte[] part = p.Modulus; - int len = part.Length; - Array.Reverse (part, 0, len); - Buffer.BlockCopy (part, 0, blob, pos, len); - pos += len; - return blob; - } - - static public byte[] ToCapiPublicKeyBlob (DSA dsa) - { - DSAParameters p = dsa.ExportParameters (false); - int keyLength = p.P.Length; // in bytes - - // header + P + Q + G + Y + count + seed - byte[] blob = new byte [16 + keyLength + 20 + keyLength + keyLength + 4 + 20]; - - blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06) - blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02) - // [2], [3] // RESERVED - Always 0 - blob [5] = 0x22; // ALGID - blob [8] = 0x44; // Magic - blob [9] = 0x53; - blob [10] = 0x53; - blob [11] = 0x31; - - byte[] bitlen = GetBytesLE (keyLength << 3); - blob [12] = bitlen [0]; - blob [13] = bitlen [1]; - blob [14] = bitlen [2]; - blob [15] = bitlen [3]; - - int pos = 16; - byte[] part; - - part = p.P; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, keyLength); - pos += keyLength; - - part = p.Q; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, 20); - pos += 20; - - part = p.G; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, keyLength); - pos += keyLength; - - part = p.Y; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, keyLength); - pos += keyLength; - - Buffer.BlockCopy (GetBytesLE (p.Counter), 0, blob, pos, 4); - pos += 4; - - part = p.Seed; - Array.Reverse (part); - Buffer.BlockCopy (part, 0, blob, pos, 20); - - return blob; - } - - // PRIVATEKEYBLOB - // PUBLICKEYBLOB - static public RSA FromCapiKeyBlob (byte[] blob) - { - return FromCapiKeyBlob (blob, 0); - } - - static public RSA FromCapiKeyBlob (byte[] blob, int offset) - { - if (blob == null) - throw new ArgumentNullException ("blob"); - if (offset >= blob.Length) - throw new ArgumentException ("blob is too small."); - - switch (blob [offset]) { - case 0x00: - // this could be a public key inside an header - // like "sn -e" would produce - if (blob [offset + 12] == 0x06) { - return FromCapiPublicKeyBlob (blob, offset + 12); - } - break; - case 0x06: - return FromCapiPublicKeyBlob (blob, offset); - case 0x07: - return FromCapiPrivateKeyBlob (blob, offset); - } - throw new CryptographicException ("Unknown blob format."); - } - - static public DSA FromCapiKeyBlobDSA (byte[] blob) - { - return FromCapiKeyBlobDSA (blob, 0); - } - - static public DSA FromCapiKeyBlobDSA (byte[] blob, int offset) - { - if (blob == null) - throw new ArgumentNullException ("blob"); - if (offset >= blob.Length) - throw new ArgumentException ("blob is too small."); - - switch (blob [offset]) { - case 0x06: - return FromCapiPublicKeyBlobDSA (blob, offset); - case 0x07: - return FromCapiPrivateKeyBlobDSA (blob, offset); - } - throw new CryptographicException ("Unknown blob format."); - } - - static public byte[] ToCapiKeyBlob (AsymmetricAlgorithm keypair, bool includePrivateKey) - { - if (keypair == null) - throw new ArgumentNullException ("keypair"); - - // check between RSA and DSA (and potentially others like DH) - if (keypair is RSA) - return ToCapiKeyBlob ((RSA)keypair, includePrivateKey); - else if (keypair is DSA) - return ToCapiKeyBlob ((DSA)keypair, includePrivateKey); - else - return null; // TODO - } - - static public byte[] ToCapiKeyBlob (RSA rsa, bool includePrivateKey) - { - if (rsa == null) - throw new ArgumentNullException ("rsa"); - - if (includePrivateKey) - return ToCapiPrivateKeyBlob (rsa); - else - return ToCapiPublicKeyBlob (rsa); - } - - static public byte[] ToCapiKeyBlob (DSA dsa, bool includePrivateKey) - { - if (dsa == null) - throw new ArgumentNullException ("dsa"); - - if (includePrivateKey) - return ToCapiPrivateKeyBlob (dsa); - else - return ToCapiPublicKeyBlob (dsa); - } - - static public string ToHex (byte[] input) - { - if (input == null) - return null; - - StringBuilder sb = new StringBuilder (input.Length * 2); - foreach (byte b in input) { - sb.Append (b.ToString ("X2", CultureInfo.InvariantCulture)); - } - return sb.ToString (); - } - - static private byte FromHexChar (char c) - { - if ((c >= 'a') && (c <= 'f')) - return (byte) (c - 'a' + 10); - if ((c >= 'A') && (c <= 'F')) - return (byte) (c - 'A' + 10); - if ((c >= '0') && (c <= '9')) - return (byte) (c - '0'); - throw new ArgumentException ("invalid hex char"); - } - - static public byte[] FromHex (string hex) - { - if (hex == null) - return null; - if ((hex.Length & 0x1) == 0x1) - throw new ArgumentException ("Length must be a multiple of 2"); - - byte[] result = new byte [hex.Length >> 1]; - int n = 0; - int i = 0; - while (n < result.Length) { - result [n] = (byte) (FromHexChar (hex [i++]) << 4); - result [n++] += FromHexChar (hex [i++]); - } - return result; - } - } -} diff --git a/mcs/class/IKVM.Reflection/Impl/CryptoHack.cs b/mcs/class/IKVM.Reflection/Impl/CryptoHack.cs deleted file mode 100644 index 1a8b46afb99..00000000000 --- a/mcs/class/IKVM.Reflection/Impl/CryptoHack.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2008 Jeroen Frijters - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jeroen Frijters - jeroen@frijters.net - -*/ -using System; -using System.Collections.Generic; -using System.Text; -using System.Security.Cryptography; -using System.Runtime.Serialization; - -namespace IKVM.Reflection.Impl -{ - static class CryptoHack - { - internal static RSA CreateRSA(StrongNameKeyPair keyPair) - { - // HACK use serialization to get at the private key or key container name, - // this should be more future proof than using reflection to access the fields directly. - SerializationInfo ser = new SerializationInfo(typeof(StrongNameKeyPair), new FormatterConverter()); - ((ISerializable)keyPair.keyPair).GetObjectData(ser, new StreamingContext()); - byte[] key = (byte[])ser.GetValue("_keyPairArray", typeof(byte[])); - string keycontainer = ser.GetString("_keyPairContainer"); - if (keycontainer != null) - { - CspParameters parm = new CspParameters(); - parm.Flags = CspProviderFlags.UseMachineKeyStore; - parm.KeyContainerName = keycontainer; - parm.KeyNumber = 2; // Signature - return new RSACryptoServiceProvider(parm); - } - else - { - return Mono.Security.Cryptography.CryptoConvert.FromCapiKeyBlob(key); - } - } - } -} diff --git a/mcs/class/IKVM.Reflection/Impl/SymbolSupport.cs b/mcs/class/IKVM.Reflection/Impl/SymbolSupport.cs index b1e142028fb..64547ebe8ed 100644 --- a/mcs/class/IKVM.Reflection/Impl/SymbolSupport.cs +++ b/mcs/class/IKVM.Reflection/Impl/SymbolSupport.cs @@ -51,16 +51,12 @@ namespace IKVM.Reflection.Impl static class SymbolSupport { -#if !NO_SYMBOL_WRITER - private static readonly bool runningOnMono = System.Type.GetType("Mono.Runtime") != null; -#endif - internal static ISymbolWriterImpl CreateSymbolWriterFor(ModuleBuilder moduleBuilder) { #if NO_SYMBOL_WRITER throw new NotSupportedException("IKVM.Reflection compiled with NO_SYMBOL_WRITER does not support writing debugging symbols."); #else - if (runningOnMono) + if (Universe.MonoRuntime) { #if MONO return new MdbWriter(moduleBuilder); diff --git a/mcs/class/IKVM.Reflection/ManifestResourceInfo.cs b/mcs/class/IKVM.Reflection/ManifestResourceInfo.cs index 296e4ef927f..04a2a306ed4 100644 --- a/mcs/class/IKVM.Reflection/ManifestResourceInfo.cs +++ b/mcs/class/IKVM.Reflection/ManifestResourceInfo.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Jeroen Frijters + Copyright (C) 2009-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,8 +55,12 @@ namespace IKVM.Reflection int implementation = module.ManifestResource.records[index].Implementation; if ((implementation >> 24) == AssemblyRefTable.Index) { - //return ResourceLocation.ContainedInAnotherAssembly; - throw new NotImplementedException(); + Assembly asm = ReferencedAssembly; + if (asm == null || asm.__IsMissing) + { + return ResourceLocation.ContainedInAnotherAssembly; + } + return asm.GetManifestResourceInfo(module.GetString(module.ManifestResource.records[index].Name)).ResourceLocation | ResourceLocation.ContainedInAnotherAssembly; } else if ((implementation >> 24) == FileTable.Index) { @@ -75,7 +79,15 @@ namespace IKVM.Reflection public Assembly ReferencedAssembly { - get { throw new NotImplementedException(); } + get + { + int implementation = module.ManifestResource.records[index].Implementation; + if ((implementation >> 24) == AssemblyRefTable.Index) + { + return module.ResolveAssemblyRef((implementation & 0xFFFFFF) - 1); + } + return null; + } } public string FileName @@ -94,7 +106,7 @@ namespace IKVM.Reflection return module.GetString(module.File.records[(implementation & 0xFFFFFF) - 1].Name); } } - throw new NotImplementedException(); + return null; } } } diff --git a/mcs/class/IKVM.Reflection/Metadata/Tables.cs b/mcs/class/IKVM.Reflection/Metadata/Tables.cs index d39e9f65ba0..107b5ce91fe 100644 --- a/mcs/class/IKVM.Reflection/Metadata/Tables.cs +++ b/mcs/class/IKVM.Reflection/Metadata/Tables.cs @@ -423,45 +423,9 @@ namespace IKVM.Reflection.Metadata { throw new InvalidOperationException(); } - -#if STABLE_SORT - private struct OrdinalWrapper - { - internal int ordinal; - internal T value; - } - - protected void Sort(IComparer comparer) - { - OrdinalWrapper[] items = new OrdinalWrapper[rowCount]; - for (int i = 0; i < items.Length; i++) - { - items[i].ordinal = i; - items[i].value = records[i]; - } - Array.Sort(items, delegate(OrdinalWrapper x, OrdinalWrapper y) - { - int res = comparer.Compare(x.value, y.value); - if (res == 0) - { - res = x.ordinal.CompareTo(y.ordinal); - } - return res; - }); - for (int i = 0; i < items.Length; i++) - { - records[i] = items[i].value; - } - } -#else - protected void Sort(IComparer comparer) - { - Array.Sort(records, 0, rowCount, comparer); - } -#endif } - abstract class SortedTable : Table + abstract class SortedTable : Table, IComparer where T : SortedTable.ISortKey { internal interface ISortKey @@ -569,6 +533,28 @@ namespace IKVM.Reflection.Metadata { return new Enumerable(this, token); } + + protected void Sort() + { + int[] map = new int[rowCount]; + for (int i = 0; i < map.Length; i++) + { + map[i] = i; + } + Array.Sort(map, this); + T[] newRecords = new T[rowCount]; + for (int i = 0; i < map.Length; i++) + { + newRecords[i] = records[map[i]]; + } + records = newRecords; + } + + int IComparer.Compare(int x, int y) + { + int rc = records[x].Key.CompareTo(records[y].Key); + return rc == 0 ? x.CompareTo(y) : rc; + } } sealed class ModuleTable : Table @@ -670,6 +656,14 @@ namespace IKVM.Reflection.Metadata .WriteStringIndex() .Value; } + + internal void Fixup(ModuleBuilder moduleBuilder) + { + for (int i = 0; i < rowCount; i++) + { + moduleBuilder.FixupPseudoToken(ref records[i].ResolutionScope); + } + } } sealed class TypeDefTable : Table @@ -881,7 +875,7 @@ namespace IKVM.Reflection.Metadata } } - sealed class InterfaceImplTable : SortedTable, IComparer + sealed class InterfaceImplTable : SortedTable { internal const int Index = 0x09; @@ -945,22 +939,10 @@ namespace IKVM.Reflection.Metadata } records[i].Interface = token; } - Sort(this); - } - - int IComparer.Compare(Record x, Record y) - { - if (x.Class == y.Class) - { -#if STABLE_SORT - return 0; -#else - // LAMESPEC the CLI spec says that InterfaceImpl should be sorted by { Class, Interface }, but it appears to be - // only necessary to sort by Class. - return x.Interface == y.Interface ? 0 : (x.Interface > y.Interface ? 1 : -1); -#endif - } - return x.Class > y.Class ? 1 : -1; + // LAMESPEC the CLI spec says that InterfaceImpl should be sorted by { Class, Interface }, + // but it appears to only be necessary to sort by Class (and csc emits InterfaceImpl records in + // source file order, so to be able to support round tripping, we need to retain ordering as well). + Sort(); } } @@ -1022,15 +1004,12 @@ namespace IKVM.Reflection.Metadata { for (int i = 0; i < rowCount; i++) { - if (moduleBuilder.IsPseudoToken(records[i].Class)) - { - records[i].Class = moduleBuilder.ResolvePseudoToken(records[i].Class); - } + moduleBuilder.FixupPseudoToken(ref records[i].Class); } } } - sealed class ConstantTable : SortedTable, IComparer + sealed class ConstantTable : SortedTable { internal const int Index = 0x0B; @@ -1080,10 +1059,7 @@ namespace IKVM.Reflection.Metadata for (int i = 0; i < rowCount; i++) { int token = records[i].Parent; - if (moduleBuilder.IsPseudoToken(token)) - { - token = moduleBuilder.ResolvePseudoToken(token); - } + moduleBuilder.FixupPseudoToken(ref token); // do the HasConstant encoding, so that we can sort the table switch (token >> 24) { @@ -1100,12 +1076,7 @@ namespace IKVM.Reflection.Metadata throw new InvalidOperationException(); } } - Array.Sort(records, 0, rowCount, this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Parent == y.Parent ? 0 : (x.Parent > y.Parent ? 1 : -1); + Sort(); } internal object GetRawConstantValue(Module module, int parent) @@ -1163,7 +1134,7 @@ namespace IKVM.Reflection.Metadata } } - sealed class CustomAttributeTable : SortedTable, IComparer + sealed class CustomAttributeTable : SortedTable { internal const int Index = 0x0C; @@ -1213,15 +1184,9 @@ namespace IKVM.Reflection.Metadata int[] genericParamFixup = moduleBuilder.GenericParam.GetIndexFixup(); for (int i = 0; i < rowCount; i++) { - if (moduleBuilder.IsPseudoToken(records[i].Type)) - { - records[i].Type = moduleBuilder.ResolvePseudoToken(records[i].Type); - } + moduleBuilder.FixupPseudoToken(ref records[i].Type); int token = records[i].Parent; - if (moduleBuilder.IsPseudoToken(token)) - { - token = moduleBuilder.ResolvePseudoToken(token); - } + moduleBuilder.FixupPseudoToken(ref token); // do the HasCustomAttribute encoding, so that we can sort the table switch (token >> 24) { @@ -1287,16 +1252,11 @@ namespace IKVM.Reflection.Metadata throw new InvalidOperationException(); } } - Sort(this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Parent == y.Parent ? 0 : (x.Parent > y.Parent ? 1 : -1); + Sort(); } } - sealed class FieldMarshalTable : SortedTable, IComparer + sealed class FieldMarshalTable : SortedTable { internal const int Index = 0x0D; @@ -1355,16 +1315,11 @@ namespace IKVM.Reflection.Metadata throw new InvalidOperationException(); } } - Array.Sort(records, 0, rowCount, this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Parent == y.Parent ? 0 : (x.Parent > y.Parent ? 1 : -1); + Sort(); } } - sealed class DeclSecurityTable : SortedTable, IComparer + sealed class DeclSecurityTable : SortedTable { internal const int Index = 0x0E; @@ -1414,10 +1369,7 @@ namespace IKVM.Reflection.Metadata for (int i = 0; i < rowCount; i++) { int token = records[i].Parent; - if (moduleBuilder.IsPseudoToken(token)) - { - token = moduleBuilder.ResolvePseudoToken(token); - } + moduleBuilder.FixupPseudoToken(ref token); // do the HasDeclSecurity encoding, so that we can sort the table switch (token >> 24) { @@ -1435,16 +1387,11 @@ namespace IKVM.Reflection.Metadata } records[i].Parent = token; } - Sort(this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Parent == y.Parent ? 0 : (x.Parent > y.Parent ? 1 : -1); + Sort(); } } - sealed class ClassLayoutTable : SortedTable, IComparer + sealed class ClassLayoutTable : SortedTable { internal const int Index = 0x0f; @@ -1472,7 +1419,7 @@ namespace IKVM.Reflection.Metadata internal override void Write(MetadataWriter mw) { - Array.Sort(records, 0, rowCount, this); + Sort(); for (int i = 0; i < rowCount; i++) { mw.Write(records[i].PackingSize); @@ -1488,14 +1435,9 @@ namespace IKVM.Reflection.Metadata .WriteTypeDef() .Value; } - - int IComparer.Compare(Record x, Record y) - { - return x.Parent == y.Parent ? 0 : (x.Parent > y.Parent ? 1 : -1); - } } - sealed class FieldLayoutTable : SortedTable, IComparer + sealed class FieldLayoutTable : SortedTable { internal const int Index = 0x10; @@ -1542,12 +1484,7 @@ namespace IKVM.Reflection.Metadata { records[i].Field = moduleBuilder.ResolvePseudoToken(records[i].Field); } - Array.Sort(records, 0, rowCount, this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Field == y.Field ? 0 : (x.Field > y.Field ? 1 : -1); + Sort(); } } @@ -1781,7 +1718,7 @@ namespace IKVM.Reflection.Metadata } } - sealed class MethodSemanticsTable : SortedTable, IComparer + sealed class MethodSemanticsTable : SortedTable { internal const int Index = 0x18; @@ -1838,10 +1775,7 @@ namespace IKVM.Reflection.Metadata { for (int i = 0; i < rowCount; i++) { - if (moduleBuilder.IsPseudoToken(records[i].Method)) - { - records[i].Method = moduleBuilder.ResolvePseudoToken(records[i].Method); - } + moduleBuilder.FixupPseudoToken(ref records[i].Method); int token = records[i].Association; // do the HasSemantics encoding, so that we can sort the table switch (token >> 24) @@ -1857,12 +1791,7 @@ namespace IKVM.Reflection.Metadata } records[i].Association = token; } - Sort(this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Association == y.Association ? 0 : (x.Association > y.Association ? 1 : -1); + Sort(); } internal MethodInfo GetMethod(Module module, int token, bool nonPublic, short semantics) @@ -1913,7 +1842,7 @@ namespace IKVM.Reflection.Metadata } } - sealed class MethodImplTable : SortedTable, IComparer + sealed class MethodImplTable : SortedTable { internal const int Index = 0x19; @@ -1962,21 +1891,10 @@ namespace IKVM.Reflection.Metadata { for (int i = 0; i < rowCount; i++) { - if (moduleBuilder.IsPseudoToken(records[i].MethodBody)) - { - records[i].MethodBody = moduleBuilder.ResolvePseudoToken(records[i].MethodBody); - } - if (moduleBuilder.IsPseudoToken(records[i].MethodDeclaration)) - { - records[i].MethodDeclaration = moduleBuilder.ResolvePseudoToken(records[i].MethodDeclaration); - } + moduleBuilder.FixupPseudoToken(ref records[i].MethodBody); + moduleBuilder.FixupPseudoToken(ref records[i].MethodDeclaration); } - Sort(this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Class == y.Class ? 0 : (x.Class > y.Class ? 1 : -1); + Sort(); } } @@ -2046,7 +1964,7 @@ namespace IKVM.Reflection.Metadata } } - sealed class ImplMapTable : SortedTable, IComparer + sealed class ImplMapTable : SortedTable { internal const int Index = 0x1C; @@ -2099,21 +2017,13 @@ namespace IKVM.Reflection.Metadata { for (int i = 0; i < rowCount; i++) { - if (moduleBuilder.IsPseudoToken(records[i].MemberForwarded)) - { - records[i].MemberForwarded = moduleBuilder.ResolvePseudoToken(records[i].MemberForwarded); - } + moduleBuilder.FixupPseudoToken(ref records[i].MemberForwarded); } - Array.Sort(records, 0, rowCount, this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.MemberForwarded == y.MemberForwarded ? 0 : (x.MemberForwarded > y.MemberForwarded ? 1 : -1); + Sort(); } } - sealed class FieldRVATable : SortedTable, IComparer + sealed class FieldRVATable : SortedTable { internal const int Index = 0x1D; @@ -2166,17 +2076,9 @@ namespace IKVM.Reflection.Metadata { records[i].RVA += sdataRVA; } - if (moduleBuilder.IsPseudoToken(records[i].Field)) - { - records[i].Field = moduleBuilder.ResolvePseudoToken(records[i].Field); - } + moduleBuilder.FixupPseudoToken(ref records[i].Field); } - Array.Sort(records, 0, rowCount, this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Field == y.Field ? 0 : (x.Field > y.Field ? 1 : -1); + Sort(); } } @@ -2423,6 +2325,14 @@ namespace IKVM.Reflection.Metadata } return AddRecord(rec); } + + internal void Fixup(ModuleBuilder moduleBuilder) + { + for (int i = 0; i < rowCount; i++) + { + moduleBuilder.FixupPseudoToken(ref records[i].Implementation); + } + } } sealed class ManifestResourceTable : Table @@ -2467,6 +2377,14 @@ namespace IKVM.Reflection.Metadata .WriteImplementation() .Value; } + + internal void Fixup(ModuleBuilder moduleBuilder) + { + for (int i = 0; i < rowCount; i++) + { + moduleBuilder.FixupPseudoToken(ref records[i].Implementation); + } + } } sealed class NestedClassTable : SortedTable @@ -2579,10 +2497,7 @@ namespace IKVM.Reflection.Metadata for (int i = 0; i < rowCount; i++) { int token = records[i].Owner; - if (moduleBuilder.IsPseudoToken(token)) - { - token = moduleBuilder.ResolvePseudoToken(token); - } + moduleBuilder.FixupPseudoToken(ref token); // do the TypeOrMethodDef encoding, so that we can sort the table switch (token >> 24) { @@ -2597,7 +2512,8 @@ namespace IKVM.Reflection.Metadata } records[i].unsortedIndex = i; } - Array.Sort(records, 0, rowCount, this); + // FXBUG the unnecessary (IComparer) cast is a workaround for a .NET 2.0 C# compiler bug + Array.Sort(records, 0, rowCount, (IComparer)this); } int IComparer.Compare(Record x, Record y) @@ -2687,15 +2603,12 @@ namespace IKVM.Reflection.Metadata { for (int i = 0; i < rowCount; i++) { - if (moduleBuilder.IsPseudoToken(records[i].Method)) - { - records[i].Method = moduleBuilder.ResolvePseudoToken(records[i].Method); - } + moduleBuilder.FixupPseudoToken(ref records[i].Method); } } } - sealed class GenericParamConstraintTable : SortedTable, IComparer + sealed class GenericParamConstraintTable : SortedTable { internal const int Index = 0x2C; @@ -2743,12 +2656,7 @@ namespace IKVM.Reflection.Metadata { records[i].Owner = fixups[records[i].Owner - 1] + 1; } - Sort(this); - } - - int IComparer.Compare(Record x, Record y) - { - return x.Owner == y.Owner ? 0 : (x.Owner > y.Owner ? 1 : -1); + Sort(); } } } diff --git a/mcs/class/IKVM.Reflection/MethodInfo.cs b/mcs/class/IKVM.Reflection/MethodInfo.cs index 87cbbc9a48b..382dc4bd01c 100644 --- a/mcs/class/IKVM.Reflection/MethodInfo.cs +++ b/mcs/class/IKVM.Reflection/MethodInfo.cs @@ -243,12 +243,12 @@ namespace IKVM.Reflection public override MethodInfo MakeGenericMethod(params Type[] typeArguments) { - return (MethodInfo)method.MakeGenericMethod(typeArguments).SetReflectedType(reflectedType); + return SetReflectedType(method.MakeGenericMethod(typeArguments), reflectedType); } public override MethodInfo GetGenericMethodDefinition() { - return (MethodInfo)method.GetGenericMethodDefinition().SetReflectedType(reflectedType); + return method.GetGenericMethodDefinition(); } public override string ToString() diff --git a/mcs/class/IKVM.Reflection/Reader/ModuleReader.cs b/mcs/class/IKVM.Reflection/Reader/ModuleReader.cs index da3e24e84ce..764289a274b 100644 --- a/mcs/class/IKVM.Reflection/Reader/ModuleReader.cs +++ b/mcs/class/IKVM.Reflection/Reader/ModuleReader.cs @@ -502,7 +502,7 @@ namespace IKVM.Reflection.Reader return new TypeName(GetString(typeNamespace), GetString(typeName)); } - private Assembly ResolveAssemblyRef(int index) + internal Assembly ResolveAssemblyRef(int index) { if (assemblyRefs == null) { @@ -974,7 +974,13 @@ namespace IKVM.Reflection.Reader { if (resourceName == GetString(ManifestResource.records[i].Name)) { - return new ManifestResourceInfo(this, i); + ManifestResourceInfo info = new ManifestResourceInfo(this, i); + Assembly asm = info.ReferencedAssembly; + if (asm != null && !asm.__IsMissing && asm.GetManifestResourceInfo(resourceName) == null) + { + return null; + } + return info; } } return null; @@ -988,7 +994,34 @@ namespace IKVM.Reflection.Reader { if (ManifestResource.records[i].Implementation != 0x26000000) { - throw new NotImplementedException(); + ManifestResourceInfo info = new ManifestResourceInfo(this, i); + switch (ManifestResource.records[i].Implementation >> 24) + { + case FileTable.Index: + string fileName = Path.Combine(Path.GetDirectoryName(location), info.FileName); + if (System.IO.File.Exists(fileName)) + { + // note that, like System.Reflection, we return null for zero length files and + // ManifestResource.Offset is ignored + FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete); + if (fs.Length == 0) + { + fs.Close(); + return null; + } + return fs; + } + return null; + case AssemblyRefTable.Index: + Assembly asm = info.ReferencedAssembly; + if (asm.__IsMissing) + { + return null; + } + return asm.GetManifestResourceStream(resourceName); + default: + throw new BadImageFormatException(); + } } SeekRVA((int)cliHeader.Resources.VirtualAddress + ManifestResource.records[i].Offset); BinaryReader br = new BinaryReader(stream); @@ -996,7 +1029,7 @@ namespace IKVM.Reflection.Reader return new MemoryStream(br.ReadBytes(length)); } } - throw new FileNotFoundException(); + return null; } public override AssemblyName[] __GetReferencedAssemblies() diff --git a/mcs/class/IKVM.Reflection/Signature.cs b/mcs/class/IKVM.Reflection/Signature.cs index 55b0203e182..68c3f10fd28 100644 --- a/mcs/class/IKVM.Reflection/Signature.cs +++ b/mcs/class/IKVM.Reflection/Signature.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2009-2011 Jeroen Frijters + Copyright (C) 2009-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -585,58 +585,6 @@ namespace IKVM.Reflection } } - internal static void WriteLocalVarSig(ModuleBuilder module, ByteBuffer bb, IList locals, IList customModifiers) - { - bb.Write(LOCAL_SIG); - bb.WriteCompressedInt(locals.Count); - for (int i = 0; i < locals.Count; i++) - { - if (locals[i].IsPinned) - { - bb.Write(ELEMENT_TYPE_PINNED); - } - if (customModifiers != null && i < customModifiers.Count) - { - WriteCustomModifiers(module, bb, customModifiers[i]); - } - WriteType(module, bb, locals[i].LocalType); - } - } - - internal static void WritePropertySig(ModuleBuilder module, ByteBuffer bb, CallingConventions callingConvention, - Type returnType, CustomModifiers returnTypeCustomModifiers, - Type[] parameterTypes, CustomModifiers[] parameterTypeCustomModifiers) - { - byte flags = PROPERTY; - if ((callingConvention & CallingConventions.HasThis) != 0) - { - flags |= HASTHIS; - } - if ((callingConvention & CallingConventions.ExplicitThis) != 0) - { - flags |= EXPLICITTHIS; - } - if ((callingConvention & CallingConventions.VarArgs) != 0) - { - flags |= VARARG; - } - bb.Write(flags); - bb.WriteCompressedInt(parameterTypes == null ? 0 : parameterTypes.Length); - WriteCustomModifiers(module, bb, returnTypeCustomModifiers); - WriteType(module, bb, returnType); - if (parameterTypes != null) - { - for (int i = 0; i < parameterTypes.Length; i++) - { - if (parameterTypeCustomModifiers != null) - { - WriteCustomModifiers(module, bb, parameterTypeCustomModifiers[i]); - } - WriteType(module, bb, parameterTypes[i]); - } - } - } - internal static void WriteTypeSpec(ModuleBuilder module, ByteBuffer bb, Type type) { WriteType(module, bb, type); @@ -693,5 +641,41 @@ namespace IKVM.Reflection } return expanded; } + + internal static void WriteSignatureHelper(ModuleBuilder module, ByteBuffer bb, byte flags, ushort paramCount, List args) + { + bb.Write(flags); + if (flags != FIELD) + { + bb.WriteCompressedInt(paramCount); + } + foreach (Type type in args) + { + if (type == MarkerType.ModOpt) + { + bb.Write(ELEMENT_TYPE_CMOD_OPT); + } + else if (type == MarkerType.ModReq) + { + bb.Write(ELEMENT_TYPE_CMOD_REQD); + } + else if (type == MarkerType.Sentinel) + { + bb.Write(SENTINEL); + } + else if (type == MarkerType.Pinned) + { + bb.Write(ELEMENT_TYPE_PINNED); + } + else if (type == null) + { + bb.Write(ELEMENT_TYPE_VOID); + } + else + { + WriteType(module, bb, type); + } + } + } } } diff --git a/mcs/class/IKVM.Reflection/StrongNameKeyPair.cs b/mcs/class/IKVM.Reflection/StrongNameKeyPair.cs index 9fac5415f54..7d354475ae0 100644 --- a/mcs/class/IKVM.Reflection/StrongNameKeyPair.cs +++ b/mcs/class/IKVM.Reflection/StrongNameKeyPair.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Jeroen Frijters + Copyright (C) 2009-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,38 +22,115 @@ */ using System; -using System.Collections.Generic; -using System.Text; +using System.IO; +using System.Security.Cryptography; namespace IKVM.Reflection { public sealed class StrongNameKeyPair { - internal readonly System.Reflection.StrongNameKeyPair keyPair; + private readonly byte[] keyPairArray; + private readonly string keyPairContainer; - internal StrongNameKeyPair(System.Reflection.StrongNameKeyPair keyPair) + public StrongNameKeyPair(string keyPairContainer) { - this.keyPair = keyPair; + if (keyPairContainer == null) + { + throw new ArgumentNullException("keyPairContainer"); + } + if (Universe.MonoRuntime && Environment.OSVersion.Platform == PlatformID.Win32NT) + { + throw new NotSupportedException("IKVM.Reflection does not support key containers when running on Mono"); + } + this.keyPairContainer = keyPairContainer; } - public StrongNameKeyPair(string keyPairContainer) + public StrongNameKeyPair(byte[] keyPairArray) { - this.keyPair = new System.Reflection.StrongNameKeyPair(keyPairContainer); + if (keyPairArray == null) + { + throw new ArgumentNullException("keyPairArray"); + } + this.keyPairArray = (byte[])keyPairArray.Clone(); } - public StrongNameKeyPair(byte[] keyPairArray) + public StrongNameKeyPair(FileStream keyPairFile) + : this(ReadAllBytes(keyPairFile)) { - this.keyPair = new System.Reflection.StrongNameKeyPair(keyPairArray); } - public StrongNameKeyPair(System.IO.FileStream fs) + private static byte[] ReadAllBytes(FileStream keyPairFile) { - this.keyPair = new System.Reflection.StrongNameKeyPair(fs); + if (keyPairFile == null) + { + throw new ArgumentNullException("keyPairFile"); + } + byte[] buf = new byte[keyPairFile.Length - keyPairFile.Position]; + keyPairFile.Read(buf, 0, buf.Length); + return buf; } public byte[] PublicKey { - get { return keyPair.PublicKey; } + get + { + if (Universe.MonoRuntime) + { + // MONOBUG workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=5299 + return MonoGetPublicKey(); + } + using (RSACryptoServiceProvider rsa = CreateRSA()) + { + byte[] cspBlob = rsa.ExportCspBlob(false); + byte[] publicKey = new byte[12 + cspBlob.Length]; + Buffer.BlockCopy(cspBlob, 0, publicKey, 12, cspBlob.Length); + publicKey[1] = 36; + publicKey[4] = 4; + publicKey[5] = 128; + publicKey[8] = (byte)(cspBlob.Length >> 0); + publicKey[9] = (byte)(cspBlob.Length >> 8); + publicKey[10] = (byte)(cspBlob.Length >> 16); + publicKey[11] = (byte)(cspBlob.Length >> 24); + return publicKey; + } + } + } + + internal RSACryptoServiceProvider CreateRSA() + { + try + { + if (keyPairArray != null) + { + RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); + rsa.ImportCspBlob(keyPairArray); + return rsa; + } + else + { + CspParameters parm = new CspParameters(); + parm.KeyContainerName = keyPairContainer; + // MONOBUG Mono doesn't like it when Flags or KeyNumber are set + if (!Universe.MonoRuntime) + { + parm.Flags = CspProviderFlags.UseMachineKeyStore | CspProviderFlags.UseExistingKey; + parm.KeyNumber = 2; // Signature + } + return new RSACryptoServiceProvider(parm); + } + } + catch + { + throw new ArgumentException("Unable to obtain public key for StrongNameKeyPair."); + } + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] + private byte[] MonoGetPublicKey() + { + return keyPairArray != null + ? new System.Reflection.StrongNameKeyPair(keyPairArray).PublicKey + : new System.Reflection.StrongNameKeyPair(keyPairContainer).PublicKey; } } } diff --git a/mcs/class/IKVM.Reflection/Type.cs b/mcs/class/IKVM.Reflection/Type.cs index 841cacf97ab..5f10f9d52c3 100644 --- a/mcs/class/IKVM.Reflection/Type.cs +++ b/mcs/class/IKVM.Reflection/Type.cs @@ -2837,4 +2837,45 @@ namespace IKVM.Reflection return ""; } } + + sealed class MarkerType : Type + { + // used by ILGenerator + internal static readonly Type Fault = new MarkerType(); + internal static readonly Type Finally = new MarkerType(); + internal static readonly Type Filter = new MarkerType(); + // used by CustomModifiers and SignatureHelper + internal static readonly Type ModOpt = new MarkerType(); + internal static readonly Type ModReq = new MarkerType(); + // used by SignatureHelper + internal static readonly Type Sentinel = new MarkerType(); + internal static readonly Type Pinned = new MarkerType(); + + private MarkerType() { } + + public override Type BaseType + { + get { throw new InvalidOperationException(); } + } + + public override TypeAttributes Attributes + { + get { throw new InvalidOperationException(); } + } + + public override string Name + { + get { throw new InvalidOperationException(); } + } + + public override string FullName + { + get { throw new InvalidOperationException(); } + } + + public override Module Module + { + get { throw new InvalidOperationException(); } + } + } } diff --git a/mcs/class/IKVM.Reflection/Universe.cs b/mcs/class/IKVM.Reflection/Universe.cs index 2ae8c62bd9e..a00af0b6942 100644 --- a/mcs/class/IKVM.Reflection/Universe.cs +++ b/mcs/class/IKVM.Reflection/Universe.cs @@ -87,6 +87,7 @@ namespace IKVM.Reflection public sealed class Universe : IDisposable { + internal static readonly bool MonoRuntime = System.Type.GetType("Mono.Runtime") != null; private readonly Dictionary canonicalizedTypes = new Dictionary(); private readonly List assemblies = new List(); private readonly List dynamicAssemblies = new List(); @@ -171,7 +172,7 @@ namespace IKVM.Reflection try { return Environment.OSVersion.Platform == PlatformID.Win32NT - && System.Type.GetType("Mono.Runtime") == null + && !MonoRuntime && Environment.GetEnvironmentVariable("IKVM_DISABLE_FUSION") == null; } catch (System.Security.SecurityException) diff --git a/mcs/class/IKVM.Reflection/Util.cs b/mcs/class/IKVM.Reflection/Util.cs index 2c1e6bb125e..e05b5dbe367 100644 --- a/mcs/class/IKVM.Reflection/Util.cs +++ b/mcs/class/IKVM.Reflection/Util.cs @@ -120,6 +120,13 @@ namespace IKVM.Reflection return array; } + internal static T[] ToArray(IEnumerable values) + { + return values == null + ? Empty.Array + : new List(values).ToArray(); + } + // note that an empty array matches a null reference internal static bool ArrayEquals(Type[] t1, Type[] t2) { diff --git a/mcs/class/IKVM.Reflection/Writer/ByteBuffer.cs b/mcs/class/IKVM.Reflection/Writer/ByteBuffer.cs index f8e15f87d60..e67bd70762a 100644 --- a/mcs/class/IKVM.Reflection/Writer/ByteBuffer.cs +++ b/mcs/class/IKVM.Reflection/Writer/ByteBuffer.cs @@ -62,6 +62,26 @@ namespace IKVM.Reflection.Writer get { return Math.Max(pos, __length); } } + // insert count bytes at the current position (without advancing the current position) + internal void Insert(int count) + { + if (count > 0) + { + int len = this.Length; + int free = buffer.Length - len; + if (free < count) + { + Grow(count - free); + } + Buffer.BlockCopy(buffer, pos, buffer, pos + count, len - pos); + __length = Math.Max(__length, pos) + count; + } + else if (count < 0) + { + throw new ArgumentOutOfRangeException("count"); + } + } + private void Grow(int minGrow) { byte[] newbuf = new byte[Math.Max(buffer.Length + minGrow, buffer.Length * 2)]; @@ -84,6 +104,20 @@ namespace IKVM.Reflection.Writer return buffer[pos]; } + // return the number of bytes that the compressed int at the current position takes + internal int GetCompressedIntLength() + { + switch (buffer[pos] & 0xC0) + { + default: + return 1; + case 0x80: + return 2; + case 0xC0: + return 4; + } + } + internal void Write(byte[] value) { if (pos + value.Length > buffer.Length) @@ -259,8 +293,9 @@ namespace IKVM.Reflection.Writer internal byte[] ToArray() { - byte[] buf = new byte[pos]; - Buffer.BlockCopy(buffer, 0, buf, 0, pos); + int len = this.Length; + byte[] buf = new byte[len]; + Buffer.BlockCopy(buffer, 0, buf, 0, len); return buf; } diff --git a/mcs/class/IKVM.Reflection/Writer/ModuleWriter.cs b/mcs/class/IKVM.Reflection/Writer/ModuleWriter.cs index 64cf009836b..697ae974d99 100644 --- a/mcs/class/IKVM.Reflection/Writer/ModuleWriter.cs +++ b/mcs/class/IKVM.Reflection/Writer/ModuleWriter.cs @@ -385,7 +385,7 @@ namespace IKVM.Reflection.Writer stream.Seek(strongNameSignatureLength, SeekOrigin.Current); HashChunk(stream, cs, buf, (int)(stream.Length - (strongNameSignatureFileOffset + strongNameSignatureLength))); } - using (RSA rsa = CryptoHack.CreateRSA(keyPair)) + using (RSA rsa = keyPair.CreateRSA()) { RSAPKCS1SignatureFormatter sign = new RSAPKCS1SignatureFormatter(rsa); byte[] signature = sign.CreateSignature(hash); diff --git a/mcs/class/IKVM.Reflection/Writer/TextSection.cs b/mcs/class/IKVM.Reflection/Writer/TextSection.cs index 2cb91efdf34..5462b3be47c 100644 --- a/mcs/class/IKVM.Reflection/Writer/TextSection.cs +++ b/mcs/class/IKVM.Reflection/Writer/TextSection.cs @@ -299,6 +299,7 @@ namespace IKVM.Reflection.Writer internal void Write(MetadataWriter mw, uint sdataRVA) { // Now that we're ready to start writing, we need to do some fix ups + moduleBuilder.TypeRef.Fixup(moduleBuilder); moduleBuilder.MethodDef.Fixup(this); moduleBuilder.MethodImpl.Fixup(moduleBuilder); moduleBuilder.MethodSemantics.Fixup(moduleBuilder); @@ -313,6 +314,8 @@ namespace IKVM.Reflection.Writer moduleBuilder.FieldLayout.Fixup(moduleBuilder); moduleBuilder.FieldRVA.Fixup(moduleBuilder, (int)sdataRVA, (int)this.MethodBodiesRVA); moduleBuilder.ImplMap.Fixup(moduleBuilder); + moduleBuilder.ExportedType.Fixup(moduleBuilder); + moduleBuilder.ManifestResource.Fixup(moduleBuilder); moduleBuilder.MethodSpec.Fixup(moduleBuilder); moduleBuilder.GenericParamConstraint.Fixup(moduleBuilder); diff --git a/mcs/class/IKVM.Reflection/reflect.build b/mcs/class/IKVM.Reflection/reflect.build index 4b698860e51..f9c935bf22e 100644 --- a/mcs/class/IKVM.Reflection/reflect.build +++ b/mcs/class/IKVM.Reflection/reflect.build @@ -77,8 +77,6 @@ - - diff --git a/mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs b/mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs index 7a2cbb4cf51..39fc0acfe0a 100644 --- a/mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs +++ b/mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs @@ -38,7 +38,6 @@ using System.Diagnostics; [assembly: AssemblyKeyFile("../ecma.pub")] [assembly: AssemblyFileVersion (Consts.FxFileVersion)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Dependency ("System.Drawing,", LoadHint.Always)] [assembly: Dependency ("System,", LoadHint.Always)] diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AxHost.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AxHost.cs index 0021db522fc..17b5568e906 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AxHost.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AxHost.cs @@ -184,15 +184,20 @@ namespace System.Windows.Forms { #endregion // AxHost.StateConverter Class #endregion // AxHost Subclasses + private int flags; + private Guid clsid; + #region Protected Constructors - protected AxHost (string clsid) + + protected AxHost (string clsid) : this(clsid, 0) { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + } protected AxHost (string clsid, int flags) { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + this.clsid = new Guid(clsid); + this.flags = flags; } #endregion // Public Instance Properties @@ -201,10 +206,10 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public override Color BackColor { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.BackColor; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.BackColor = value; } } @@ -213,11 +218,11 @@ namespace System.Windows.Forms { [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] public override Image BackgroundImage { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.BackgroundImage; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.BackgroundImage = value; } } @@ -226,11 +231,11 @@ namespace System.Windows.Forms { [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] public override ImageLayout BackgroundImageLayout { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.BackgroundImageLayout; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.BackgroundImageLayout = value; } } @@ -251,11 +256,11 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public override ContextMenu ContextMenu { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.ContextMenu; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.ContextMenu = value; } } @@ -263,11 +268,11 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public override Cursor Cursor { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.Cursor; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.Cursor = value; } } @@ -284,11 +289,11 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public new virtual bool Enabled { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.Enabled; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.Enabled = value; } } @@ -296,11 +301,11 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public override Font Font { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.Font; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.Font = value; } } @@ -308,11 +313,11 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public override Color ForeColor { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.ForeColor; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.ForeColor = value; } } @@ -330,10 +335,10 @@ namespace System.Windows.Forms { [EditorBrowsable (EditorBrowsableState.Never)] public new ImeMode ImeMode { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.ImeMode; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.ImeMode = value; } } @@ -356,11 +361,12 @@ namespace System.Windows.Forms { [Localizable (true)] public new virtual bool RightToLeft { get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + return base.RightToLeft == System.Windows.Forms.RightToLeft.Yes; } set { - throw new NotImplementedException("COM/ActiveX support is not implemented"); + base.RightToLeft = (value ? System.Windows.Forms.RightToLeft.Yes : + System.Windows.Forms.RightToLeft.No); } } @@ -380,9 +386,7 @@ namespace System.Windows.Forms { #region Protected Instance Properties protected override CreateParams CreateParams { - get { - throw new NotImplementedException("COM/ActiveX support is not implemented"); - } + get { return base.CreateParams; } } protected override Size DefaultSize { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs index 674da0583bf..59d0086aafb 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs @@ -66,7 +66,7 @@ namespace System.Windows.Forms { IntPtr clipboard_handle; clipboard_handle = XplatUI.ClipboardOpen (false); - XplatUI.ClipboardStore (clipboard_handle, null, 0, null); + XplatUI.ClipboardStore (clipboard_handle, null, 0, null, false); } public static bool ContainsAudio () @@ -240,7 +240,7 @@ namespace System.Windows.Forms { converter = new XplatUI.ObjectToClipboard(ConvertToClipboardData); clipboard_handle = XplatUI.ClipboardOpen(false); - XplatUI.ClipboardStore(clipboard_handle, null, 0, null); // Empty clipboard + XplatUI.ClipboardStore(clipboard_handle, null, 0, null, copy); // Empty clipboard native_format = -1; @@ -261,7 +261,7 @@ namespace System.Windows.Forms { if (IsDataSerializable (obj)) item_format.is_serializable = true; - XplatUI.ClipboardStore(clipboard_handle, obj, native_format, converter); + XplatUI.ClipboardStore(clipboard_handle, obj, native_format, converter, copy); } } else { item_format = DataFormats.Format.Find(data.GetType().FullName); @@ -269,7 +269,7 @@ namespace System.Windows.Forms { native_format = item_format.Id; } - XplatUI.ClipboardStore(clipboard_handle, data, native_format, converter); + XplatUI.ClipboardStore(clipboard_handle, data, native_format, converter, copy); } XplatUI.ClipboardClose(clipboard_handle); } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs index 3d038b35706..88f50eff784 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs @@ -33,6 +33,7 @@ using System.Drawing; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; +using System.Diagnostics; namespace System.Windows.Forms { @@ -746,22 +747,22 @@ namespace System.Windows.Forms return; } - // do nothing if value exactly matches text of selected item - if (SelectedItem != null && string.Compare (value, GetItemText (SelectedItem), false, CultureInfo.CurrentCulture) == 0) - return; - - // find exact match using case-sensitive comparison, and if does - // not result in any match then use case-insensitive comparison - int index = FindStringExact (value, -1, false); - if (index == -1) { - index = FindStringExact (value, -1, true); - } - if (index != -1) { - SelectedIndex = index; - return; + // don't set the index if value exactly matches text of selected item + if (SelectedItem == null || string.Compare (value, GetItemText (SelectedItem), false, CultureInfo.CurrentCulture) != 0) + { + // find exact match using case-sensitive comparison, and if does + // not result in any match then use case-insensitive comparison + int index = FindStringExact (value, -1, false); + if (index == -1) { + index = FindStringExact (value, -1, true); + } + if (index != -1) { + SelectedIndex = index; + return; + } } - // set directly the passed value, since we already know it's not matching any item + // set directly the passed value if (dropdown_style != ComboBoxStyle.DropDownList) textbox_ctrl.Text = value; } @@ -949,6 +950,29 @@ namespace System.Windows.Forms base.OnDataSourceChanged (e); BindDataItems (); + /** + ** This 'Debugger.IsAttached' hack is here because of + ** Xamarin Bug #2234, which noted that when changing + ** the DataSource, in Windows exceptions are eaten + ** when SelectedIndexChanged is fired. However, when + ** the debugger is running (i.e. in MonoDevelop), we + ** want to be alerted of exceptions. + **/ + + if (Debugger.IsAttached) { + SetSelectedIndex (); + } else { + try { + SetSelectedIndex (); + } catch { + //ignore exceptions here per + //bug 2234 + } + } + } + + private void SetSelectedIndex () + { if (DataSource == null || DataManager == null) { SelectedIndex = -1; } @@ -2091,11 +2115,9 @@ namespace System.Windows.Forms { if (value == null) return; - - if (IndexOf (value) == owner.SelectedIndex) - owner.SelectedIndex = -1; - - RemoveAt (IndexOf (value)); + int index = IndexOf (value); + if (index >= 0) + RemoveAt (index); } public void RemoveAt (int index) @@ -2103,7 +2125,9 @@ namespace System.Windows.Forms if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException ("index"); - if (index == owner.SelectedIndex) + if (index < owner.SelectedIndex) + --owner.SelectedIndex; + else if (index == owner.SelectedIndex) owner.SelectedIndex = -1; object removed = object_items [index]; diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs index a895b094f67..95de9a40aa4 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs @@ -2455,6 +2455,7 @@ namespace System.Windows.Forms [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public virtual Rectangle DisplayRectangle { get { + // for the control class the DisplayRectangle == ClientRectangle return ClientRectangle; } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs index 29fbae3d9b4..ed609c53d6d 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs @@ -2654,7 +2654,12 @@ namespace System.Windows.Forms XplatUI.ScrollWindow (Handle, area, pixels, 0, false); int pixel_offset = GetColumnStartingPixel (CurrentColumn); - int next_pixel_offset = pixel_offset + CurrentTableStyle.GridColumnStyles[CurrentColumn].Width; + int next_pixel_offset = pixel_offset; + + if (CurrentColumn < CurrentTableStyle.GridColumnStyles.Count) + { + next_pixel_offset += CurrentTableStyle.GridColumnStyles[CurrentColumn].Width; + } if (pixel_offset >= horiz_pixeloffset && next_pixel_offset < horiz_pixeloffset + cells_area.Width) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs index 358207b51ea..ebb3743eb95 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs @@ -740,7 +740,7 @@ namespace System.Windows.Forms { ClearBinding (); - // Do not set dataSource prior to te BindingContext check because there is some lazy initialization + // Do not set dataSource prior to the BindingContext check because there is some lazy initialization // code which might result in double call to ReBind here and in OnBindingContextChanged if (BindingContext != null) { dataSource = value; @@ -1036,8 +1036,14 @@ namespace System.Windows.Forms { } else if (value > rows.Count) { // If we need to add rows and don't have any columns, // we create one column - if (ColumnCount == 0) - ColumnCount = 1; + if (ColumnCount == 0) { + System.Diagnostics.Debug.Assert (rows.Count == 0); + ColumnCount = 1; // this creates the edit row + if (VirtualMode) { + // update edit row height + UpdateRowHeightInfo (0, false); + } + } List newRows = new List (value - rows.Count); for (int i = rows.Count; i < value; i++) @@ -2320,8 +2326,8 @@ namespace System.Windows.Forms { // Call some functions that allows the editing control to get setup DataGridViewCellStyle style = cell.RowIndex == -1 ? DefaultCellStyle : cell.InheritedStyle; - cell.InitializeEditingControl (cell.RowIndex, cell.FormattedValue, style); + OnEditingControlShowing (new DataGridViewEditingControlShowingEventArgs (EditingControlInternal, style)); cell.PositionEditingControl (true, true, this.GetCellDisplayRectangle (cell.ColumnIndex, cell.RowIndex, false), bounds, style, false, false, (columns [cell.ColumnIndex].DisplayIndex == 0), (cell.RowIndex == 0)); // Show the editing control @@ -2491,7 +2497,8 @@ namespace System.Windows.Forms { currentCell.SetIsInEditMode (false); currentCell.DetachEditingControl (); OnCellEndEdit (new DataGridViewCellEventArgs (currentCell.ColumnIndex, currentCell.RowIndex)); - Focus (); + if (context != DataGridViewDataErrorContexts.LeaveControl) + Focus (); if (currentCell.RowIndex == NewRowIndex) { new_row_editing = false; editing_row = null; // editing row becomes a real row @@ -3984,6 +3991,10 @@ namespace System.Windows.Forms { internal void OnColumnPreRemovedInternal (DataGridViewColumnEventArgs e) { + // The removed column should be removed from the selection too. + if (selected_columns != null) + SetSelectedColumnCore (e.Column.Index, false); + if (Columns.Count - 1 == 0) { MoveCurrentCell (-1, -1, true, false, false, true); rows.ClearInternal (); @@ -4214,6 +4225,7 @@ namespace System.Windows.Forms { protected override void OnLeave (EventArgs e) { + EndEdit (DataGridViewDataErrorContexts.LeaveControl); base.OnLeave(e); } @@ -5073,6 +5085,11 @@ namespace System.Windows.Forms { MoveCurrentCell (ColumnDisplayIndexToIndex (0), 0, true, false, false, true); AutoResizeColumnsInternal (); + if (VirtualMode) { + for (int i = 0; i < e.RowCount; i++) + UpdateRowHeightInfo (e.RowIndex + i, false); + } + Invalidate (); OnRowsAdded (e); } @@ -5091,10 +5108,13 @@ namespace System.Windows.Forms { internal void OnRowsPreRemovedInternal (DataGridViewRowsRemovedEventArgs e) { + // All removed rows should be removed from the selection too. if (selected_rows != null) - selected_rows.InternalClear (); - if (selected_columns != null) - selected_columns.InternalClear (); + { + int lastRowIndex = e.RowIndex + e.RowCount; + for (int rowIndex = e.RowIndex; rowIndex < lastRowIndex; ++rowIndex) + SetSelectedRowCore (rowIndex, false); + } if (Rows.Count - e.RowCount <= 0) { MoveCurrentCell (-1, -1, true, false, false, true); @@ -5730,13 +5750,19 @@ namespace System.Windows.Forms { if (selected_columns == null) selected_columns = new DataGridViewSelectedColumnCollection (); - + + bool selectionChanged = false; if (!selected && selected_columns.Contains (col)) { selected_columns.InternalRemove (col); + selectionChanged = true; } else if (selected && !selected_columns.Contains (col)) { selected_columns.InternalAdd (col); + selectionChanged = true; } + if (selectionChanged) + OnSelectionChanged (EventArgs.Empty); + Invalidate(); } @@ -5752,13 +5778,19 @@ namespace System.Windows.Forms { if (selected_rows == null) selected_rows = new DataGridViewSelectedRowCollection (this); - + + bool selectionChanged = false; if (!selected && selected_rows.Contains (row)) { selected_rows.InternalRemove (row); + selectionChanged = true; } else if (selected && !selected_rows.Contains (row)) { selected_rows.InternalAdd (row); + selectionChanged = true; } + if (selectionChanged) + OnSelectionChanged (EventArgs.Empty); + Invalidate(); } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs index 09e250ed0b1..11693923507 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs @@ -220,8 +220,8 @@ namespace System.Windows.Forms { editingControl.DisplayMember = DisplayMember; } else { editingControl.Items.AddRange (this.Items); - if (FormattedValue != null && editingControl.Items.IndexOf (FormattedValue) != -1) - editingControl.SelectedItem = FormattedValue; + if (initialFormattedValue != null && editingControl.Items.IndexOf (initialFormattedValue) != -1) + editingControl.SelectedItem = initialFormattedValue; } } @@ -333,6 +333,24 @@ namespace System.Windows.Forms { base.OnLeave (rowIndex, throughMouseClick); } + protected override void OnMouseDown (DataGridViewCellMouseEventArgs e) { + base.OnMouseDown (e); + + if (!ReadOnly) + { + // Any mouse-click on the cell should be passed along to any + // combo-box control. + if (IsInEditMode) + { + DataGridViewComboBoxEditingControl cb + = (DataGridView.EditingControl + as DataGridViewComboBoxEditingControl); + if (cb != null) + cb.OnMouseDownInternal (e); + } + } + } + protected override void OnMouseClick (DataGridViewCellMouseEventArgs e) { base.OnMouseClick (e); } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxEditingControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxEditingControl.cs index 8a661d21edc..757cc6c138c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxEditingControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxEditingControl.cs @@ -91,6 +91,12 @@ namespace System.Windows.Forms { base.OnSelectedIndexChanged (e); } + // This internal method is needed by DataGridViewComboBoxCell + // to pass along user interaction with the cell. + internal void OnMouseDownInternal (DataGridViewCellMouseEventArgs e) + { + OnMouseDown (e); + } } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs index ad14ddaefbe..d7f84766858 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs @@ -1302,7 +1302,8 @@ namespace System.Windows.Forms rect.Width += hscrollbar.Value; } - Color fore_color = (state & DrawItemState.Selected) != 0 ? ThemeEngine.Current.ColorHighlightText : ForeColor; + Color fore_color = !Enabled ? ThemeEngine.Current.ColorGrayText : + (state & DrawItemState.Selected) != 0 ? ThemeEngine.Current.ColorHighlightText : ForeColor; OnDrawItem (new DrawItemEventArgs (dc, Font, rect, i, state, fore_color, BackColor)); } } @@ -2531,13 +2532,26 @@ namespace System.Windows.Forms public int Add (object item) { int idx; + object[] selectedItems = null; + + // we need to remember the original selected items so that we can update the indices + if (owner.sorted) { + selectedItems = new object[owner.SelectedItems.Count]; + owner.SelectedItems.CopyTo (selectedItems, 0); + } idx = AddItem (item); owner.CollectionChanged (); // If we are sorted, the item probably moved indexes, get the real one - if (owner.sorted) + if (owner.sorted) { + // update indices of selected items + owner.SelectedIndices.Clear (); + for (int i = 0; i < selectedItems.Length; i++) { + owner.SelectedIndex = this.IndexOf (selectedItems [i]); + } return this.IndexOf (item); + } return idx; } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs index a33e23fd6c7..05008ce8760 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs @@ -811,7 +811,8 @@ namespace System.Windows.Forms info.AddValue ("BackColor", BackColor); info.AddValue ("ForeColor", ForeColor); info.AddValue ("ImageKey", image_key); - info.AddValue ("Group", group); + if (group != null) + info.AddValue ("Group", group); if (sub_items.Count > 1) { info.AddValue ("SubItemCount", sub_items.Count); for (int i = 1; i < sub_items.Count; i++) { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs index 9d8e05df879..74903012d35 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs @@ -187,8 +187,14 @@ namespace System.Windows.Forms } protected override void Dispose (bool disposing) - { + { if (disposing) { + if (menu_items != null) { + // MenuItem.Dispose removes the item from the list + while (menu_items.Count > 0) { + menu_items [0].Dispose (); + } + } if (menu_handle != IntPtr.Zero) { menu_handle = IntPtr.Zero; } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs index 65a249d2466..2f0f032dc37 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs @@ -364,11 +364,13 @@ namespace System.Windows.Forms { display_rectangle = base.DisplayRectangle; } - if (dock_padding != null) { - display_rectangle.X += dock_padding.Left; - display_rectangle.Y += dock_padding.Top; - display_rectangle.Width -= dock_padding.Left + dock_padding.Right; - display_rectangle.Height -= dock_padding.Top + dock_padding.Bottom; + // DockPadding is the same as Padding (according to documentation) but is + // calculated lazily, so we use Padding here instead. + if (Padding != Padding.Empty) { + display_rectangle.X += Padding.Left; + display_rectangle.Y += Padding.Top; + display_rectangle.Width -= Padding.Horizontal; + display_rectangle.Height -= Padding.Vertical; } return display_rectangle; diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs index 380d11e8e0d..18ee3dd8117 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs @@ -187,8 +187,7 @@ namespace System.Windows.Forms internal abstract class Theme { protected Array syscolors; - private readonly Font default_font; - protected Font window_border_font; + Font default_font; protected Color defaultWindowBackColor; protected Color defaultWindowForeColor; internal SystemResPool ResPool = new SystemResPool (); @@ -196,8 +195,6 @@ namespace System.Windows.Forms protected Theme () { - default_font = SystemFonts.DefaultFont; - syscolors = null; } private void SetSystemColors (KnownColor kc, Color value) @@ -358,7 +355,7 @@ namespace System.Windows.Forms } public virtual Font DefaultFont { - get { return default_font; } + get { return default_font ?? (default_font = SystemFonts.DefaultFont); } } public virtual Color DefaultWindowBackColor { @@ -504,7 +501,7 @@ namespace System.Windows.Forms public virtual Font MenuFont { get { - return default_font; + return default_font ?? (default_font = SystemFonts.DefaultFont); } } @@ -558,10 +555,8 @@ namespace System.Windows.Forms } } - public virtual Font WindowBorderFont { - get { - return window_border_font; - } + public abstract Font WindowBorderFont { + get; } public int Clamp (int value, int lower, int upper) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index 1ce07bf75e2..6c181421d46 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -54,13 +54,15 @@ namespace System.Windows.Forms protected static StringFormat string_format_menu_text; protected static StringFormat string_format_menu_shortcut; protected static StringFormat string_format_menu_menubar_text; - static ImageAttributes imagedisabled_attributes = null; + static ImageAttributes imagedisabled_attributes; + Font window_border_font; const int SEPARATOR_HEIGHT = 6; const int SEPARATOR_MIN_WIDTH = 20; const int SM_CXBORDER = 1; const int SM_CYBORDER = 1; const int MENU_TAB_SPACE = 8; // Pixels added to the width of an item because of a tabd const int MENU_BAR_ITEMS_SPACE = 8; // Space between menu bar items + const int CheckSize = 13; #region Principal Theme Methods public ThemeWin32Classic () @@ -71,7 +73,7 @@ namespace System.Windows.Forms public override void ResetDefaults() { defaultWindowBackColor = this.ColorWindow; defaultWindowForeColor = this.ColorControlText; - window_border_font = new Font(FontFamily.GenericSansSerif, 8.25f, FontStyle.Bold); + window_border_font = null; /* Menu string formats */ string_format_menu_text = new StringFormat (); @@ -106,6 +108,12 @@ namespace System.Windows.Forms return XplatUI.VerticalScrollBarWidth; } } + + public override Font WindowBorderFont { + get { + return window_border_font ?? (window_border_font = new Font(FontFamily.GenericSansSerif, 8.25f, FontStyle.Bold)); + } + } #endregion // Principal Theme Methods @@ -360,7 +368,7 @@ namespace System.Windows.Forms { Image image = button.Image; string text = button.Text; - Rectangle content_rect = button.ClientRectangle; + Rectangle content_rect = button.PaddingClientRectangle; Size text_size = TextRenderer.MeasureTextInternal (text, button.Font, content_rect.Size, button.TextFormatFlags, button.UseCompatibleTextRendering); Size image_size = image == null ? Size.Empty : image.Size; @@ -947,15 +955,15 @@ namespace System.Windows.Forms public override void CalculateCheckBoxTextAndImageLayout (ButtonBase button, Point p, out Rectangle glyphArea, out Rectangle textRectangle, out Rectangle imageRectangle) { - int check_size = 13; - + int check_size = CheckSize; + if (button is CheckBox) - check_size = (button as CheckBox).Appearance == Appearance.Normal ? 13 : 0; + check_size = (button as CheckBox).Appearance == Appearance.Normal ? check_size : 0; - glyphArea = new Rectangle (0, 2, check_size, check_size); + glyphArea = new Rectangle (button.Padding.Left, button.Padding.Top, check_size, check_size); - Rectangle content_rect = button.ClientRectangle; - ContentAlignment align = ContentAlignment.TopLeft;; + Rectangle content_rect = button.PaddingClientRectangle; + ContentAlignment align = ContentAlignment.TopLeft; if (button is CheckBox) align = (button as CheckBox).CheckAlign; @@ -964,42 +972,42 @@ namespace System.Windows.Forms switch (align) { case ContentAlignment.BottomCenter: - glyphArea.Y = button.Height - check_size; - glyphArea.X = (button.Width - check_size) / 2 - 2; + glyphArea.Y += content_rect.Height - check_size - 2; + glyphArea.X += (content_rect.Width - check_size) / 2; break; case ContentAlignment.BottomLeft: - glyphArea.Y = button.Height - check_size - 2; + glyphArea.Y += content_rect.Height - check_size - 2; content_rect.Width -= check_size; content_rect.Offset (check_size, 0); break; case ContentAlignment.BottomRight: - glyphArea.Y = button.Height - check_size - 2; - glyphArea.X = button.Width - check_size; + glyphArea.Y += content_rect.Height - check_size - 2; + glyphArea.X += content_rect.Width - check_size; content_rect.Width -= check_size; break; case ContentAlignment.MiddleCenter: - glyphArea.Y = (button.Height - check_size) / 2; - glyphArea.X = (button.Width - check_size) / 2; + glyphArea.Y += (content_rect.Height - check_size) / 2; + glyphArea.X += (content_rect.Width - check_size) / 2; break; case ContentAlignment.MiddleLeft: - glyphArea.Y = (button.Height - check_size) / 2; + glyphArea.Y += (content_rect.Height - check_size) / 2; content_rect.Width -= check_size; content_rect.Offset (check_size, 0); break; case ContentAlignment.MiddleRight: - glyphArea.Y = (button.Height - check_size) / 2; - glyphArea.X = button.Width - check_size; + glyphArea.Y += (content_rect.Height - check_size) / 2; + glyphArea.X += content_rect.Width - check_size; content_rect.Width -= check_size; break; case ContentAlignment.TopCenter: - glyphArea.X = (button.Width - check_size) / 2; + glyphArea.X += (content_rect.Width - check_size) / 2; break; case ContentAlignment.TopLeft: content_rect.Width -= check_size; content_rect.Offset (check_size, 0); break; case ContentAlignment.TopRight: - glyphArea.X = button.Width - check_size; + glyphArea.X += content_rect.Width - check_size; content_rect.Width -= check_size; break; } @@ -1011,7 +1019,7 @@ namespace System.Windows.Forms // Force wrapping if we aren't AutoSize and our text is too long if (!button.AutoSize) - proposed.Width = button.Width - glyphArea.Width - 2; + proposed.Width = button.PaddingClientRectangle.Width - glyphArea.Width - 2; Size text_size = TextRenderer.MeasureTextInternal (text, button.Font, proposed, button.TextFormatFlags, button.UseCompatibleTextRendering); @@ -1028,58 +1036,58 @@ namespace System.Windows.Forms case TextImageRelation.Overlay: // Text is centered vertically, and 2 pixels to the right textRectangle.X = content_rect.Left + 2; - textRectangle.Y = ((content_rect.Height - text_size.Height) / 2) - 1; + textRectangle.Y = button.PaddingClientRectangle.Top + ((content_rect.Height - text_size.Height) / 2) - 1; textRectangle.Size = text_size; // Image is dependent on ImageAlign if (image == null) return; - int image_x = 0; - int image_y = 0; + int image_x = button.PaddingClientRectangle.Left; + int image_y = button.PaddingClientRectangle.Top; int image_height = image.Height; int image_width = image.Width; switch (button.ImageAlign) { case System.Drawing.ContentAlignment.TopLeft: - image_x = 5; - image_y = 5; + image_x += 5; + image_y += 5; break; case System.Drawing.ContentAlignment.TopCenter: - image_x = (content_rect.Width - image_width) / 2; - image_y = 5; + image_x += (content_rect.Width - image_width) / 2; + image_y += 5; break; case System.Drawing.ContentAlignment.TopRight: - image_x = content_rect.Width - image_width - 5; - image_y = 5; + image_x += content_rect.Width - image_width - 5; + image_y += 5; break; case System.Drawing.ContentAlignment.MiddleLeft: - image_x = 5; - image_y = (content_rect.Height - image_height) / 2; + image_x += 5; + image_y += (content_rect.Height - image_height) / 2; break; case System.Drawing.ContentAlignment.MiddleCenter: - image_x = (content_rect.Width - image_width) / 2; - image_y = (content_rect.Height - image_height) / 2; + image_x += (content_rect.Width - image_width) / 2; + image_y += (content_rect.Height - image_height) / 2; break; case System.Drawing.ContentAlignment.MiddleRight: - image_x = content_rect.Width - image_width - 4; - image_y = (content_rect.Height - image_height) / 2; + image_x += content_rect.Width - image_width - 4; + image_y += (content_rect.Height - image_height) / 2; break; case System.Drawing.ContentAlignment.BottomLeft: - image_x = 5; - image_y = content_rect.Height - image_height - 4; + image_x += 5; + image_y += content_rect.Height - image_height - 4; break; case System.Drawing.ContentAlignment.BottomCenter: - image_x = (content_rect.Width - image_width) / 2; - image_y = content_rect.Height - image_height - 4; + image_x += (content_rect.Width - image_width) / 2; + image_y += content_rect.Height - image_height - 4; break; case System.Drawing.ContentAlignment.BottomRight: - image_x = content_rect.Width - image_width - 4; - image_y = content_rect.Height - image_height - 4; + image_x += content_rect.Width - image_width - 4; + image_y += content_rect.Height - image_height - 4; break; default: - image_x = 5; - image_y = 5; + image_x += 5; + image_y += 5; break; } @@ -1149,7 +1157,7 @@ namespace System.Windows.Forms Rectangle client_rectangle; Rectangle text_rectangle; Rectangle checkbox_rectangle; - int checkmark_size=13; + int checkmark_size = CheckSize; int checkmark_space = 4; client_rectangle = checkbox.ClientRectangle; @@ -1505,7 +1513,7 @@ namespace System.Windows.Forms if (ctrl.ThreeDCheckBoxes == false) state |= ButtonState.Flat; - Rectangle checkbox_rect = new Rectangle (2, (item_rect.Height - 11) / 2, 13, 13); + Rectangle checkbox_rect = new Rectangle (2, (item_rect.Height - 11) / 2, CheckSize, CheckSize); ControlPaint.DrawCheckBox (e.Graphics, item_rect.X + checkbox_rect.X, item_rect.Y + checkbox_rect.Y, checkbox_rect.Width, checkbox_rect.Height, diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs index 1cd5df05bdd..d085afe6bc8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs @@ -192,12 +192,18 @@ namespace System.Windows.Forms protected virtual void OnRenderItemBackground (ToolStripItemRenderEventArgs e) { - if (e.Item.BackgroundImage != null) { + if (e.Item.BackColor != Control.DefaultBackColor) { + // Only paint the BackColor if it's not the default one, + // to avoid painting a solid background color over the parent ToolStrip gradient. Rectangle item_bounds = new Rectangle (0, 0, e.Item.Width, e.Item.Height); e.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (e.Item.BackColor), item_bounds); + } + + if (e.Item.BackgroundImage != null) { + Rectangle item_bounds = new Rectangle (0, 0, e.Item.Width, e.Item.Height); DrawBackground (e.Graphics, item_bounds, e.Item.BackgroundImage, e.Item.BackgroundImageLayout); } - + ToolStripItemRenderEventHandler eh = (ToolStripItemRenderEventHandler)Events [RenderItemBackgroundEvent]; if (eh != null) eh (this, e); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs index bb116933814..bd5557091ec 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs @@ -353,6 +353,8 @@ namespace System.Windows.Forms { tree_view.RecalculateVisibleOrder (prev); if (removed == tree_view.SelectedNode) { + if (removed.IsExpanded) + removed.Collapse(); // Fix Xamarin Bugzilla 5010. re_set_selected = true; OpenTreeNodeEnumerator oe = new OpenTreeNodeEnumerator (removed); if (oe.MoveNext () && oe.MoveNext ()) { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11DesktopColors.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11DesktopColors.cs index 4f79b8162a5..a1389ca77c3 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11DesktopColors.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11DesktopColors.cs @@ -112,16 +112,12 @@ namespace System.Windows.Forms { ThemeEngine.Current.ColorControlText = ColorFromGdkColor (style.fg[0]); ThemeEngine.Current.ColorControlDark = ColorFromGdkColor (style.dark[0]); ThemeEngine.Current.ColorControlLight = ColorFromGdkColor (style.light[0]); - ThemeEngine.Current.ColorControlLightLight = ControlPaint.Light(ColorFromGdkColor (style.light[0])); - ThemeEngine.Current.ColorControlDarkDark = ControlPaint.Dark(ColorFromGdkColor (style.dark[0])); + ThemeEngine.Current.ColorControlLightLight = ControlPaint.Light (ThemeEngine.Current.ColorControlLight); + ThemeEngine.Current.ColorControlDarkDark = ControlPaint.Dark (ThemeEngine.Current.ColorControlDark); - // We don't want ControlLight and ControlLightLight to disappear on a white background! - Color white = Color.FromArgb(255, 255, 255, 255); - if (ThemeEngine.Current.ColorControlLight.ToArgb() == white.ToArgb()) { - ThemeEngine.Current.ColorControlLight = Color.FromArgb (255, 190, 190, 190); - } - if (ThemeEngine.Current.ColorControlLightLight.ToArgb() == white.ToArgb()) { - ThemeEngine.Current.ColorControlLightLight = Color.FromArgb (255, 220, 220, 220); + // We don't want ControlLight to disappear on a white background! + if (ThemeEngine.Current.ColorControlLight.ToArgb () == Color.White.ToArgb ()) { + ThemeEngine.Current.ColorControlLight = Color.FromArgb (255, 227, 227, 227); } widget = gtk_menu_new (); gtk_widget_ensure_style (widget); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs index dcebf2fe479..89f91da939c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs @@ -549,10 +549,10 @@ namespace System.Windows.Forms { return driver.ClipboardOpen (primary_selection); } - internal static void ClipboardStore (IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) + internal static void ClipboardStore (IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter, bool copy) { - DriverDebug ("ClipboardStore ({0:X}, {1}, {2}): Called", handle.ToInt32 (), obj, type, converter); - driver.ClipboardStore (handle, obj, type, converter); + DriverDebug ("ClipboardStore ({0:X}, {1}, {2}, {3}, {4}): Called", handle.ToInt32 (), obj, type, converter, copy); + driver.ClipboardStore (handle, obj, type, converter, copy); } internal static object ClipboardRetrieve (IntPtr handle, int type, XplatUI.ClipboardToObject converter) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs index 47e0c9f845a..18afe41221f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs @@ -874,7 +874,7 @@ namespace System.Windows.Forms { return Carbon.Pasteboard.Retrieve (handle, type); } - internal override void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) { + internal override void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter, bool copy) { Carbon.Pasteboard.Store (handle, obj, type); } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs index 3adc21522ff..b79b967566c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs @@ -399,7 +399,7 @@ namespace System.Windows.Forms { internal abstract void ClipboardClose(IntPtr handle); internal abstract IntPtr ClipboardOpen (bool primary_selection); internal abstract int ClipboardGetID(IntPtr handle, string format); - internal abstract void ClipboardStore(IntPtr handle, object obj, int id, XplatUI.ObjectToClipboard converter); + internal abstract void ClipboardStore(IntPtr handle, object obj, int id, XplatUI.ObjectToClipboard converter, bool copy); internal abstract int[] ClipboardAvailableFormats(IntPtr handle); internal abstract object ClipboardRetrieve(IntPtr handle, int id, XplatUI.ClipboardToObject converter); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs index 4f27cd71352..efc464d5d12 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs @@ -2908,7 +2908,8 @@ namespace System.Windows.Forms { } - internal override void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) { + internal override void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter, bool copy) + { byte[] data = null; if (handle != clip_magic) { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index c903781a906..9b6c13014ae 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -1270,9 +1270,20 @@ namespace System.Windows.Forms { if ((long)nitems > 0) { if (property == (IntPtr)Atom.XA_STRING) { + // Xamarin-5116: PtrToStringAnsi expects to get UTF-8, but we might have + // Latin-1 instead. + var s = Marshal.PtrToStringAnsi (prop); + if (string.IsNullOrEmpty (s)) { + var sb = new StringBuilder (); + for (int i = 0; i < (int)nitems; i++) { + var b = Marshal.ReadByte (prop, i); + sb.Append ((char)b); + } + s = sb.ToString (); + } // Some X managers/apps pass unicode chars as escaped strings, so // we may need to unescape them. - Clipboard.Item = UnescapeUnicodeFromAnsi (Marshal.PtrToStringAnsi(prop)); + Clipboard.Item = UnescapeUnicodeFromAnsi (s); } else if (property == (IntPtr)Atom.XA_BITMAP) { // FIXME - convert bitmap to image } else if (property == (IntPtr)Atom.XA_PIXMAP) { @@ -1325,7 +1336,7 @@ namespace System.Windows.Forms { int length = 0; while (pos < value.Length) { - if (!Char.IsLetterOrDigit (value [pos])) + if (!ValidHexDigit (value [pos])) break; length++; pos++; @@ -1347,6 +1358,11 @@ namespace System.Windows.Forms { return sb.ToString (); } + private static bool ValidHexDigit (char e) + { + return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f'); + } + void AddExpose (Hwnd hwnd, bool client, int x, int y, int width, int height) { // Don't waste time if ((hwnd == null) || (x > hwnd.Width) || (y > hwnd.Height) || ((x + width) < 0) || ((y + height) < 0)) { @@ -2772,17 +2788,36 @@ namespace System.Windows.Forms { return Clipboard.Item; } - internal override void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) + internal override void ClipboardStore (IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter, bool copy) { Clipboard.Converter = converter; if (obj != null) { Clipboard.AddSource (type, obj); - XSetSelectionOwner(DisplayHandle, CLIPBOARD, FosterParent, IntPtr.Zero); + XSetSelectionOwner (DisplayHandle, CLIPBOARD, FosterParent, IntPtr.Zero); + + if (copy) { + try { + var clipboardAtom = gdk_atom_intern ("CLIPBOARD", true); + var clipboard = gtk_clipboard_get (clipboardAtom); + if (clipboard != null) { + // for now we only store text + var text = Clipboard.GetRtfText (); + if (string.IsNullOrEmpty (text)) + text = Clipboard.GetPlainText (); + if (!string.IsNullOrEmpty (text)) { + gtk_clipboard_set_text (clipboard, text, text.Length); + gtk_clipboard_store (clipboard); + } + } + } catch { + // ignore any errors - most likely because gtk isn't installed? + } + } } else { // Clearing the selection Clipboard.ClearSources (); - XSetSelectionOwner(DisplayHandle, CLIPBOARD, IntPtr.Zero, IntPtr.Zero); + XSetSelectionOwner (DisplayHandle, CLIPBOARD, IntPtr.Zero, IntPtr.Zero); } } @@ -7534,6 +7569,20 @@ namespace System.Windows.Forms { [DllImport ("libX11", EntryPoint="XGetInputFocus")] internal extern static void XGetInputFocus (IntPtr display, out IntPtr focus, out IntPtr revert_to); #endregion +#region Gtk/Gdk imports + [DllImport("libgdk-x11-2.0")] + internal extern static IntPtr gdk_atom_intern (string atomName, bool onlyIfExists); + + [DllImport("libgtk-x11-2.0")] + internal extern static IntPtr gtk_clipboard_get (IntPtr atom); + + [DllImport("libgtk-x11-2.0")] + internal extern static void gtk_clipboard_store (IntPtr clipboard); + + [DllImport("libgtk-x11-2.0")] + internal extern static void gtk_clipboard_set_text (IntPtr clipboard, string text, int len); +#endregion + #endif } } diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs index 66832bc9131..f90a1b98c12 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs @@ -24,6 +24,9 @@ // using System; +using System.CodeDom.Compiler; +using System.Diagnostics; +using System.IO; using System.Text; using System.Windows.Forms; using NUnit.Framework; @@ -99,6 +102,82 @@ namespace MonoTests.System.Windows.Forms public string Name; public int Id; } + + [Test] + public void DataRemainsOnClipboard_Xamarin4959 () + { + // Compile an app that puts something on the clipboard + var source = @" +using System; +using System.Windows.Forms; +public static class MainClass +{ + public static void Main () + { + Clipboard.SetDataObject (""testing bug 4959"", true, 10, 100); + } +} +"; + var exeName = Path.GetTempFileName (); + try { + var parameters = new CompilerParameters (); + parameters.GenerateExecutable = true; + parameters.ReferencedAssemblies.Add ("System.Windows.Forms.dll"); + parameters.OutputAssembly = exeName; + var compiler = CodeDomProvider.CreateProvider ("CSharp"); + var compilerResults = compiler.CompileAssemblyFromSource (parameters, source); + Assert.AreEqual (0, compilerResults.Errors.Count); + + // Execute the app + using (var app = Process.Start (exeName)) { + app.WaitForExit (); + } + + // Text should still be on the clipboard + Assert.AreEqual ("testing bug 4959", Clipboard.GetText ()); + } finally { + File.Delete (exeName); + } + } + + [Test] + public void DataGetsCleared_Xamarin4959 () + { + // This is the reverse of the previous test + + // Compile an app that puts something on the clipboard + var source = @" +using System; +using System.Windows.Forms; +public static class MainClass +{ + public static void Main () + { + Clipboard.SetDataObject (""testing bug 4959"", false, 10, 100); + } +} +"; + var exeName = Path.GetTempFileName (); + try { + var parameters = new CompilerParameters (); + parameters.GenerateExecutable = true; + parameters.ReferencedAssemblies.Add ("System.Windows.Forms.dll"); + parameters.OutputAssembly = exeName; + var compiler = CodeDomProvider.CreateProvider ("CSharp"); + var compilerResults = compiler.CompileAssemblyFromSource (parameters, source); + Assert.AreEqual (0, compilerResults.Errors.Count); + + // Execute the app + using (var app = Process.Start (exeName)) { + app.WaitForExit (); + } + + // Text should no longer be on the clipboard + Assert.IsTrue (string.IsNullOrEmpty (Clipboard.GetText ())); + } finally { + File.Delete (exeName); + } + } #endif } } diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs index 8b0389c1563..cbd3c2bbf00 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs @@ -847,6 +847,47 @@ namespace MonoTests.System.Windows.Forms ComboBox cmbbox = new ComboBox (); cmbbox.SelectedIndex = -2; } + + //Bug 2234 (Xamarin) : Test 1 + [Test] + public void VerifyNoExceptions2234() + { + using (Form form = new Form ()){ + ComboBox cmb = new ComboBox(); + form.Controls.Add (cmb); + form.Show (); + eventFired=false; //for sanity + + //Primary failure: if exception is raised when + // DataSource changes. We should "eat" the + // exception under this circumstance before + // it gets here. + cmb.SelectedIndexChanged += + new EventHandler(GenericHandlerWithException); + cmb.DataSource=new string[]{"One","Two","Three"}; + Assert.IsTrue(eventFired); + } + } + + //Bug 2234 (Xamarin) : Test 2 + [Test] + [ExpectedException (typeof (Exception))] + public void VerifyException2234() + { + using (Form form = new Form ()) + { + ComboBox cmb = new ComboBox(); + form.Controls.Add (cmb); + form.Show (); + cmb.SelectedIndexChanged += + new EventHandler(GenericHandlerWithException); + cmb.DataSource=new string[]{"One","Two","Three"}; + + //Here's where Exception Should raise normally + cmb.SelectedIndex=2; + } + } + // // Events @@ -864,6 +905,13 @@ namespace MonoTests.System.Windows.Forms eventFired = true; } + private void GenericHandlerWithException (object sender, EventArgs e) + { + eventFired = true; + throw new Exception("Crash!"); + } + + [Ignore ("Bugs in X11 prevent this test to run properly")] public void DrawItemEventTest () { @@ -950,6 +998,69 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual(false, eventFired, "SWI2"); } + [Test] + // Xamarin bug 5595 + // https://bugzilla.xamarin.com/show_bug.cgi?id=5595 + public void SelectionWithDeletion() + { + Form form = null; + + try + { + // Create a form with a combo box. + form = new Form (); + form.ShowInTaskbar = false; + ComboBox cb = new ComboBox (); + cb.DropDownStyle = ComboBoxStyle.DropDownList; + cb.Parent = form; + form.Show (); + + // Add some items to the combo box. + cb.Items.Add ("Item 0"); + cb.Items.Add ("Item 1"); + cb.Items.Add ("Item 2"); + + // Select the last item. + cb.SelectedIndex = 2; + Assert.AreEqual(2, cb.SelectedIndex, "SWD1"); + + // Show the combo box's dropdown. + cb.DroppedDown = true; + + // Display the results. + Application.DoEvents(); + + // Hide the combo box's dropdown. + cb.DroppedDown = false; + + // Display the results. + Application.DoEvents(); + + // Delete an item before the selection. + // That should move the selection down. + // Before the bug fix, it would remain 2. + cb.Items.RemoveAt (1); + Assert.AreEqual(1, cb.SelectedIndex, "SWD2"); + + // Show the combo box's dropdown. + // Before the bug fix, this would throw an + // ArgumentOutOfRangeException, because the + // selected index was still 2, and hence + // invalid.) + cb.DroppedDown = true; + Assert.AreEqual(1, cb.SelectedIndex, "SWD3"); + + // Display the results. + Application.DoEvents(); + } + finally + { + // Get rid of the form. + if (form != null) + form.Dispose (); + } + } + [Test] public void SelectionWithClear() { @@ -1121,6 +1232,16 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual ("BAD", cmbbox.Text, "#J2"); Assert.AreEqual (4, cmbbox.SelectedIndex, "#J3"); + cmbbox.Text = "Something"; + Assert.IsNotNull (cmbbox.Text, "#T1"); + Assert.AreEqual ("Something", cmbbox.Text, "#T2"); + Assert.AreEqual (4, cmbbox.SelectedIndex, "#T3"); + + cmbbox.Text = "BAD"; + Assert.IsNotNull (cmbbox.Text, "#U1"); + Assert.AreEqual ("BAD", cmbbox.Text, "#U2"); + Assert.AreEqual (4, cmbbox.SelectedIndex, "#U3"); + cmbbox.Text = "baD"; Assert.IsNotNull (cmbbox.Text, "#K1"); Assert.AreEqual ("Bad", cmbbox.Text, "#K2"); @@ -1545,6 +1666,8 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (1, col.Count, "#1"); col.Remove (null); Assert.AreEqual (1, col.Count, "#2"); + col.Remove ("Item3"); + Assert.AreEqual (1, col.Count, "#3"); } [Test] diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs index a02b45fd1a1..2b0a6a020fe 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs @@ -2948,6 +2948,19 @@ namespace MonoTests.System.Windows.Forms f.Show (); f.Dispose (); } + + [Test] + public void DisplayRectangle_SamePadding () + { + // The MSDN documentation says that for a control ClientRectangle == DisplayRectangle + using (var c = new Control ()) + { + c.Size = new Size (100, 100); + c.Padding = new Padding (4); + Assert.AreEqual (new Rectangle (0, 0, 100, 100), c.ClientRectangle); + Assert.AreEqual (c.ClientRectangle, c.DisplayRectangle); + } + } } [TestFixture] diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataBindingTests.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataBindingTests.cs index 7ad8f4a1204..e0261dc21bb 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataBindingTests.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataBindingTests.cs @@ -175,11 +175,7 @@ namespace MonoTests.System.Windows.Forms.DataBinding // Console.WriteLine (event_log); Assert.AreEqual ( -#if NET_2_0 "0: PositionChanged (to -1)\n1: ItemChanged (index = -1)\n2: PositionChanged (to -1)\n3: CurrentChanged\n4: CurrentItemChanged\n5: ItemChanged (index = -1)\n" -#else // NET_1_0 - "0: PositionChanged (to -1)\n1: ItemChanged (index = -1)\n2: ItemChanged (index = -1)\n" -#endif , event_log, "2"); Assert.AreEqual (0, cm.Count, "3"); @@ -229,18 +225,10 @@ namespace MonoTests.System.Windows.Forms.DataBinding Assert.AreEqual ( -#if NET_2_0 #if WITH_BINDINGS "0: CurrentChanged\n1: CurrentItemChanged\n2: PositionChanged (to 0)\n3: ItemChanged (index = -1)\n4: Binding.Format\n" #else "0: CurrentChanged\n1: CurrentItemChanged\n2: PositionChanged (to 0)\n3: ItemChanged (index = -1)\n" -#endif -#else // NET_1_0 -#if WITH_BINDINGS - "0: CurrentChanged\n1: PositionChanged (to 0)\n2: ItemChanged (index = -1)\n3: Binding.Format\n" -#else - "0: CurrentChanged\n1: PositionChanged (to 0)\n2: ItemChanged (index = -1)\n" -#endif #endif , event_log, "2"); } diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs index 3316764cead..3bd72416f9a 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs @@ -35,6 +35,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; @@ -45,6 +46,29 @@ namespace MonoTests.System.Windows.Forms [TestFixture] public class DataGridViewTest : TestHelper { + // Send a mouse event in Win32. + [DllImport ("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] + private static extern void mouse_event (long dwFlags, long dx, long dy, long dwData, long dwExtraInfo); + private const int MOUSEEVENTF_LEFTDOWN = 0x02; + private const int MOUSEEVENTF_LEFTUP = 0x04; + private const int MOUSEEVENTF_RIGHTDOWN = 0x08; + private const int MOUSEEVENTF_RIGHTUP = 0x10; + private const int MOUSEEVENTF_ABSOLUTE = 0x8000; + + // Set the mouse-pointer position in Win32. + [DllImport ("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] + private static extern long SetCursorPos (int x, int y); + + // Convert from window coordinates to screen coordinates in Win32. + [DllImport ("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] + private static extern bool ClientToScreen (IntPtr hWnd, ref Win32Point point); + [StructLayout (LayoutKind.Sequential)] + private struct Win32Point + { + public int x; + public int y; + }; + private DataGridView grid = null; [SetUp] @@ -737,6 +761,272 @@ namespace MonoTests.System.Windows.Forms } } + // For testing the editing-control-showing event. + int editingControlShowingTest_FoundColumns; + private void DataGridView_EditingControlShowingTest (object sender, + DataGridViewEditingControlShowingEventArgs e) + { + DataGridView dgv = sender as DataGridView; + if (dgv.CurrentCellAddress.X == 0) + { + // This is the name combo-box column. + // Remember that the event-handler was called for + // this column. + editingControlShowingTest_FoundColumns |= 1; + + // Get the combo-box and the column. + ComboBox cb = e.Control as ComboBox; + DataGridViewComboBoxColumn col + = dgv.Columns[0] as DataGridViewComboBoxColumn; + + // Since ObjectCollection doesn't support ToArray(), make + // a list of the items in the combo-box and in the column. + List itemList = new List (); + foreach (string item in cb.Items) + itemList.Add (item); + List expectedItemList = new List (); + foreach (string item in col.Items) + expectedItemList.Add (item); + + // Make sure the combo-box has the list of allowed + // items from the column. + string items = string.Join (",", itemList); + string expectedItems = string.Join (",", expectedItemList); + Assert.AreEqual (expectedItems, items, "1-1"); + + // Make sure the combo-box has the right selected item. + Assert.AreEqual ("Boswell", cb.Text, "1-2"); + } + else if (dgv.CurrentCellAddress.X == 1) + { + // This is the first-name text-box column. + // Remember that the event-handler was called for + // this column. + editingControlShowingTest_FoundColumns |= 2; + + // Get the text-box. + TextBox tb = e.Control as TextBox; + + // Make sure the text-box has the right contents. + Assert.AreEqual ("Miguel", tb.Text, "1-3"); + } + else if (dgv.CurrentCellAddress.X == 2) + { + // This is the chosen check-box column. + // Remember that the event-handler was called for + // this column. + editingControlShowingTest_FoundColumns |= 4; + + // Get the check-box. + CheckBox tb = e.Control as CheckBox; + + // Make sure the check-box has the right contents. + Assert.AreEqual (CheckState.Checked, tb.CheckState, "1-4"); + } + else + Assert.AreEqual (0, 1, "1-5"); + } + + [Test] // Xamarin bug 5419 + public void EditingControlShowingTest_Unbound () + { + using (DataGridView _dataGridView = new DataGridView ()) { + DataGridViewComboBoxColumn _nameComboBoxColumn; + DataGridViewTextBoxColumn _firstNameTextBoxColumn; + DataGridViewCheckBoxColumn _chosenCheckBoxColumn; + + // Add the event-handler. + _dataGridView.EditingControlShowing + += new DataGridViewEditingControlShowingEventHandler + (DataGridView_EditingControlShowingTest); + + // No columns have been found in the event-handler yet. + editingControlShowingTest_FoundColumns = 0; + + // _nameComboBoxColumn + _nameComboBoxColumn = new DataGridViewComboBoxColumn (); + _nameComboBoxColumn.HeaderText = "Name"; + _dataGridView.Columns.Add (_nameComboBoxColumn); + + // _firstNameTextBoxColumn + _firstNameTextBoxColumn = new DataGridViewTextBoxColumn (); + _firstNameTextBoxColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + _firstNameTextBoxColumn.HeaderText = "First Name"; + _dataGridView.Columns.Add (_firstNameTextBoxColumn); + + // _chosenCheckBoxColumn + _chosenCheckBoxColumn = new DataGridViewCheckBoxColumn (); + _chosenCheckBoxColumn.HeaderText = "Chosen"; + _dataGridView.Columns.Add (_chosenCheckBoxColumn); + + // .NET requires that all possible values for combo-boxes in a column + // are added to the column. + _nameComboBoxColumn.Items.Add ("de Icaza"); + _nameComboBoxColumn.Items.Add ("Toshok"); + _nameComboBoxColumn.Items.Add ("Harper"); + _nameComboBoxColumn.Items.Add ("Boswell"); + + // Set up the contents of the data-grid. + _dataGridView.Rows.Add ("de Icaza", "Miguel", true); + _dataGridView.Rows.Add ("Toshok", "Chris", false); + _dataGridView.Rows.Add ("Harper", "Jackson", false); + _dataGridView.Rows.Add ("Boswell", "Steven", true); + + // Edit a combo-box cell. + _dataGridView.CurrentCell = _dataGridView.Rows[3].Cells[0]; + Assert.AreEqual (true, _dataGridView.Rows[3].Cells[0].Selected, "1-6"); + Assert.AreEqual (true, _dataGridView.BeginEdit (false), "1-7"); + _dataGridView.CancelEdit(); + + // Edit a text-box cell. + _dataGridView.CurrentCell = _dataGridView.Rows[0].Cells[1]; + Assert.AreEqual (false, _dataGridView.Rows[3].Cells[0].Selected, "1-8"); + Assert.AreEqual (true, _dataGridView.Rows[0].Cells[1].Selected, "1-9"); + Assert.AreEqual (true, _dataGridView.BeginEdit (false), "1-10"); + _dataGridView.CancelEdit(); + + // Edit a check-box cell. + _dataGridView.CurrentCell = _dataGridView.Rows[3].Cells[2]; + Assert.AreEqual (false, _dataGridView.Rows[0].Cells[1].Selected, "1-11"); + Assert.AreEqual (true, _dataGridView.Rows[3].Cells[2].Selected, "1-12"); + Assert.AreEqual (true, _dataGridView.BeginEdit (false), "1-13"); + _dataGridView.CancelEdit(); + + // Make sure the event-handler was called each time. + // (DataGridViewCheckBoxCell isn't derived from Control, so the + // EditingControlShowing event doesn't get called for it.) + Assert.AreEqual (3, editingControlShowingTest_FoundColumns, "1-14"); + + _dataGridView.Dispose(); + } + } + + // A simple class, for testing the data-binding variant of the + // editing-control-showing event. + private class EcstRecord + { + string name; + string firstName; + bool chosen; + + public EcstRecord (string newName, string newFirstName, bool newChosen) + { + name = newName; + firstName = newFirstName; + chosen = newChosen; + } + public string Name + { + get { return name; } + set { name = value; } + } + public string FirstName + { + get { return firstName; } + set { firstName = value; } + } + public bool Chosen + { + get { return chosen; } + set { chosen = value; } + } + }; + + [Test] // Xamarin bug 5419 + public void EditingControlShowingTest_Bound () + { + using (DataGridView _dataGridView = new DataGridView ()) { + DataGridViewComboBoxColumn _nameComboBoxColumn; + DataGridViewTextBoxColumn _firstNameTextBoxColumn; + DataGridViewCheckBoxColumn _chosenCheckBoxColumn; + + _dataGridView.AutoGenerateColumns = false; + + // Add the event-handler. + _dataGridView.EditingControlShowing + += new DataGridViewEditingControlShowingEventHandler + (DataGridView_EditingControlShowingTest); + + // No columns have been found in the event-handler yet. + editingControlShowingTest_FoundColumns = 0; + + // _nameComboBoxColumn + _nameComboBoxColumn = new DataGridViewComboBoxColumn (); + _nameComboBoxColumn.HeaderText = "Name"; + _nameComboBoxColumn.DataPropertyName = "Name"; + _dataGridView.Columns.Add (_nameComboBoxColumn); + + // _firstNameTextBoxColumn + _firstNameTextBoxColumn = new DataGridViewTextBoxColumn (); + _firstNameTextBoxColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + _firstNameTextBoxColumn.HeaderText = "First Name"; + _firstNameTextBoxColumn.DataPropertyName = "FirstName"; + _dataGridView.Columns.Add (_firstNameTextBoxColumn); + + // _chosenCheckBoxColumn + _chosenCheckBoxColumn = new DataGridViewCheckBoxColumn (); + _chosenCheckBoxColumn.HeaderText = "Chosen"; + _chosenCheckBoxColumn.DataPropertyName = "Chosen"; + _chosenCheckBoxColumn.FalseValue = "false"; + _chosenCheckBoxColumn.TrueValue = "true"; + _dataGridView.Columns.Add (_chosenCheckBoxColumn); + + // .NET requires that all possible values for combo-boxes in a column + // are added to the column. + _nameComboBoxColumn.Items.Add ("de Icaza"); + _nameComboBoxColumn.Items.Add ("Toshok"); + _nameComboBoxColumn.Items.Add ("Harper"); + _nameComboBoxColumn.Items.Add ("Boswell"); + + // Set up the contents of the data-grid. + BindingList boundData = new BindingList (); + boundData.Add (new EcstRecord ("de Icaza", "Miguel", true)); + boundData.Add (new EcstRecord ("Toshok", "Chris", false)); + boundData.Add (new EcstRecord ("Harper", "Jackson", false)); + boundData.Add (new EcstRecord ("Boswell", "Steven", true)); + _dataGridView.DataSource = boundData; + + // For data binding to work, there needs to be a Form, apparently. + Form form = new Form (); + form.ShowInTaskbar = false; + form.Controls.Add (_dataGridView); + form.Show (); + + // Make sure the data-source took. + // (Without the Form, instead of having four rows, the data grid + // only has one row, and all its cell values are null.) + Assert.AreEqual (boundData.Count, _dataGridView.Rows.Count, "1-6"); + + // Edit a combo-box cell. + _dataGridView.CurrentCell = _dataGridView.Rows[3].Cells[0]; + Assert.AreEqual (true, _dataGridView.Rows[3].Cells[0].Selected, "1-7"); + Assert.AreEqual (true, _dataGridView.BeginEdit (false), "1-8"); + _dataGridView.CancelEdit(); + + // Edit a text-box cell. + _dataGridView.CurrentCell = _dataGridView.Rows[0].Cells[1]; + Assert.AreEqual (false, _dataGridView.Rows[3].Cells[0].Selected, "1-9"); + Assert.AreEqual (true, _dataGridView.Rows[0].Cells[1].Selected, "1-10"); + Assert.AreEqual (true, _dataGridView.BeginEdit (false), "1-11"); + _dataGridView.CancelEdit(); + + // Edit a check-box cell. + _dataGridView.CurrentCell = _dataGridView.Rows[3].Cells[2]; + Assert.AreEqual (false, _dataGridView.Rows[0].Cells[1].Selected, "1-12"); + Assert.AreEqual (true, _dataGridView.Rows[3].Cells[2].Selected, "1-13"); + Assert.AreEqual (true, _dataGridView.BeginEdit (false), "1-14"); + _dataGridView.CancelEdit(); + + // Make sure the event-handler was called each time. + // (DataGridViewCheckBoxCell isn't derived from Control, so the + // EditingControlShowing event doesn't get called for it.) + Assert.AreEqual (3, editingControlShowingTest_FoundColumns, "1-14"); + + // Get rid of the form. + form.Close(); + } + } + [Test] public void bug_81918 () { @@ -751,23 +1041,259 @@ namespace MonoTests.System.Windows.Forms } } + // A custom data-grid-view, created solely so that + // mouse clicks can be faked on it. + private class ClickableDataGridView : DataGridView + { + public ClickableDataGridView () + : base () + { + } + + internal void OnMouseDownInternal (MouseEventArgs e) + { + OnMouseDown (e); + } + + internal void OnMouseUpInternal (MouseEventArgs e) + { + OnMouseUp (e); + } + }; + + [Test] + public void OneClickComboBoxCell () + { + Form form = null; + + try + { + // Create a form, a text label, and a data-grid-view. + form = new Form (); + Label label = new Label (); + label.Text = "Label"; + label.Parent = form; + ClickableDataGridView dgv = new ClickableDataGridView (); + dgv.Parent = form; + + // Create a combo-box column. + DataGridViewComboBoxColumn cbCol = new DataGridViewComboBoxColumn (); + cbCol.HeaderText = "Name"; + dgv.Columns.Add (cbCol); + + // .NET requires that all possible values for combo-boxes + // in a column are added to the column. + cbCol.Items.Add ("Item1"); + cbCol.Items.Add ("Item2"); + cbCol.Items.Add ("Item3"); + cbCol.Items.Add ("Item4"); + + // Set up the contents of the data-grid. + dgv.Rows.Add ("Item1"); + dgv.Rows.Add ("Item2"); + + // Select the cell. + dgv.CurrentCell = dgv.Rows[0].Cells[0]; + + // Focus the data-grid-view. (Without this, its Leave + // event won't get called when something outside of the + // data-grid-view gets focused.) + dgv.Focus (); + + // Show the form, let it draw. + form.Show (); + Application.DoEvents (); + + // Locate the drop-down button. (This code is taken from mono-winforms, + // from the private method DataGridViewComboBoxCell.CalculateButtonArea(), + // and was then hacked mercilessly.) + Rectangle button_area = Rectangle.Empty; + { + int border = 3 /* ThemeEngine.Current.Border3DSize.Width */; + const int button_width = 16; + Rectangle text_area = dgv.GetCellDisplayRectangle (0, 0, false); + button_area.X = text_area.Right - button_width - border; + button_area.Y = text_area.Y + border; + button_area.Width = button_width; + button_area.Height = text_area.Height - 2 * border; + } + + // Click on the drop-down button. + int x = button_area.X + (button_area.Width / 2); + int y = button_area.Y + (button_area.Height / 2); + if (Environment.OSVersion.Platform == PlatformID.Win32NT + && Type.GetType ("Mono.Runtime") == null) + { + // Calling OnMouseDownInternal () in Win32 doesn't work. + // My best guess as to why is that the WinForms ComboBox + // is a wrapper around the ComCtl control, e.g. similar + // to the reason that Paint event-handlers don't work on + // TreeView. So we go through all this rigamarole to + // simulate a mouse click. + + // First, get the location of the desired mouse-click, in + // data-grid-view coordinates. + Win32Point ptGlobal = new Win32Point (); + ptGlobal.x = x + dgv.Location.X; + ptGlobal.y = y + dgv.Location.Y; + + // Convert that to screen coordinates. + ClientToScreen (form.Handle, ref ptGlobal); + + // Move the mouse-pointer there. (Yes, this really appears + // to be necessary.) + SetCursorPos (ptGlobal.x, ptGlobal.y); + + // Convert screen coordinates to mouse coordinates. + ptGlobal.x *= (65535 / SystemInformation.VirtualScreen.Width); + ptGlobal.y *= (65535 / SystemInformation.VirtualScreen.Height); + + // Finally, fire a mouse-down and mouse-up event. + mouse_event (MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE, + ptGlobal.x, ptGlobal.y, 0, 0); + mouse_event (MOUSEEVENTF_LEFTUP|MOUSEEVENTF_ABSOLUTE, + ptGlobal.x, ptGlobal.y, 0, 0); + + // Let the system process these events. + Application.DoEvents (); + } + else + { + // And this is how the same code is done under Linux. + // (No one should wonder why I prefer Mono to MS Windows .NET ;-) + MouseEventArgs me = new MouseEventArgs (MouseButtons.Left, 1, x, y, 0); + DataGridViewCellMouseEventArgs cme = new DataGridViewCellMouseEventArgs (0, 0, x, y, me); + dgv.OnMouseDownInternal (cme); + dgv.OnMouseUpInternal (cme); + } + + // Make sure that created an editing control. + ComboBox cb = dgv.EditingControl as ComboBox; + Assert.AreNotEqual (null, cb, "1-1"); + + // Make sure that dropped down the menu. + Assert.AreEqual (true, cb.DroppedDown, "1-2"); + + // Close the menu. + cb.DroppedDown = false; + + // Change the selection on the menu. + cb.SelectedIndex = 2 /* "Item3" */; + + // Leave the data-grid-view. + label.Focus (); + + // That should have ended editing and saved the value. + string cellValue = (string)(dgv.Rows[0].Cells[0].FormattedValue); + Assert.AreEqual ("Item3", cellValue, "1-3"); + } + finally + { + if (form != null) + form.Close (); + } + } + + // For testing row/column selection. + List> selections; + void DataGridView_RowSelectionChanged (object sender, EventArgs e) + { + // Make a list of selected rows. + DataGridView dgv = sender as DataGridView; + List selection = new List (); + foreach (DataGridViewRow row in dgv.SelectedRows) + selection.Add (row.Index); + selections.Add (selection); + } + void DataGridView_ColumnSelectionChanged (object sender, EventArgs e) + { + // Make a list of selected columns. + DataGridView dgv = sender as DataGridView; + List selection = new List (); + foreach (DataGridViewColumn column in dgv.SelectedColumns) + selection.Add (column.Index); + selections.Add (selection); + } + + // Used to generate printable representation of selections. + string ListListIntToString (List> selections) + { + List selectionsList = new List (); + foreach (List selection in selections) + { + List selectionList = new List (); + foreach (int selectionNo in selection) + selectionList.Add (selectionNo.ToString ("D")); + selectionsList.Add ("<" + string.Join (",", selectionList.ToArray()) + ">"); + } + return string.Join (",", selectionsList.ToArray()); + + // (Here is the disallowed Linq version.) + /* return string.Join (",", (selections.Select ((List x) + => "<" + string.Join (",", (x.Select ((int y) + => (y.ToString("D")))).ToArray()) + ">").ToArray())); */ + } + [Test] public void SelectedRowsTest () { using (DataGridView dgv = DataGridViewCommon.CreateAndFillBig ()) { dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + + // Prepare to test the SelectionChanged event. + selections = new List> (); + List> expectedSelections = new List> (); + dgv.SelectionChanged += new EventHandler (DataGridView_RowSelectionChanged); + + // Make sure there's no selection to begin with. + Assert.AreEqual (0, dgv.SelectedRows.Count, "1-10"); + + // Select a row. dgv.Rows [1].Selected = true; Assert.AreEqual (1, dgv.SelectedRows.Count, "1-1"); Assert.AreEqual (1, dgv.SelectedRows [0].Index, "1-2"); + expectedSelections.Add (new List { 1 }); + + // Select another row. dgv.Rows [3].Selected = true; Assert.AreEqual (2, dgv.SelectedRows.Count, "1-3"); Assert.AreEqual (3, dgv.SelectedRows [0].Index, "1-4"); Assert.AreEqual (1, dgv.SelectedRows [1].Index, "1-5"); + expectedSelections.Add (new List { 3, 1 }); + + // Select another row. dgv.Rows [2].Selected = true; Assert.AreEqual (3, dgv.SelectedRows.Count, "1-6"); Assert.AreEqual (2, dgv.SelectedRows [0].Index, "1-7"); Assert.AreEqual (3, dgv.SelectedRows [1].Index, "1-8"); Assert.AreEqual (1, dgv.SelectedRows [2].Index, "1-9"); + expectedSelections.Add (new List { 2, 3, 1 }); + + // Unselect a row. + dgv.Rows [2].Selected = false; + Assert.AreEqual (2, dgv.SelectedRows.Count, "1-11"); + Assert.AreEqual (3, dgv.SelectedRows [0].Index, "1-12"); + Assert.AreEqual (1, dgv.SelectedRows [1].Index, "1-13"); + expectedSelections.Add (new List { 3, 1 }); + + // Delete a row. + // Since the row wasn't selected, it doesn't fire a + // SelectionChanged event. + dgv.Rows.RemoveAt (2); + Assert.AreEqual (2, dgv.SelectedRows.Count, "1-14"); + Assert.AreEqual (2, dgv.SelectedRows [0].Index, "1-16"); + Assert.AreEqual (1, dgv.SelectedRows [1].Index, "1-17"); + + // Delete a selected row. + dgv.Rows.RemoveAt (2); + Assert.AreEqual (1, dgv.SelectedRows.Count, "1-18"); + Assert.AreEqual (1, dgv.SelectedRows [0].Index, "1-19"); + expectedSelections.Add (new List { 1 }); + + // Make sure the SelectionChanged event was called when expected. + string selectionsText = ListListIntToString (selections); + string expectedSelectionsText = ListListIntToString (expectedSelections); + Assert.AreEqual (expectedSelectionsText, selectionsText, "1-15"); } using (DataGridView dgv = DataGridViewCommon.CreateAndFillBig ()) { @@ -859,36 +1385,108 @@ namespace MonoTests.System.Windows.Forms foreach (DataGridViewColumn col in dgv.Columns) col.SortMode = DataGridViewColumnSortMode.NotSortable; dgv.SelectionMode = DataGridViewSelectionMode.FullColumnSelect; + + // Prepare to test the SelectionChanged event. + selections = new List> (); + List> expectedSelections = new List> (); + dgv.SelectionChanged += new EventHandler (DataGridView_ColumnSelectionChanged); + + // Make sure there's no selection to begin with. + Assert.AreEqual (0, dgv.SelectedColumns.Count, "1-13"); + + // Select a column. dgv.Columns [1].Selected = true; Assert.AreEqual (1, dgv.SelectedColumns.Count, "1-1"); Assert.AreEqual (1, dgv.SelectedColumns [0].Index, "1-2"); + expectedSelections.Add (new List { 1 }); + + // Select another column. dgv.Columns [3].Selected = true; Assert.AreEqual (2, dgv.SelectedColumns.Count, "1-3"); Assert.AreEqual (3, dgv.SelectedColumns [0].Index, "1-4"); Assert.AreEqual (1, dgv.SelectedColumns [1].Index, "1-5"); + expectedSelections.Add (new List { 3, 1 }); + + // Select another column. dgv.Columns [2].Selected = true; Assert.AreEqual (3, dgv.SelectedColumns.Count, "1-6"); Assert.AreEqual (2, dgv.SelectedColumns [0].Index, "1-7"); Assert.AreEqual (3, dgv.SelectedColumns [1].Index, "1-8"); Assert.AreEqual (1, dgv.SelectedColumns [2].Index, "1-9"); + expectedSelections.Add (new List { 2, 3, 1 }); + + // Unselect a column. + dgv.Columns [2].Selected = false; + Assert.AreEqual (2, dgv.SelectedColumns.Count, "1-10"); + Assert.AreEqual (3, dgv.SelectedColumns [0].Index, "1-11"); + Assert.AreEqual (1, dgv.SelectedColumns [1].Index, "1-12"); + expectedSelections.Add (new List { 3, 1 }); + + // Delete a column. + // Since the column wasn't selected, it doesn't fire a + // SelectionChanged event. + dgv.Columns.RemoveAt (2); + Assert.AreEqual (2, dgv.SelectedColumns.Count, "1-14"); + Assert.AreEqual (2, dgv.SelectedColumns [0].Index, "1-16"); + Assert.AreEqual (1, dgv.SelectedColumns [1].Index, "1-17"); + + // Delete a selected column. + dgv.Columns.RemoveAt (2); + Assert.AreEqual (1, dgv.SelectedColumns.Count, "1-18"); + Assert.AreEqual (1, dgv.SelectedColumns [0].Index, "1-19"); + expectedSelections.Add (new List { 1 }); + + // Make sure the SelectionChanged event was called when expected. + string selectionsText = ListListIntToString (selections); + string expectedSelectionsText = ListListIntToString (expectedSelections); + Assert.AreEqual (expectedSelectionsText, selectionsText, "1-15"); } using (DataGridView dgv = DataGridViewCommon.CreateAndFillBig ()) { foreach (DataGridViewColumn col in dgv.Columns) col.SortMode = DataGridViewColumnSortMode.NotSortable; dgv.SelectionMode = DataGridViewSelectionMode.ColumnHeaderSelect; + + // Prepare to test the SelectionChanged event. + selections = new List> (); + List> expectedSelections = new List> (); + dgv.SelectionChanged += new EventHandler (DataGridView_ColumnSelectionChanged); + + // Make sure there's no selection to begin with. + Assert.AreEqual (0, dgv.SelectedColumns.Count, "2-10"); + + // Select a column. dgv.Columns [1].Selected = true; Assert.AreEqual (1, dgv.SelectedColumns.Count, "2-1"); Assert.AreEqual (1, dgv.SelectedColumns [0].Index, "2-2"); + expectedSelections.Add (new List { 1 }); + + // Select another column. dgv.Columns [3].Selected = true; Assert.AreEqual (2, dgv.SelectedColumns.Count, "2-3"); Assert.AreEqual (3, dgv.SelectedColumns [0].Index, "2-4"); Assert.AreEqual (1, dgv.SelectedColumns [1].Index, "2-5"); + expectedSelections.Add (new List { 3, 1 }); + + // Select another column. dgv.Columns [2].Selected = true; Assert.AreEqual (3, dgv.SelectedColumns.Count, "2-6"); Assert.AreEqual (2, dgv.SelectedColumns [0].Index, "2-7"); Assert.AreEqual (3, dgv.SelectedColumns [1].Index, "2-8"); Assert.AreEqual (1, dgv.SelectedColumns [2].Index, "2-9"); + expectedSelections.Add (new List { 2, 3, 1 }); + + // Unselect another column. + dgv.Columns [2].Selected = false; + Assert.AreEqual (2, dgv.SelectedColumns.Count, "2-11"); + Assert.AreEqual (3, dgv.SelectedColumns [0].Index, "2-12"); + Assert.AreEqual (1, dgv.SelectedColumns [1].Index, "2-13"); + expectedSelections.Add (new List { 3, 1 }); + + // Make sure the SelectionChanged event was called when expected. + string selectionsText = ListListIntToString (selections); + string expectedSelectionsText = ListListIntToString (expectedSelections); + Assert.AreEqual (expectedSelectionsText, selectionsText, "2-14"); } using (DataGridView dgv = DataGridViewCommon.CreateAndFillBig ()) { @@ -1825,6 +2423,23 @@ namespace MonoTests.System.Windows.Forms DataGridView gdv = new DataGridView (); Assert.IsNull (gdv.RowTemplate.DataGridView, "#1"); } + + [Test] // Xamarin bug 2392 + public void RowHeightInVirtualMode () + { + using (var dgv = new DataGridView ()) { + dgv.RowHeightInfoNeeded += (sender, e) => { + e.Height = 50; + e.MinimumHeight = 30; + }; + dgv.VirtualMode = true; + dgv.RowCount = 2; + Assert.AreEqual (50, dgv.Rows [0].Height); + Assert.AreEqual (30, dgv.Rows [0].MinimumHeight); + Assert.AreEqual (50, dgv.Rows [1].Height); + Assert.AreEqual (30, dgv.Rows [1].MinimumHeight); + } + } } [TestFixture] diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs index 3b2a6b950b4..c72999b8ac9 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs @@ -854,6 +854,59 @@ namespace MonoTests.System.Windows.Forms } Assert.AreEqual ((Array)expectedAddPositions, (Array)addedAtList.ToArray (typeof (int)), "addedAtList"); } + + [Test] + public void SelectedIndexUpdated () // Xamarin bug 4921 + { + using (Form f = new Form ()) { + f.ShowInTaskbar = false; + + ListBox l = new ListBox (); + l.Sorted = true; + f.Controls.Add (l); + + l.Items.Add ("B"); + l.SelectedIndex = 0; + + Assert.AreEqual (0, l.SelectedIndex); + + l.Items.Add ("A"); + Assert.AreEqual (1, l.SelectedIndex); + } + } + + [Test] + public void SelectedIndexUpdated_MultiSelect () // Xamarin bug 4921 + { + using (Form f = new Form ()) { + f.ShowInTaskbar = false; + + ListBox l = new ListBox (); + l.Sorted = true; + l.SelectionMode = SelectionMode.MultiSimple; + f.Controls.Add (l); + + l.Items.Add ("B"); + l.Items.Add ("C"); + l.SelectedIndex = 0; + l.SelectedIndex = 1; + + Assert.AreEqual (2, l.SelectedIndices.Count); + Assert.AreEqual (0, l.SelectedIndices [0]); + Assert.AreEqual (1, l.SelectedIndices [1]); + Assert.AreEqual (2, l.SelectedItems.Count); + Assert.AreEqual ("B", l.SelectedItems [0]); + Assert.AreEqual ("C", l.SelectedItems [1]); + + l.Items.Add ("A"); + Assert.AreEqual (2, l.SelectedIndices.Count); + Assert.AreEqual (1, l.SelectedIndices[0]); + Assert.AreEqual (2, l.SelectedIndices[1]); + Assert.AreEqual (2, l.SelectedItems.Count); + Assert.AreEqual ("B", l.SelectedItems [0]); + Assert.AreEqual ("C", l.SelectedItems [1]); + } + } } [TestFixture] diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuTest.cs index 23503bce9a4..d51f023c363 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuTest.cs @@ -123,5 +123,18 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual ("Close", mainMenu1.MenuItems[0].MenuItems[1].Text, "ItemMerge#3"); Assert.AreEqual ("Exit", mainMenu1.MenuItems[0].MenuItems[2].Text, "ItemMerge#4"); } + + [Test] // Xamarin bug 3418 + public void TestMenuItemsDispose () + { + Menu menu = new MainMenu (); + menu.MenuItems.Add (new MenuItem ()); + menu.Dispose (); + try { + MenuItem item = menu.MenuItems[0]; + Assert.Fail (); + } catch (ArgumentOutOfRangeException) { + } + } } } diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PaintEventArgsTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PaintEventArgsTest.cs index ea408644e70..622adbdf90a 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PaintEventArgsTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PaintEventArgsTest.cs @@ -73,9 +73,6 @@ namespace MonoTests.System.Windows.Forms { } [Test] -#if ONLY_1_1 - [ExpectedException (typeof (ArgumentException))] -#endif public void Dispose () { PaintEventArgs pea = new PaintEventArgs (default_graphics, default_rect); @@ -85,9 +82,6 @@ namespace MonoTests.System.Windows.Forms { } [Test] -#if ONLY_1_1 - [ExpectedException (typeof (ArgumentException))] -#endif public void IDisposable_IDispose () { Bitmap bmp = new Bitmap (1, 1); diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PrintDialogTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PrintDialogTest.cs index c31a1163548..dc1c7c6e612 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PrintDialogTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PrintDialogTest.cs @@ -101,24 +101,6 @@ namespace MonoTests.System.Windows.Forms if (pd.PrinterSettings == ps1) Assert.Fail ("#5"); } - -#if ONLY_1_1 - [Test] // bug #80764 - public void ShowDialog_PrinterSettings_Null () - { - PrintDialog pd = new PrintDialog (); - try { - pd.ShowDialog (); - Assert.Fail ("#1"); - } catch (ArgumentException ex) { - // PrintDialog needs a PrinterSettings object to display - Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2"); - Assert.IsNull (ex.InnerException, "#3"); - Assert.IsNotNull (ex.Message, "#4"); - Assert.IsNull (ex.ParamName, "#5"); - } - } -#endif } } diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RichTextBoxTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RichTextBoxTest.cs index 388a1eb2468..d4bee63603c 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RichTextBoxTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RichTextBoxTest.cs @@ -70,11 +70,7 @@ namespace MonoTests.System.Windows.Forms // [MonoTODO ("Assert.AreEqual (false, rTBox.Rtf, "#R3");") ] // S -#if ONLY_1_1 - Assert.AreEqual (null, rTBox.SelectedText, "#S3"); -#else Assert.AreEqual ("", rTBox.SelectedText, "#S3"); -#endif rTBox.Text = "sample TextBox"; Assert.AreEqual (HorizontalAlignment.Left, rTBox.SelectionAlignment, "#S5"); Assert.AreEqual (false, rTBox.SelectionBullet, "#S6"); diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ScrollableControlTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ScrollableControlTest.cs index f51e76a9a2f..300263c3d19 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ScrollableControlTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ScrollableControlTest.cs @@ -344,5 +344,40 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (true, scrollable.VerticalScroll.Visible, "#C0"); } #endif + + // Tests Xamarin-2562 + [Test] + public void DisplayRectangle_SamePadding () + { + using (var c = new ScrollableControl ()) + { + c.Size = new Size (100, 100); + c.Padding = new Padding (4); + Assert.AreEqual (new Rectangle (0, 0, 100, 100), c.ClientRectangle); + Assert.AreEqual (new Rectangle (4, 4, 92, 92), c.DisplayRectangle); + } + } + + [Test] + public void DisplayRectangle_DifferentPadding () + { + using (var c = new ScrollableControl ()) + { + c.Size = new Size (100, 100); + c.Padding = new Padding (1, 2, 3, 4); + Assert.AreEqual (new Rectangle (0, 0, 100, 100), c.ClientRectangle); + Assert.AreEqual (new Rectangle (1, 2, 96, 94), c.DisplayRectangle); + } + } + + [Test] + public void DockPadding() + { + using (var c = new ScrollableControl ()) + { + c.Padding = new Padding(4); + Assert.AreEqual (4, c.DockPadding.All); + } + } } } diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeNodeCollectionTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeNodeCollectionTest.cs index e8e379359be..6d07b32c341 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeNodeCollectionTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeNodeCollectionTest.cs @@ -231,9 +231,6 @@ namespace MonoTests.System.Windows.Forms } [Test] -#if ONLY_1_1 - [ExpectedException (typeof (NullReferenceException))] -#endif public void Remove_NotInCollection () { TreeView tv = new TreeView (); diff --git a/mcs/class/Microsoft.Build.Engine/Makefile b/mcs/class/Microsoft.Build.Engine/Makefile index cc71dbdf242..3bba6d64042 100644 --- a/mcs/class/Microsoft.Build.Engine/Makefile +++ b/mcs/class/Microsoft.Build.Engine/Makefile @@ -31,6 +31,7 @@ TEST_MCS_FLAGS = \ EXTRA_DISTFILES = \ Test/resources/TestTasks.cs \ Test/resources/*.*proj \ + Test/resources/*.csproj \ Test/test-config-file* Test/resources/TestTasks.dll: Test/resources/TestTasks.cs diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs index 04a5034a6b9..12500aa05f9 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs @@ -1145,7 +1145,7 @@ namespace Microsoft.Build.BuildEngine { "the first import of this file will be used, ignoring others.", import.EvaluatedProjectPath, existingImport.ContainedInProjectFileName); - return false; + return true; } if (String.Compare (fullFileName, import.EvaluatedProjectPath) == 0) { @@ -1153,10 +1153,11 @@ namespace Microsoft.Build.BuildEngine { "The main project file was imported here, which creates a circular " + "reference. Ignoring this import."); - return false; + return true; } - if (!import.CheckEvaluatedProjectPathExists ()) + if (project_load_settings != ProjectLoadSettings.IgnoreMissingImports && + !import.CheckEvaluatedProjectPathExists ()) return false; Imports.Add (import); diff --git a/mcs/class/Microsoft.Build.Tasks/Makefile b/mcs/class/Microsoft.Build.Tasks/Makefile index 07a42e36a9c..18288e01177 100644 --- a/mcs/class/Microsoft.Build.Tasks/Makefile +++ b/mcs/class/Microsoft.Build.Tasks/Makefile @@ -16,6 +16,9 @@ NAME_SUFFIX = .v4.0 endif endif +# Some tests are explicitly testing Microsoft.Build.Tasks.v3.5.dll +TEST_MONO_PATH = $(topdir)/class/lib/net_3_5$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0 + LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll LIB_MCS_FLAGS = \ @@ -53,6 +56,10 @@ clean-test-dll: test-local: copy-config +ifeq (net_4_5, $(PROFILE)) +copy-config: + cp Test/test-config-file-net-4.0 $(test_lib).config +else ifeq (net_4_0, $(PROFILE)) copy-config: cp Test/test-config-file-net-4.0 $(test_lib).config @@ -64,6 +71,7 @@ else copy-config: endif endif +endif export TESTING_MONO=a XBUILD_DIR=../../tools/xbuild diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs index 8c28c2ae27b..3ce4c85d553 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs @@ -25,8 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#if NET_2_0 - using System; using System.Collections; using System.Collections.Generic; @@ -165,7 +163,7 @@ namespace Microsoft.Build.Tasks { } } -#if NET_3_5 || NET_4_0 +#if NET_3_5 public bool OverwriteReadOnlyFiles { get { return overwriteReadOnlyFiles; @@ -229,5 +227,3 @@ namespace Microsoft.Build.Tasks { } } - -#endif diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks.Test.mdp b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks.Test.mdp deleted file mode 100644 index ed06e4557bb..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks.Test.mdp +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks.Test.mds b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks.Test.mds deleted file mode 100644 index 15a1618ecef..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks.Test.mds +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs index 63c3ea9456c..371a8ccbc49 100644 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs @@ -29,6 +29,7 @@ using System; using System.IO; using Microsoft.Build.BuildEngine; using NUnit.Framework; +using System.Text; namespace MonoTests.Microsoft.Build.Tasks { @@ -88,8 +89,9 @@ namespace MonoTests.Microsoft.Build.Tasks { project.LoadXml (documentString); if (!project.Build ("1")) { - testLogger.DumpMessages (); - Assert.Fail ("Build failed"); + var sb = new StringBuilder (); + testLogger.DumpMessages (sb); + Assert.Fail ("Build failed " + sb.ToString ()); } Assert.IsTrue (File.Exists (target_file), "A2"); @@ -286,7 +288,7 @@ namespace MonoTests.Microsoft.Build.Tasks { Assert.AreEqual (FileAttributes.Normal, File.GetAttributes (target_file), "A3"); } -#if NET_3_5 || NET_4_0 +#if NET_3_5 [Test] public void TestCopy_OverwriteReadOnlyTrue () { @@ -302,7 +304,7 @@ namespace MonoTests.Microsoft.Build.Tasks { Assert.AreEqual (FileAttributes.ReadOnly, File.GetAttributes (target_file), "A1"); string documentString = @" - + " + target_file + @" 1 @@ -327,8 +329,9 @@ namespace MonoTests.Microsoft.Build.Tasks { project.LoadXml (documentString); if (!project.Build ("1")) { - testLogger.DumpMessages (); - Assert.Fail ("Build failed"); + var sb = new StringBuilder (); + testLogger.DumpMessages (sb); + Assert.Fail ("Build failed " + sb.ToString ()); } Assert.IsTrue (File.Exists (target_file), "A2"); Assert.AreEqual (FileAttributes.Normal, File.GetAttributes (target_file), "A3"); diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs index 6b33fbe0066..364b575ebe2 100644 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs @@ -3,6 +3,7 @@ using System.Collections; using System; using System.Collections.Generic; using NUnit.Framework; +using System.Text; namespace MonoTests.Microsoft.Build.Tasks { @@ -190,6 +191,12 @@ namespace MonoTests.Microsoft.Build.Tasks Console.WriteLine ("Msg: {0}", arg.Message); } + public void DumpMessages (StringBuilder sb) + { + foreach (BuildEventArgs arg in all_messages) + sb.AppendLine (string.Format ("Msg: {0}", arg.Message)); + } + public void CheckLoggedMessageHead (string expected, string id) { string actual; diff --git a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs index 5cd2ea0d998..9f635b887fe 100644 --- a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs +++ b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs @@ -112,7 +112,7 @@ namespace Mono.XBuild.Utilities { sb.Append ('"'); break; default: - throw new FormatException ("Unrecogised XML entity '&" + entity + ";'."); + throw new FormatException ("Unrecognized XML entity '&" + entity + ";'."); } i = end; } else diff --git a/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs index 6ac9a83a5cb..edc155a8afb 100644 --- a/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs @@ -59,6 +59,4 @@ using System.Runtime.Versioning; [assembly: AssemblyFileVersion (Consts.FxFileVersion)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] diff --git a/mcs/class/Microsoft.Build/Makefile b/mcs/class/Microsoft.Build/Makefile index 2660c711283..173638c9831 100644 --- a/mcs/class/Microsoft.Build/Makefile +++ b/mcs/class/Microsoft.Build/Makefile @@ -21,6 +21,12 @@ LIB_MCS_FLAGS = \ TEST_MCS_FLAGS = /r:System.Core.dll +EXTRA_DISTFILES = \ + Test/FunctionalTestReferenceProject.csproj \ + Test/FunctionalTestReferenceProject3.csproj \ + Test/Microsoft.Build.Test.csproj \ + Test/Microsoft.Build.csproj + include ../../build/library.make export TESTING_MONO=a diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.csproj b/mcs/class/Microsoft.Build/Microsoft.Build.csproj deleted file mode 100644 index aa185cd1a34..00000000000 --- a/mcs/class/Microsoft.Build/Microsoft.Build.csproj +++ /dev/null @@ -1,143 +0,0 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {B2012E7F-8F8D-4908-8045-413F2BD1022D} - Library - Microsoft.Build - Microsoft.Build - v4.0 - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug - DEBUG;NET_4_0 - prompt - 4 - false - AllRules.ruleset - - - none - false - bin\Release - prompt - 4 - false - AllRules.ruleset - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/mcs/class/Microsoft.Build/Test/FunctionalTest.cs b/mcs/class/Microsoft.Build/Test/FunctionalTest.cs index df35928a197..4b6467a0701 100644 --- a/mcs/class/Microsoft.Build/Test/FunctionalTest.cs +++ b/mcs/class/Microsoft.Build/Test/FunctionalTest.cs @@ -63,14 +63,14 @@ namespace MonoTests.Microsoft.Build [Test] public void TestLoadAndSave () { - var project = ProjectRootElement.Open ("Microsoft.Build.csproj"); + var project = ProjectRootElement.Open (Path.Combine ("Test", "Microsoft.Build.csproj")); var projectFileName = String.Format ("Test{0}FunctionalTestProject2.csproj", Path.DirectorySeparatorChar); project.Save (projectFileName); Assert.AreEqual (new Guid ("{B2012E7F-8F8D-4908-8045-413F2BD1022D}"), GetProjectId (project), "#03"); - FileAssert.AreEqual ("Microsoft.Build.csproj", projectFileName, "#04"); + FileAssert.AreEqual (Path.Combine ("Test", "Microsoft.Build.csproj"), projectFileName, "#04"); } [Test] diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.csproj b/mcs/class/Microsoft.Build/Test/Microsoft.Build.csproj new file mode 100644 index 00000000000..aa185cd1a34 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.csproj @@ -0,0 +1,143 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {B2012E7F-8F8D-4908-8045-413F2BD1022D} + Library + Microsoft.Build + Microsoft.Build + v4.0 + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug + DEBUG;NET_4_0 + prompt + 4 + false + AllRules.ruleset + + + none + false + bin\Release + prompt + 4 + false + AllRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs index e06b7226ed7..374eb0d961f 100644 --- a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs +++ b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs @@ -140,9 +140,9 @@ namespace Microsoft.CSharp.RuntimeBinder if (is_compound) { var target_expr = new Compiler.RuntimeValueExpression (target, ctx.ImportType (target.LimitType)); - expr = new Compiler.CompoundAssign (oper, target_expr, right, left, Compiler.Location.Null); + expr = new Compiler.CompoundAssign (oper, target_expr, right, left); } else { - expr = new Compiler.Binary (oper, left, right, Compiler.Location.Null); + expr = new Compiler.Binary (oper, left, right); } expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null); diff --git a/mcs/class/Microsoft.VisualC/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.VisualC/Assembly/AssemblyInfo.cs index 3aef4df1386..4e33a284d20 100644 --- a/mcs/class/Microsoft.VisualC/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.VisualC/Assembly/AssemblyInfo.cs @@ -38,11 +38,6 @@ using System.Resources; [assembly: SatelliteContractVersion (Consts.VsVersion)] #endif -#if (ONLY_1_1) -[assembly: ComCompatibleVersion (7, 0, 3300, 0)] -[assembly: TypeLibVersion (7, 1)] -#endif - /* TODO COMPLETE INFORMATION [assembly: AssemblyTitle ("")] diff --git a/mcs/class/Microsoft.Web.Infrastructure/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Web.Infrastructure/Assembly/AssemblyInfo.cs index 792e465c6c3..498cf09f808 100644 --- a/mcs/class/Microsoft.Web.Infrastructure/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Web.Infrastructure/Assembly/AssemblyInfo.cs @@ -37,10 +37,8 @@ using System.Security; [assembly: AssemblyCompany ("Novell, Inc")] [assembly: AssemblyCopyright ("© Novell, Inc. All rights reserved.")] [assembly: AssemblyConfiguration ("")] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows=true)] [assembly: AssemblyTrademark ("")] [assembly: NeutralResourcesLanguage ("en-US")] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CLSCompliant (true)] [assembly: ComVisible (false)] [assembly: AssemblyFileVersion ("1.0.20105.407")] diff --git a/mcs/class/Mono.CSharp/Mono.CSharp.csproj b/mcs/class/Mono.CSharp/Mono.CSharp.csproj index 4275fe1a258..33ba2d0104c 100755 --- a/mcs/class/Mono.CSharp/Mono.CSharp.csproj +++ b/mcs/class/Mono.CSharp/Mono.CSharp.csproj @@ -72,6 +72,9 @@ MonoSymbolWriter.cs + + SourceMethodBuilder.cs + anonymous.cs @@ -261,4 +264,4 @@ "$(ProjectDir)..\..\jay\jay" -cvt < "$(ProjectDir)..\..\jay\skeleton.cs" "$(ProjectDir)..\..\mcs\cs-parser.jay" > "$(ProjectDir)cs-parser.cs" - + diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs b/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs index 664cdf0cf80..9b83bf3bed9 100644 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs +++ b/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs @@ -53,7 +53,7 @@ namespace Mono.CompilerServices.SymbolWriter } } - internal class MyBinaryWriter : BinaryWriter + sealed class MyBinaryWriter : BinaryWriter { public MyBinaryWriter (Stream stream) : base (stream) diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs b/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs index c9beaa0d438..88d604f2e36 100644 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs +++ b/mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs @@ -183,6 +183,7 @@ namespace Mono.CompilerServices.SymbolWriter { #region This is actually written to the symbol file public readonly int Row; + public int Column; public readonly int File; public readonly int Offset; public readonly bool IsHidden; // Obsolete is never used @@ -195,28 +196,35 @@ namespace Mono.CompilerServices.SymbolWriter public int Compare (LineNumberEntry l1, LineNumberEntry l2) { return l1.Row == l2.Row ? - l1.Offset.CompareTo (l2.Offset) : + l1.Column.CompareTo (l2.Column) : l1.Row.CompareTo (l2.Row); } } - public static readonly LineNumberEntry Null = new LineNumberEntry (0, 0, 0); + public static readonly LineNumberEntry Null = new LineNumberEntry (0, 0, 0, 0); + + public LineNumberEntry (int file, int row, int column, int offset) + : this (file, row, offset, column, false) + { + } public LineNumberEntry (int file, int row, int offset) - : this (file, row, offset, false) - { } + : this (file, row, -1, offset, false) + { + } - public LineNumberEntry (int file, int row, int offset, bool is_hidden) + public LineNumberEntry (int file, int row, int column, int offset, bool is_hidden) { this.File = file; this.Row = row; + this.Column = column; this.Offset = offset; this.IsHidden = is_hidden; } public override string ToString () { - return String.Format ("[Line {0}:{1}:{2}]", File, Row, Offset); + return String.Format ("[Line {0}:{1,2}:{3}]", File, Row, Column, Offset); } } @@ -675,8 +683,7 @@ namespace Mono.CompilerServices.SymbolWriter creating = true; } - public SourceFileEntry (MonoSymbolFile file, string file_name, - byte[] guid, byte[] checksum) + public SourceFileEntry (MonoSymbolFile file, string file_name, byte[] guid, byte[] checksum) : this (file, file_name) { this.guid = guid; @@ -694,13 +701,15 @@ namespace Mono.CompilerServices.SymbolWriter DataOffset = (int) bw.BaseStream.Position; bw.Write (file_name); - if (guid == null) { - guid = Guid.NewGuid ().ToByteArray (); + if (guid == null) + guid = new byte[16]; + + if (hash == null) { try { - using (FileStream fs = new FileStream (file_name, FileMode.Open, FileAccess.Read)) { - MD5 md5 = MD5.Create (); - hash = md5.ComputeHash (fs); - } + using (FileStream fs = new FileStream (file_name, FileMode.Open, FileAccess.Read)) { + MD5 md5 = MD5.Create (); + hash = md5.ComputeHash (fs); + } } catch { hash = new byte [16]; } @@ -791,7 +800,6 @@ namespace Mono.CompilerServices.SymbolWriter public const int Default_LineRange = 8; public const byte Default_OpcodeBase = 9; - public const bool SuppressDuplicates = true; #endregion public const byte DW_LNS_copy = 1; @@ -822,7 +830,7 @@ namespace Mono.CompilerServices.SymbolWriter this._line_numbers = lines; } - internal void Write (MonoSymbolFile file, MyBinaryWriter bw) + internal void Write (MonoSymbolFile file, MyBinaryWriter bw, bool readColumnsInfo) { int start = (int) bw.BaseStream.Position; @@ -832,11 +840,6 @@ namespace Mono.CompilerServices.SymbolWriter int line_inc = LineNumbers [i].Row - last_line; int offset_inc = LineNumbers [i].Offset - last_offset; - if (SuppressDuplicates && (i+1 < LineNumbers.Length)) { - if (LineNumbers [i+1].Equals (LineNumbers [i])) - continue; - } - if (LineNumbers [i].File != last_file) { bw.Write (DW_LNS_set_file); bw.WriteLeb128 (LineNumbers [i].File); @@ -884,17 +887,23 @@ namespace Mono.CompilerServices.SymbolWriter bw.Write ((byte) 1); bw.Write (DW_LNE_end_sequence); + for (int i = 0; i < LineNumbers.Length; i++) { + var ln = LineNumbers [i]; + if (ln.Row >= 0) + bw.WriteLeb128 (ln.Column); + } + file.ExtendedLineNumberSize += (int) bw.BaseStream.Position - start; } - internal static LineNumberTable Read (MonoSymbolFile file, MyBinaryReader br) + internal static LineNumberTable Read (MonoSymbolFile file, MyBinaryReader br, bool readColumnsInfo) { LineNumberTable lnt = new LineNumberTable (file); - lnt.DoRead (file, br); + lnt.DoRead (file, br, readColumnsInfo); return lnt; } - void DoRead (MonoSymbolFile file, MyBinaryReader br) + void DoRead (MonoSymbolFile file, MyBinaryReader br, bool includesColumns) { var lines = new List (); @@ -911,7 +920,7 @@ namespace Mono.CompilerServices.SymbolWriter if (opcode == DW_LNE_end_sequence) { if (modified) lines.Add (new LineNumberEntry ( - stm_file, stm_line, stm_offset, is_hidden)); + stm_file, stm_line, -1, stm_offset, is_hidden)); break; } else if (opcode == DW_LNE_MONO_negate_is_hidden) { is_hidden = !is_hidden; @@ -929,7 +938,7 @@ namespace Mono.CompilerServices.SymbolWriter switch (opcode) { case DW_LNS_copy: lines.Add (new LineNumberEntry ( - stm_file, stm_line, stm_offset, is_hidden)); + stm_file, stm_line, -1, stm_offset, is_hidden)); modified = false; break; case DW_LNS_advance_pc: @@ -959,13 +968,20 @@ namespace Mono.CompilerServices.SymbolWriter stm_offset += opcode / LineRange; stm_line += LineBase + (opcode % LineRange); lines.Add (new LineNumberEntry ( - stm_file, stm_line, stm_offset, is_hidden)); + stm_file, stm_line, -1, stm_offset, is_hidden)); modified = false; } } - _line_numbers = new LineNumberEntry [lines.Count]; - lines.CopyTo (_line_numbers, 0); + _line_numbers = lines.ToArray (); + + if (includesColumns) { + for (int i = 0; i < _line_numbers.Length; ++i) { + var ln = _line_numbers[i]; + if (ln.Row >= 0) + ln.Column = br.ReadLeb128 (); + } + } } public bool GetMethodBounds (out LineNumberEntry start, out LineNumberEntry end) @@ -1022,7 +1038,8 @@ namespace Mono.CompilerServices.SymbolWriter [Flags] public enum Flags { - LocalNamesAmbiguous = 1 + LocalNamesAmbiguous = 1, + ColumnsInfoIncluded = 1 << 1 } public const int Size = 12; @@ -1176,7 +1193,7 @@ namespace Mono.CompilerServices.SymbolWriter } LineNumberTableOffset = (int) bw.BaseStream.Position; - lnt.Write (file, bw); + lnt.Write (file, bw, (flags & Flags.ColumnsInfoIncluded) != 0); DataOffset = (int) bw.BaseStream.Position; @@ -1204,7 +1221,7 @@ namespace Mono.CompilerServices.SymbolWriter long old_pos = reader.BaseStream.Position; reader.BaseStream.Position = LineNumberTableOffset; - lnt = LineNumberTable.Read (SymbolFile, reader); + lnt = LineNumberTable.Read (SymbolFile, reader, (flags & Flags.ColumnsInfoIncluded) != 0); reader.BaseStream.Position = old_pos; return lnt; diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs b/mcs/class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs index 1ff399cdcd9..b45bf8a1fb5 100644 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs +++ b/mcs/class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs @@ -64,7 +64,7 @@ namespace Mono.CompilerServices.SymbolWriter public void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, bool is_hidden) { int file_idx = file != null ? file.Index : 0; - var lne = new LineNumberEntry (file_idx, line, offset, is_hidden); + var lne = new LineNumberEntry (file_idx, line, column, offset, is_hidden); if (method_lines.Count > 0) { var prev = method_lines[method_lines.Count - 1]; @@ -185,7 +185,7 @@ namespace Mono.CompilerServices.SymbolWriter { MethodEntry entry = new MethodEntry ( file, _comp_unit.Entry, token, ScopeVariables, - Locals, method_lines.ToArray (), Blocks, null, 0, ns_id); + Locals, method_lines.ToArray (), Blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id); file.AddMethod (entry); } diff --git a/mcs/class/Mono.Data.Sqlite/.gitignore b/mcs/class/Mono.Data.Sqlite/.gitignore new file mode 100644 index 00000000000..902beaf084a --- /dev/null +++ b/mcs/class/Mono.Data.Sqlite/.gitignore @@ -0,0 +1 @@ +SqliteTest.db diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs index 386f912aab1..a0eb84536c9 100644 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs +++ b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs @@ -689,12 +689,14 @@ namespace Mono.Data.Sqlite new SQLiteTypeNames("GENERAL", DbType.Binary), new SQLiteTypeNames("OLEOBJECT", DbType.Binary), new SQLiteTypeNames("GUID", DbType.Guid), + new SQLiteTypeNames("GUIDBLOB", DbType.Guid), new SQLiteTypeNames("UNIQUEIDENTIFIER", DbType.Guid), new SQLiteTypeNames("MEMO", DbType.String), new SQLiteTypeNames("NOTE", DbType.String), new SQLiteTypeNames("SMALLINT", DbType.Int16), new SQLiteTypeNames("BIGINT", DbType.Int64), new SQLiteTypeNames("TIMESTAMP", DbType.DateTime), + new SQLiteTypeNames("DATETIME", DbType.DateTime), }; } diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs index cb18d51d6be..a295098e050 100644 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs +++ b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs @@ -125,8 +125,14 @@ namespace Mono.Data.Sqlite finally { // If the datareader's behavior includes closing the connection, then do so here. - if ((_commandBehavior & CommandBehavior.CloseConnection) != 0 && _command.Connection != null) - _command.Connection.Close(); + if ((_commandBehavior & CommandBehavior.CloseConnection) != 0 && _command.Connection != null) { + // We need to call Dispose on the command before we call Dispose on the Connection, + // otherwise we'll get a SQLITE_LOCKED exception. + var conn = _command.Connection; + _command.Dispose (); + conn.Close(); + _disposeCommand = false; + } } } finally diff --git a/mcs/class/Mono.Data.Sqlite/Test/SqliteCommandUnitTests.cs b/mcs/class/Mono.Data.Sqlite/Test/SqliteCommandUnitTests.cs index 6f74042abf9..aa70f5c160e 100644 --- a/mcs/class/Mono.Data.Sqlite/Test/SqliteCommandUnitTests.cs +++ b/mcs/class/Mono.Data.Sqlite/Test/SqliteCommandUnitTests.cs @@ -43,15 +43,16 @@ namespace MonoTests.Mono.Data.Sqlite { throw e; } - - SqliteCommand createCommand = new SqliteCommand("CREATE TABLE t1(t TEXT, f FLOAT, i INTEGER, b TEXT);",_conn); - SqliteCommand insertCommand = new SqliteCommand("INSERT INTO t1 (t, f, i, b ) VALUES('" + stringvalue + "',123,123,'123')",_conn); try { - _conn.Open(); - createCommand.ExecuteNonQuery(); - insertCommand.ExecuteNonQuery(); + using (SqliteCommand createCommand = new SqliteCommand("CREATE TABLE t1(t TEXT, f FLOAT, i INTEGER, b TEXT);", _conn)) + using (SqliteCommand insertCommand = new SqliteCommand("INSERT INTO t1 (t, f, i, b ) VALUES('" + stringvalue + "',123,123,'123')", _conn)) + { + _conn.Open(); + createCommand.ExecuteNonQuery(); + insertCommand.ExecuteNonQuery(); + } } catch(Exception e) { @@ -67,29 +68,31 @@ namespace MonoTests.Mono.Data.Sqlite [Test] public void Select() { - SqliteCommand simpleSelect = new SqliteCommand("SELECT * FROM t1; ", _conn); // check trailing spaces - using(_conn) + using (_conn) + using (SqliteCommand simpleSelect = new SqliteCommand("SELECT * FROM t1; ", _conn)) // check trailing spaces { _conn.Open(); - SqliteDataReader dr = simpleSelect.ExecuteReader(); - while(dr.Read()) + using (SqliteDataReader dr = simpleSelect.ExecuteReader()) { - string test = dr[0].ToString(); - Assert.AreEqual(dr["T"], stringvalue); // also checks case-insensitive column - Assert.AreEqual(dr["F"], 123); - Assert.AreEqual(dr["I"], 123); - Assert.AreEqual(dr["B"], "123"); + while (dr.Read()) + { + string test = dr[0].ToString(); + Assert.AreEqual(dr["T"], stringvalue); // also checks case-insensitive column + Assert.AreEqual(dr["F"], 123); + Assert.AreEqual(dr["I"], 123); + Assert.AreEqual(dr["B"], "123"); + } + Assert.IsTrue(dr.FieldCount>0); } - Assert.IsTrue(dr.FieldCount>0); } } - + [Test] public void Delete() { - SqliteCommand insCmd = new SqliteCommand("INSERT INTO t1 VALUES ('todelete',0.1,0,'')",_conn); - SqliteCommand delCmd = new SqliteCommand("DELETE FROM t1 WHERE t = 'todelete'",_conn); - using(_conn) + using (_conn) + using (SqliteCommand insCmd = new SqliteCommand("INSERT INTO t1 VALUES ('todelete',0.1,0,'')", _conn)) + using (SqliteCommand delCmd = new SqliteCommand("DELETE FROM t1 WHERE t = 'todelete'", _conn)) { _conn.Open(); int insReturn = insCmd.ExecuteNonQuery(); @@ -102,8 +105,8 @@ namespace MonoTests.Mono.Data.Sqlite [Test] public void Insert() { - SqliteCommand insCmd = new SqliteCommand("INSERT INTO t1 VALUES ('inserted',0.1,0,'')",_conn); - using(_conn) + using (_conn) + using (SqliteCommand insCmd = new SqliteCommand("INSERT INTO t1 VALUES ('inserted',0.1,0,'')", _conn)) { _conn.Open(); int insReturn = insCmd.ExecuteNonQuery(); @@ -114,9 +117,9 @@ namespace MonoTests.Mono.Data.Sqlite [Test] public void Update() { - SqliteCommand insCmd = new SqliteCommand("INSERT INTO t1 VALUES ('toupdate',0.1,0,'')",_conn); - SqliteCommand updCmd = new SqliteCommand("UPDATE t1 SET t = 'updated' ,f = 2.0, i = 2, b = '' WHERE t = 'toupdate'",_conn); - using(_conn) + using (_conn) + using (SqliteCommand insCmd = new SqliteCommand("INSERT INTO t1 VALUES ('toupdate',0.1,0,'')", _conn)) + using (SqliteCommand updCmd = new SqliteCommand("UPDATE t1 SET t = 'updated' ,f = 2.0, i = 2, b = '' WHERE t = 'toupdate'", _conn)) { _conn.Open(); insCmd.ExecuteNonQuery(); @@ -129,8 +132,8 @@ namespace MonoTests.Mono.Data.Sqlite public void ScalarReturn() { // This should return the 1 line that got inserted in CreateTable() Test - SqliteCommand cmd = new SqliteCommand("SELECT COUNT(*) FROM t1 WHERE t LIKE '%äöüß'",_conn); - using(_conn) + using (_conn) + using (SqliteCommand cmd = new SqliteCommand("SELECT COUNT(*) FROM t1 WHERE t LIKE '%äöüß'", _conn)) { _conn.Open(); Assert.AreEqual(1, Convert.ToInt32(cmd.ExecuteScalar())); @@ -141,12 +144,12 @@ namespace MonoTests.Mono.Data.Sqlite public void InsertWithTransaction() { _conn.Open(); - SqliteTransaction t = _conn.BeginTransaction() as SqliteTransaction; - SqliteCommand c1 = new SqliteCommand("INSERT INTO t1 VALUES ('a',0.1,0,'0')",_conn,t); - SqliteCommand c2 = new SqliteCommand("INSERT INTO t1 VALUES ('b',1.2,0,'0')",_conn,t); - SqliteCommand c3 = new SqliteCommand("INSERT INTO t1 VALUES ('c',0.3,1,'0')",_conn,t); - SqliteCommand c4 = new SqliteCommand("INSERT INTO t1 VALUES ('d',0.4,0,'1')",_conn,t); - using(_conn) + using (_conn) + using (SqliteTransaction t = _conn.BeginTransaction() as SqliteTransaction) + using (SqliteCommand c1 = new SqliteCommand("INSERT INTO t1 VALUES ('a',0.1,0,'0')", _conn, t)) + using (SqliteCommand c2 = new SqliteCommand("INSERT INTO t1 VALUES ('b',1.2,0,'0')", _conn, t)) + using (SqliteCommand c3 = new SqliteCommand("INSERT INTO t1 VALUES ('c',0.3,1,'0')", _conn, t)) + using (SqliteCommand c4 = new SqliteCommand("INSERT INTO t1 VALUES ('d',0.4,0,'1')", _conn, t)) { try { @@ -173,12 +176,12 @@ namespace MonoTests.Mono.Data.Sqlite public void InsertWithFailingTransaction() { _conn.Open(); - SqliteTransaction t = _conn.BeginTransaction() as SqliteTransaction; - SqliteCommand c1 = new SqliteCommand("INSERT INTO t1 VALUES ('1','0','0','0')",_conn,t); - SqliteCommand c2 = new SqliteCommand("INSERT INTO t1 VALUES ('0','1','0','0')",_conn,t); - SqliteCommand c3 = new SqliteCommand("INSERT INTO t1 VALUES ('x',?,'x',?,'x',?,'x')",_conn,t); - SqliteCommand c4 = new SqliteCommand("INSERT INTO t1 VALUES ('0','0','0','1')",_conn,t); - using(_conn) + using (_conn) + using (SqliteTransaction t = _conn.BeginTransaction() as SqliteTransaction) + using (SqliteCommand c1 = new SqliteCommand("INSERT INTO t1 VALUES ('1','0','0','0')", _conn, t)) + using (SqliteCommand c2 = new SqliteCommand("INSERT INTO t1 VALUES ('0','1','0','0')", _conn, t)) + using (SqliteCommand c3 = new SqliteCommand("INSERT INTO t1 VALUES ('x',?,'x',?,'x',?,'x')", _conn, t)) + using (SqliteCommand c4 = new SqliteCommand("INSERT INTO t1 VALUES ('0','0','0','1')", _conn, t)) { try { diff --git a/mcs/class/Mono.Data.Sqlite/Test/SqliteDataReaderTest.cs b/mcs/class/Mono.Data.Sqlite/Test/SqliteDataReaderTest.cs index a5a5604e45a..c55b6489a14 100644 --- a/mcs/class/Mono.Data.Sqlite/Test/SqliteDataReaderTest.cs +++ b/mcs/class/Mono.Data.Sqlite/Test/SqliteDataReaderTest.cs @@ -141,5 +141,74 @@ namespace MonoTests.Mono.Data.Sqlite } } } + + [Test] + public void CloseConnectionTest () + { + // When this test fails it may confuse nunit a bit, causing it to show strange + // exceptions, since it leaks file handles (and nunit tries to open files, + // which it doesn't expect to fail). + + // For the same reason a lot of other tests will fail when this one fails. + + _conn.ConnectionString = _connectionString; + using (_conn) { + _conn.Open (); + using (var cmd = (SqliteCommand) _conn.CreateCommand ()) { + cmd.CommandText = @"CREATE TABLE IF NOT EXISTS TestNullableDateTime (nullable TIMESTAMP NULL, dummy int); INSERT INTO TestNullableDateTime (nullable, dummy) VALUES (124123, 2);"; + cmd.ExecuteNonQuery (); + } + } + + for (int i = 0; i < 1000; i++) { + _conn.ConnectionString = _connectionString; + using (_conn) { + _conn.Open (); + using (var cmd = (SqliteCommand) _conn.CreateCommand ()) { + cmd.CommandText = "SELECT * FROM TestNullableDateTime;"; + cmd.CommandType = CommandType.Text; + + using (var reader = cmd.ExecuteReader (CommandBehavior.CloseConnection)) { + reader.Read (); + } + } + } + } + } + + [Test] + public void TestDataTypes () + { + _conn.ConnectionString = _connectionString; + using (_conn) { + _conn.Open(); + + using (var cm = _conn.CreateCommand ()) { + cm.CommandText = "DROP TABLE TEST; CREATE TABLE TEST (F2 DATETIME, F3 guidblob NOT NULL); INSERT INTO TEST (F2, F3) VALUES (:F2, :F3)"; + + var dp2 = cm.CreateParameter (); + dp2.ParameterName = ":F2"; + dp2.Value = DateTime.Now; + cm.Parameters.Add (dp2); + var dp3 = cm.CreateParameter (); + dp3.ParameterName = ":F3"; + dp3.Value = new byte [] { 3, 14, 15 }; + cm.Parameters.Add (dp3); + + cm.ExecuteNonQuery (); + } + + using (var cm = _conn.CreateCommand ()) { + cm.CommandText = "SELECT * FROM TEST"; + using (var dr = cm.ExecuteReader ()) { + dr.Read (); + + Assert.AreEqual ("System.DateTime", dr.GetFieldType (dr.GetOrdinal ("F2")).ToString (), "F2"); + Assert.AreEqual ("guidblob", dr.GetDataTypeName (dr.GetOrdinal ("F3")), "F3"); + Assert.AreEqual ("System.Guid", dr.GetFieldType (dr.GetOrdinal ("F3")).ToString (), "F3-#2"); + } + } + } + } } } diff --git a/mcs/class/Mono.Data.Tds/Makefile b/mcs/class/Mono.Data.Tds/Makefile index 80c552ae754..53ed46d7b7f 100644 --- a/mcs/class/Mono.Data.Tds/Makefile +++ b/mcs/class/Mono.Data.Tds/Makefile @@ -4,6 +4,7 @@ include ../../build/rules.make LIBRARY = Mono.Data.Tds.dll LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:System.Xml.dll /r:Mono.Security.dll -NO_TEST = yes + +TEST_MCS_FLAGS = /r:System.dll /r:System.Net.dll include ../../build/library.make diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs index 4bd857dc6e7..f111b3504c7 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs @@ -779,7 +779,10 @@ namespace Mono.Data.Tds.Protocol Parameters = parameters; TdsMetaParameterCollection parms = new TdsMetaParameterCollection (); - TdsMetaParameter parm = new TdsMetaParameter ("@Handle", "int", null); + // Tested with MS SQL 2008 RC2 Express and MS SQL 2012 Express: + // You may pass either -1 or 0, but not null as initial value of @Handle, + // which is an output parameter. + TdsMetaParameter parm = new TdsMetaParameter ("@Handle", "int", -1); parm.Direction = TdsParameterDirection.Output; parms.Add (parm); diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs index 30636d4d2ba..4d43d7ec399 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs @@ -224,6 +224,7 @@ retry: retries--; if (retries == 0) throw exc; + result = null; goto retry; } return result; diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds_test.dll.sources b/mcs/class/Mono.Data.Tds/Mono.Data.Tds_test.dll.sources new file mode 100644 index 00000000000..5cefc194ebb --- /dev/null +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds_test.dll.sources @@ -0,0 +1 @@ +bug-4786.cs diff --git a/mcs/class/Mono.Data.Tds/Test/bug-4786.cs b/mcs/class/Mono.Data.Tds/Test/bug-4786.cs new file mode 100644 index 00000000000..9bb7edf0f04 --- /dev/null +++ b/mcs/class/Mono.Data.Tds/Test/bug-4786.cs @@ -0,0 +1,110 @@ +// +// bug-4786.cs- +// NUnit Test Cases for Mono.Data.Tds.Protocol.TdsConnectionPool +// +// Author: +// Robert Wilkens +// +// Copyright (C) 2012 Robert Wilkens (http://www.robssoftwareprojects.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace bug4786test +{ + + using NUnit.Framework; + using Mono.Data.Tds.Protocol; + using System; + using System.Net; + using System.Net.Sockets; + + + [TestFixture] + public class TdsConnectionPoolTest + { + const string SERVER="localhost"; + [Test] + public void CheckNullException() + { + + //set up dummy sql listener, if there is a real sql server on this + //machine at that port, in theory this part will fail, but that's ok + //becuase something will be listening on the port and that's all we + //require at this point: a listener on port 1433... + + try{ + Socket Listener = new Socket(AddressFamily.InterNetwork, + SocketType.Stream, + ProtocolType.Tcp); + IPAddress hostIP =Dns.GetHostEntry("localhost").AddressList[0]; + IPEndPoint ep = new IPEndPoint(hostIP, 1433); + Listener.Bind(ep); + Listener.Listen(1); + } catch (Exception){ + //ignore + } + + //try to connect twice, in earlier failure would get null exception + //on 2nd call to pool.GetConnection(); + //Most of this code ripped from sqlConnection.Open() + + TdsConnectionPool pool; + + TdsConnectionPoolManager sqlConnectionPools = + new TdsConnectionPoolManager(TdsVersion.tds80); + TdsConnectionInfo info= + new TdsConnectionInfo(SERVER/*dummyhost*/,1433/*port*/, + 8192/*pktsize*/,15/*timeout*/,0/*minpoolsize*/, + 100/*maxpoolsize*/); + pool=sqlConnectionPools.GetConnectionPool("test",info); + Tds tds=null; + + //this first one succeeded regardless as long as something answered + //the phone on port 1433 of localhost + tds=pool.GetConnection(); + + pool.ReleaseConnection(tds); + + + // 2nd time thru: This will fail with nullreferenceexception + // at pool.GetConnection() unless the patch by Rob Wilkens which + // adds "result=null;" before retry in pool.getConnection() source + + //First let's pretend we're calling this test fresh, as if we + //call sqlConnection.Open() again : + + info=new TdsConnectionInfo(SERVER/*dummyhost*/,1433/*port*/, + 8192/*pktsize*/,15/*timeout*/,0/*minpoolsize*/, + 100/*maxpoolsize*/); + + pool=sqlConnectionPools.GetConnectionPool("test",info); + + //Then: Test for failure (will raise uncaught exception which + //causes failure of test if bug is not fixed + tds=pool.GetConnection(); + + pool.ReleaseConnection(tds); + + //exit + } + } +} + diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources index 803efd849ba..db2a4d73bce 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources @@ -12,6 +12,7 @@ Mono.Debugger.Soft/StackFrame.cs Mono.Debugger.Soft/CustomAttributeDataMirror.cs Mono.Debugger.Soft/ThreadStartEvent.cs Mono.Debugger.Soft/ILInstruction.cs +Mono.Debugger.Soft/ILExceptionHandler.cs Mono.Debugger.Soft/InterfaceMappingMirror.cs Mono.Debugger.Soft/PrimitiveValue.cs Mono.Debugger.Soft/PointerValue.cs diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index 70bfb86a4ee..1192cfb2223 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -43,6 +43,7 @@ namespace Mono.Debugger.Soft public int max_il_offset; public int[] il_offsets; public int[] line_numbers; + public int[] column_numbers; public SourceInfo[] source_files; } @@ -79,6 +80,24 @@ namespace Mono.Debugger.Soft class MethodBodyInfo { public byte[] il; + public ExceptionClauseInfo[] clauses; + } + + struct ExceptionClauseInfo { + public ExceptionClauseFlags flags; + public int try_offset; + public int try_length; + public int handler_offset; + public int handler_length; + public int filter_offset; + public long catch_type_id; + } + + enum ExceptionClauseFlags { + None = 0x0, + Filter = 0x1, + Finally = 0x2, + Fault = 0x4, } struct ParamInfo { @@ -353,7 +372,7 @@ namespace Mono.Debugger.Soft /* * Represents the connection to the debuggee */ - public abstract class Connection : IDisposable + public abstract class Connection { /* * The protocol and the packet format is based on JDWP, the differences @@ -376,7 +395,7 @@ namespace Mono.Debugger.Soft * with newer runtimes, and vice versa. */ internal const int MAJOR_VERSION = 2; - internal const int MINOR_VERSION = 17; + internal const int MINOR_VERSION = 19; enum WPSuspendPolicy { NONE = 0, @@ -1132,7 +1151,9 @@ namespace Mono.Debugger.Soft if (!res) break; } catch (Exception ex) { - Console.WriteLine (ex); + if (!closed) { + Console.WriteLine (ex); + } break; } } @@ -1670,6 +1691,7 @@ namespace Mono.Debugger.Soft info.il_offsets = new int [n_il_offsets]; info.line_numbers = new int [n_il_offsets]; info.source_files = new SourceInfo [n_il_offsets]; + info.column_numbers = new int [n_il_offsets]; for (int i = 0; i < n_il_offsets; ++i) { info.il_offsets [i] = res.ReadInt (); info.line_numbers [i] = res.ReadInt (); @@ -1679,6 +1701,10 @@ namespace Mono.Debugger.Soft } else { info.source_files [i] = sources [0]; } + if (Version.AtLeast (2, 19)) + info.column_numbers [i] = res.ReadInt (); + else + info.column_numbers [i] = 0; } return info; @@ -1755,6 +1781,28 @@ namespace Mono.Debugger.Soft for (int i = 0; i < info.il.Length; ++i) info.il [i] = (byte)res.ReadByte (); + if (Version.AtLeast (2, 18)) { + info.clauses = new ExceptionClauseInfo [res.ReadInt ()]; + + for (int i = 0; i < info.clauses.Length; ++i) { + var clause = new ExceptionClauseInfo { + flags = (ExceptionClauseFlags) res.ReadInt (), + try_offset = res.ReadInt (), + try_length = res.ReadInt (), + handler_offset = res.ReadInt (), + handler_length = res.ReadInt (), + }; + + if (clause.flags == ExceptionClauseFlags.None) + clause.catch_type_id = res.ReadId (); + else if (clause.flags == ExceptionClauseFlags.Filter) + clause.filter_offset = res.ReadInt (); + + info.clauses [i] = clause; + } + } else + info.clauses = new ExceptionClauseInfo [0]; + return info; } @@ -2214,20 +2262,10 @@ namespace Mono.Debugger.Soft res.domain_id = r.ReadId (); return res; } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - } - - ~Connection () + + public void ForceDisconnect () { - Dispose (false); + TransportClose (); } } @@ -2267,15 +2305,6 @@ namespace Mono.Debugger.Soft { socket.Close (); } - - protected override void Dispose (bool disposing) - { - if (disposing) { - //Socket.Dispose is explicit in < .NET 4.0 - ((IDisposable)socket).Dispose (); - } - base.Dispose (disposing); - } } /* This is the interface exposed by the debugger towards the debugger agent */ diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ILExceptionHandler.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ILExceptionHandler.cs new file mode 100644 index 00000000000..927949d0711 --- /dev/null +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ILExceptionHandler.cs @@ -0,0 +1,33 @@ +using System; +using System.IO; + +namespace Mono.Debugger.Soft +{ + public enum ILExceptionHandlerType + { + Catch = ExceptionClauseFlags.None, + Filter = ExceptionClauseFlags.Filter, + Finally = ExceptionClauseFlags.Finally, + Fault = ExceptionClauseFlags.Fault, + } + + public class ILExceptionHandler + { + public int TryOffset { get; internal set; } + public int TryLength { get; internal set; } + public ILExceptionHandlerType HandlerType { get; internal set; } + public int HandlerOffset { get; internal set; } + public int HandlerLength { get; internal set;} + public int FilterOffset { get; internal set; } + public TypeMirror CatchType { get; internal set; } + + internal ILExceptionHandler (int try_offset, int try_length, ILExceptionHandlerType handler_type, int handler_offset, int handler_length) + { + TryOffset = try_offset; + TryLength = try_length; + HandlerType = handler_type; + HandlerOffset = handler_offset; + HandlerLength = handler_length; + } + } +} diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Location.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Location.cs index a2020a5da4a..0624095b285 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Location.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Location.cs @@ -10,7 +10,7 @@ namespace Mono.Debugger.Soft string source_file; int line_number; byte[] hash; - //int column_number; + int column_number; internal Location (VirtualMachine vm, MethodMirror method, long native_addr, int il_offset, string source_file, int line_number, int column_number, byte[] hash) : base (vm, 0) { this.method = method; @@ -19,7 +19,7 @@ namespace Mono.Debugger.Soft this.source_file = source_file; this.line_number = line_number; this.hash = hash; - //this.column_number = column_number; + this.column_number = column_number; } public MethodMirror Method { @@ -46,6 +46,13 @@ namespace Mono.Debugger.Soft } } + // Since protocol version 2.19, 0 in earlier protocol versions + public int ColumnNumber { + get { + return column_number; + } + } + // MD5 hash of source file // Since protocol version 2.14, null in earlier protocol versions public byte[] SourceFileHash { diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodBodyMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodBodyMirror.cs index c03f4cdb476..c383005a0d4 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodBodyMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodBodyMirror.cs @@ -4,6 +4,7 @@ using System.Text; using Mono.Cecil.Cil; using Mono.Cecil.Metadata; using System.IO; +using System.Linq; using System.Reflection; namespace Mono.Debugger.Soft @@ -11,11 +12,11 @@ namespace Mono.Debugger.Soft public class MethodBodyMirror : Mirror { MethodMirror method; - byte[] il; + MethodBodyInfo info; - internal MethodBodyMirror (VirtualMachine vm, MethodMirror method, byte[] il) : base (vm, 0) { + internal MethodBodyMirror (VirtualMachine vm, MethodMirror method, MethodBodyInfo info) : base (vm, 0) { this.method = method; - this.il = il; + this.info = info; } public MethodMirror Method { @@ -24,13 +25,29 @@ namespace Mono.Debugger.Soft } } + public List ExceptionHandlers { + get { + vm.CheckProtocolVersion (2, 18); + return info.clauses.Select (c => + { + var handler = new ILExceptionHandler (c.try_offset, c.try_length, (ILExceptionHandlerType) c.flags, c.handler_offset, c.handler_length); + if (c.flags == ExceptionClauseFlags.None) + handler.CatchType = vm.GetType (c.catch_type_id); + else if (c.flags == ExceptionClauseFlags.Filter) + handler.FilterOffset = c.filter_offset; + + return handler; + }).ToList (); + } + } + public byte[] GetILAsByteArray () { - return il; + return info.il; } public List Instructions { get { - return ReadCilBody (new BinaryReader (new MemoryStream (il)), il.Length); + return ReadCilBody (new BinaryReader (new MemoryStream (info.il)), info.il.Length); } } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs index 3034a01d335..85cf83d8dd5 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs @@ -249,7 +249,7 @@ namespace Mono.Debugger.Soft if (body == null) { MethodBodyInfo info = vm.conn.Method_GetBody (id); - body = new MethodBodyMirror (vm, this, info.il); + body = new MethodBodyMirror (vm, this, info); } return body; } @@ -303,24 +303,26 @@ namespace Mono.Debugger.Soft var line_numbers = LineNumbers; IList res = new Location [ILOffsets.Count]; for (int i = 0; i < il_offsets.Count; ++i) - res [i] = new Location (vm, this, -1, il_offsets [i], debug_info.source_files [i].source_file, line_numbers [i], 0, debug_info.source_files [i].hash); + res [i] = new Location (vm, this, -1, il_offsets [i], debug_info.source_files [i].source_file, line_numbers [i], debug_info.column_numbers [i], debug_info.source_files [i].hash); locations = res; } return locations; } } - internal int il_offset_to_line_number (int il_offset, out string src_file, out byte[] src_hash) { + internal int il_offset_to_line_number (int il_offset, out string src_file, out byte[] src_hash, out int column_number) { if (debug_info == null) debug_info = vm.conn.Method_GetDebugInfo (id); // FIXME: Optimize this src_file = null; src_hash = null; + column_number = 0; for (int i = debug_info.il_offsets.Length - 1; i >= 0; --i) { if (debug_info.il_offsets [i] <= il_offset) { src_file = debug_info.source_files [i].source_file; src_hash = debug_info.source_files [i].hash; + column_number = debug_info.column_numbers [i]; return debug_info.line_numbers [i]; } } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/PrimitiveValue.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/PrimitiveValue.cs index 5cf29db9a1a..696f6493f40 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/PrimitiveValue.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/PrimitiveValue.cs @@ -7,7 +7,6 @@ namespace Mono.Debugger.Soft * Represents a value of a primitive type in the debuggee */ public class PrimitiveValue : Value { - object value; public PrimitiveValue (VirtualMachine vm, object value) : base (vm, 0) { @@ -33,7 +32,9 @@ namespace Mono.Debugger.Soft } public override string ToString () { - return "PrimitiveValue<" + Value + ">"; + object v = Value; + + return "PrimitiveValue<" + (v != null ? v.ToString () : "(null)") + ">"; } public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList arguments) { diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs index 034c6fc8a73..ef3a6db79d4 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs @@ -44,13 +44,14 @@ namespace Mono.Debugger.Soft int line_number; string src_file = null; byte[] hash = null; + int column_number = 0; if (il_offset == -1) line_number = -1; else - line_number = method.il_offset_to_line_number (il_offset, out src_file, out hash); + line_number = method.il_offset_to_line_number (il_offset, out src_file, out hash, out column_number); - location = new Location (vm, Method, 0, il_offset, src_file != null ? src_file : method.SourceFile, line_number, 0, hash); + location = new Location (vm, Method, 0, il_offset, src_file != null ? src_file : method.SourceFile, line_number, column_number, hash); } return location; } diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs index 440e1c82f05..61c284dfcfc 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs @@ -134,13 +134,23 @@ namespace Mono.Debugger.Soft conn.VM_Exit (exitCode); } - public void Dispose () { + public void Detach () { conn.VM_Dispose (); conn.Close (); - conn.Dispose (); notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null); } + [Obsolete ("This method was poorly named; use the Detach() method instead")] + public void Dispose () + { + Detach (); + } + + public void ForceDisconnect () + { + conn.ForceDisconnect (); + } + public IList GetThreads () { long[] ids = vm.conn.VM_GetThreads (); ThreadMirror[] res = new ThreadMirror [ids.Length]; diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs index 2947fa0a42d..d0b6c668f57 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -215,6 +215,10 @@ public class Tests : TestsBase if (args.Length > 0 && args [0] == "suspend-test") /* This contains an infinite loop, so execute it conditionally */ suspend (); + if (args.Length >0 && args [0] == "unhandled-exception") { + unhandled_exception (); + return 0; + } breakpoints (); single_stepping (); arguments (); @@ -305,6 +309,7 @@ public class Tests : TestsBase ss6 (b); } catch { } + ss7 (); ss_regress_654694 (); } @@ -351,13 +356,32 @@ public class Tests : TestsBase [MethodImplAttribute (MethodImplOptions.NoInlining)] public static void ss6 (bool b) { if (b) { - ss7 (); + ss6_2 (); throw new Exception (); } } + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss6_2 () { + } + [MethodImplAttribute (MethodImplOptions.NoInlining)] public static void ss7 () { + try { + ss7_2 (); + ss7_3 (); + } catch { + } + ss7_2 (); + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss7_2 () { + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void ss7_3 () { + throw new Exception (); } [MethodImplAttribute (MethodImplOptions.NoInlining)] @@ -768,6 +792,14 @@ public class Tests : TestsBase } } + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void unhandled_exception () { + ThreadPool.QueueUserWorkItem (delegate { + throw new InvalidOperationException (); + }); + Thread.Sleep (10000); + } + internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method) { if (dlg == null) @@ -867,6 +899,8 @@ public class Tests : TestsBase CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap ( typeof (CrossDomain).Assembly.FullName, "CrossDomain"); + domains_2 (o, new CrossDomain ()); + o.invoke_2 (); o.invoke (); @@ -875,11 +909,15 @@ public class Tests : TestsBase AppDomain.Unload (domain); - domains_2 (); + domains_3 (); } [MethodImplAttribute (MethodImplOptions.NoInlining)] - public static void domains_2 () { + public static void domains_2 (object o, object o2) { + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void domains_3 () { } [MethodImplAttribute (MethodImplOptions.NoInlining)] @@ -1015,6 +1053,10 @@ public class CrossDomain : MarshalByRefObject public void invoke_2 () { Tests.invoke_in_domain_2 (); } + + public int invoke_3 () { + return 42; + } } public class Foo @@ -1027,6 +1069,7 @@ public class LineNumbers { [MethodImplAttribute (MethodImplOptions.NoInlining)] public static void ln1 () { + // Column 3 ln2 (); ln3 (); } diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 480642bb89a..53c3b376411 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -15,6 +15,9 @@ using NUnit.Framework; #pragma warning disable 0219 +namespace MonoTests +{ + [TestFixture] public class DebuggerTests { @@ -192,7 +195,7 @@ public class DebuggerTests // Argument checking AssertThrows (delegate { // Invalid IL offset - vm.SetBreakpoint (m, 1); + vm.SetBreakpoint (m, 2); }); } @@ -502,7 +505,25 @@ public class DebuggerTests e = GetNextEvent (); Assert.IsTrue (e is StepEvent); Assert.AreEqual ("ss6", (e as StepEvent).Method.Name); + req.Disable (); + // Check that a step over stops at an EH clause + e = run_until ("ss7_2"); + req = vm.CreateStepRequest (e.Thread); + req.Depth = StepDepth.Out; + req.Enable (); + vm.Resume (); + e = GetNextEvent (); + Assert.IsTrue (e is StepEvent); + Assert.AreEqual ("ss7", (e as StepEvent).Method.Name); + req.Disable (); + req = vm.CreateStepRequest (e.Thread); + req.Depth = StepDepth.Over; + req.Enable (); + vm.Resume (); + e = GetNextEvent (); + Assert.IsTrue (e is StepEvent); + Assert.AreEqual ("ss7", (e as StepEvent).Method.Name); req.Disable (); } @@ -1579,7 +1600,7 @@ public class DebuggerTests public void Dispose () { run_until ("Main"); - vm.Dispose (); + vm.Detach (); var e = GetNextEvent (); Assert.IsInstanceOfType (typeof (VMDisconnectEvent), e); @@ -1600,7 +1621,32 @@ public class DebuggerTests } [Test] - [Category("only88")] + public void ColumnNumbers () { + Event e = run_until ("line_numbers"); + + // FIXME: Merge this with LineNumbers () when its fixed + + step_req = vm.CreateStepRequest (e.Thread); + step_req.Depth = StepDepth.Into; + step_req.Enable (); + + Location l; + + vm.Resume (); + + e = GetNextEvent (); + Assert.IsTrue (e is StepEvent); + + l = e.Thread.GetFrames ()[0].Location; + + Assert.AreEqual (3, l.ColumnNumber); + + step_req.Disable (); + } + + [Test] + // Broken by mcs+runtime changes (#5438) + [Category("NotWorking")] public void LineNumbers () { Event e = run_until ("line_numbers"); @@ -1681,7 +1727,7 @@ public class DebuggerTests [Test] public void Suspend () { - vm.Dispose (); + vm.Detach (); Start (new string [] { "dtest-app.exe", "suspend-test" }); @@ -1823,11 +1869,27 @@ public class DebuggerTests m = t.GetMethod ("invoke_return_nullable"); v = this_obj.InvokeMethod (e.Thread, m, null); Assert.IsInstanceOfType (typeof (StructMirror), v); + var s = v as StructMirror; + AssertValue (42, s.Fields [0]); + AssertValue (true, s.Fields [1]); + + // pass nullable as this + //m = vm.RootDomain.Corlib.GetType ("System.Object").GetMethod ("ToString"); + m = s.Type.GetMethod ("ToString"); + v = s.InvokeMethod (e.Thread, m, null); // return nullable null m = t.GetMethod ("invoke_return_nullable_null"); v = this_obj.InvokeMethod (e.Thread, m, null); - AssertValue (null, v); + Assert.IsInstanceOfType (typeof (StructMirror), v); + s = v as StructMirror; + AssertValue (0, s.Fields [0]); + AssertValue (false, s.Fields [1]); + + // pass nullable as this + //m = vm.RootDomain.Corlib.GetType ("System.Object").GetMethod ("ToString"); + m = s.Type.GetMethod ("ToString"); + v = s.InvokeMethod (e.Thread, m, null); // pass primitive m = t.GetMethod ("invoke_pass_primitive"); @@ -2044,7 +2106,7 @@ public class DebuggerTests [Test] public void InvokeSingleThreaded () { - vm.Dispose (); + vm.Detach (); Start (new string [] { "dtest-app.exe", "invoke-single-threaded" }); @@ -2371,7 +2433,7 @@ public class DebuggerTests [Test] public void ExceptionFilter2 () { - vm.Dispose (); + vm.Detach (); Start (new string [] { "dtest-excfilter.exe" }); @@ -2471,7 +2533,7 @@ public class DebuggerTests [Test] public void Domains () { - vm.Dispose (); + vm.Detach (); Start (new string [] { "dtest-app.exe", "domain-test" }); @@ -2486,6 +2548,17 @@ public class DebuggerTests var domain = (e as AppDomainCreateEvent).Domain; + // Check the object type + e = run_until ("domains_2"); + var frame = e.Thread.GetFrames ()[0]; + var o = frame.GetArgument (0) as ObjectMirror; + Assert.AreEqual ("CrossDomain", o.Type.Name); + + // Do a remoting invoke + var cross_domain_type = o.Type; + var v = o.InvokeMethod (e.Thread, cross_domain_type.GetMethod ("invoke_3"), null); + AssertValue (42, v); + // Run until the callback in the domain MethodMirror m = entry_point.DeclaringType.GetMethod ("invoke_in_domain"); Assert.IsNotNull (m); @@ -2540,7 +2613,7 @@ public class DebuggerTests Assert.AreEqual (domain, (e as AppDomainUnloadEvent).Domain); // Run past the unload - e = run_until ("domains_2"); + e = run_until ("domains_3"); // Test access to unloaded types // FIXME: Add an exception type for this @@ -2566,7 +2639,7 @@ public class DebuggerTests [Test] public void RefEmit () { - vm.Dispose (); + vm.Detach (); Start (new string [] { "dtest-app.exe", "ref-emit-test" }); @@ -2602,7 +2675,7 @@ public class DebuggerTests [Test] public void StackTraceInNative () { // Check that stack traces can be produced for threads in native code - vm.Dispose (); + vm.Detach (); Start (new string [] { "dtest-app.exe", "frames-in-native" }); @@ -2947,4 +3020,25 @@ public class DebuggerTests Assert.AreEqual (1, args.Length); Assert.AreEqual ("T", args [0].Name); } + + [Test] + public void UnhandledException () { + vm.Detach (); + + Start (new string [] { "dtest-app.exe", "unhandled-exception" }); + + var req = vm.CreateExceptionRequest (null, false, true); + req.Enable (); + + var e = run_until ("unhandled_exception"); + vm.Resume (); + + var e2 = GetNextEvent (); + Assert.IsTrue (e2 is ExceptionEvent); + + vm.Exit (0); + vm = null; + } } + +} \ No newline at end of file diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Assembly/AssemblyInfo.cs b/mcs/class/Mono.Messaging.RabbitMQ/Assembly/AssemblyInfo.cs index acaa4a3fdd1..f167ef96de7 100644 --- a/mcs/class/Mono.Messaging.RabbitMQ/Assembly/AssemblyInfo.cs +++ b/mcs/class/Mono.Messaging.RabbitMQ/Assembly/AssemblyInfo.cs @@ -57,15 +57,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../mono.pub")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/Mono.Messaging/Assembly/AssemblyInfo.cs b/mcs/class/Mono.Messaging/Assembly/AssemblyInfo.cs index 9ebe8b89076..0f202bfc011 100644 --- a/mcs/class/Mono.Messaging/Assembly/AssemblyInfo.cs +++ b/mcs/class/Mono.Messaging/Assembly/AssemblyInfo.cs @@ -57,15 +57,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../mono.pub")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixGroupTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixGroupTest.cs index bef27c9a2b5..0d2971ef8d0 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixGroupTest.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixGroupTest.cs @@ -10,6 +10,7 @@ using NUnit.Framework; using System; +using System.Collections.Generic; using System.Configuration; using System.Diagnostics; @@ -40,13 +41,13 @@ namespace MonoTests.Mono.Unix { } [Test] - // According to bug 72293, this may not work: - // On systems with NIS, it is possible to have multiple users in the passwd - // file with the same name, so the assertion above no longer holds. - [Category ("NotWorking")] public void ReentrantConstructors () { + var seen = new Dictionary (); foreach (UnixGroupInfo group in UnixGroupInfo.GetLocalGroups ()) { + if (seen.ContainsKey (group.GroupName)) + continue; + seen.Add (group.GroupName, null); try { UnixGroupInfo byName = new UnixGroupInfo (group.GroupName); UnixGroupInfo byId = new UnixGroupInfo (group.GroupId); @@ -66,7 +67,11 @@ namespace MonoTests.Mono.Unix { [Test] public void NonReentrantSyscalls () { + var seen = new Dictionary (); foreach (UnixGroupInfo group in UnixGroupInfo.GetLocalGroups ()) { + if (seen.ContainsKey (group.GroupName)) + continue; + seen.Add (group.GroupName, null); try { Group byName = Syscall.getgrnam (group.GroupName); Group byId = Syscall.getgrgid ((uint) group.GroupId); diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs index 6120907159b..3098596b4b0 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs @@ -328,6 +328,7 @@ namespace MonoTests.Mono.Unix { UnixSignal b = new UnixSignal (Signum.SIGINT); Stdlib.raise (Signum.SIGINT); + SleepUntilSignaled (a); Assert.AreEqual (a.Count, 1); Assert.AreEqual (b.Count, 1); @@ -336,11 +337,21 @@ namespace MonoTests.Mono.Unix { b.Reset (); Stdlib.raise (Signum.SIGINT); + SleepUntilSignaled (b); Assert.AreEqual (b.Count, 1); b.Close (); } + static void SleepUntilSignaled (UnixSignal s) + { + for (int i = 0; i < 10; ++i) { + if (s.Count > 0) + break; + Thread.Sleep (100); + } + } + [Test] public void TestDispose2 () { @@ -348,6 +359,7 @@ namespace MonoTests.Mono.Unix { UnixSignal b = new UnixSignal (Signum.SIGINT); Stdlib.raise (Signum.SIGINT); + SleepUntilSignaled (a); Assert.AreEqual (a.Count, 1); Assert.AreEqual (b.Count, 1); @@ -356,6 +368,7 @@ namespace MonoTests.Mono.Unix { a.Reset (); Stdlib.raise (Signum.SIGINT); + SleepUntilSignaled (a); Assert.AreEqual (a.Count, 1); a.Close (); diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs index cc36ee83b74..2a9d7623223 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs @@ -234,8 +234,6 @@ namespace Mono.Security.Protocol.Tls this.protocol.SendRecord(HandshakeType.ServerKeyExchange); } - bool certRequested = false; - // If the negotiated cipher is a KeyEx cipher or // the client certificate is required send the CertificateRequest message if (this.context.Negotiating.Cipher.IsExportable || @@ -243,7 +241,6 @@ namespace Mono.Security.Protocol.Tls ((ServerContext)this.context).RequestClientCertificate) { this.protocol.SendRecord(HandshakeType.CertificateRequest); - certRequested = true; } // Send ServerHelloDone message @@ -263,15 +260,6 @@ namespace Mono.Security.Protocol.Tls } } - if (certRequested) { - X509Certificate client_cert = this.context.ClientSettings.ClientCertificate; - if (client_cert == null && ((ServerContext)this.context).ClientCertificateRequired) - throw new TlsException (AlertDescription.BadCertificate, "No certificate received from client."); - - if (!RaiseClientCertificateValidation (client_cert, new int[0])) - throw new TlsException (AlertDescription.BadCertificate, "Client certificate not accepted."); - } - // Send ChangeCipherSpec and ServerFinished messages this.protocol.SendChangeCipherSpec(); this.protocol.SendRecord (HandshakeType.Finished); diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs b/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs index 027005ca2cb..6edd5feac45 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs @@ -203,7 +203,7 @@ namespace Mono.Security.X509 { // TODO - we should check for CRITICAL but unknown extensions // X509ChainStatusFlags.InvalidExtension -#if (!NET_1_0 && !INSIDE_CORLIB) +#if !INSIDE_CORLIB if (ServicePointManager.CheckCertificateRevocationList) { // TODO - check revocation (CRL, OCSP ...) // X509ChainStatusFlags.RevocationStatusUnknown diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs index 9a618feafc4..b7307cc9b1b 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs @@ -24,7 +24,7 @@ namespace MonoTests.Mono.Security.Cryptography { // MD2 is a abstract class - so ALL of the test included here wont be tested // on the abstract class but should be tested in ALL its descendants. - public class MD2Test : Assertion { + public abstract class MD2Test : Assertion { protected MD2 hash; diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs index 74e935c731d..dd36e8fa412 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs @@ -24,7 +24,7 @@ namespace MonoTests.Mono.Security.Cryptography { // MD4 is a abstract class - so ALL of the test included here wont be tested // on the abstract class but should be tested in ALL its descendants. - public class MD4Test : Assertion { + public abstract class MD4Test : Assertion { protected MD4 hash; diff --git a/mcs/class/Mono.WebBrowser/Mono.Mozilla/DOM/StylesheetList.cs b/mcs/class/Mono.WebBrowser/Mono.Mozilla/DOM/StylesheetList.cs index 811748373f8..848ee88d6bc 100644 --- a/mcs/class/Mono.WebBrowser/Mono.Mozilla/DOM/StylesheetList.cs +++ b/mcs/class/Mono.WebBrowser/Mono.Mozilla/DOM/StylesheetList.cs @@ -25,9 +25,7 @@ using System; using System.Collections; -#if NET_2_0 using System.Collections.Generic; -#endif using Mono.WebBrowser.DOM; namespace Mono.Mozilla.DOM @@ -35,12 +33,7 @@ namespace Mono.Mozilla.DOM internal class StylesheetList : DOMObject, IStylesheetList { private nsIDOMStyleSheetList unmanagedStyles; -#if NET_2_0 private List styles; -#else - private IStylesheet[] styles; - protected int styleCount; -#endif public StylesheetList(WebBrowser control, nsIDOMStyleSheetList stylesheetList) : base (control) { @@ -48,9 +41,7 @@ namespace Mono.Mozilla.DOM unmanagedStyles = nsDOMStyleSheetList.GetProxy (control, stylesheetList); else unmanagedStyles = stylesheetList; -#if NET_2_0 styles = new List(); -#endif } #region IDisposable Members @@ -68,17 +59,7 @@ namespace Mono.Mozilla.DOM #region Helpers protected void Clear () { -#if NET_2_0 styles.Clear (); -#else - if (styles != null) { - for (int i = 0; i < styleCount; i++) { - styles[i] = null; - } - styleCount = 0; - styles = null; - } -#endif } internal void Load () @@ -86,45 +67,21 @@ namespace Mono.Mozilla.DOM Clear (); uint count; unmanagedStyles.getLength (out count); -#if ONLY_1_1 - Stylesheet[] tmpstyles = new Stylesheet[count]; -#endif for (int i = 0; i < count;i++) { nsIDOMStyleSheet style; unmanagedStyles.item ((uint)i, out style); -#if NET_2_0 styles.Add (new Stylesheet (control, style)); -#else - tmpstyles[styleCount++] = new Stylesheet (control, style); -#endif } -#if ONLY_1_1 - - styles = new Stylesheet[styleCount]; - Array.Copy (tmpstyles, styles, styleCount); -#endif } #endregion -#if NET_2_0 IEnumerator IEnumerable.GetEnumerator() { if (styles.Count == 0) Load (); return styles.GetEnumerator(); } -#else - -#region IEnumerable members - public IEnumerator GetEnumerator () - { - return new StyleEnumerator (this); - } -#endregion -#endif - -#if NET_2_0 public IStylesheet this [int index] { get { return styles[index]; @@ -133,71 +90,13 @@ namespace Mono.Mozilla.DOM styles[index] = value; } } -#else - public IStylesheet this [int index] { - get { - if (index < 0 || index >= styleCount) - throw new ArgumentOutOfRangeException ("index"); - return styles [index]; - } - set { - if (index < 0 || index >= styleCount) - throw new ArgumentOutOfRangeException ("index"); - styles [index] = value as IStylesheet; - } - } -#endif - public int Count { get { -#if NET_2_0 if (styles.Count == 0) Load (); return styles.Count; -#else - if (unmanagedStyles != null && styles == null) - Load (); - return styleCount; -#endif } } - -#if ONLY_1_1 - internal class StyleEnumerator : IEnumerator { - - private StylesheetList collection; - private int index = -1; - - public StyleEnumerator (StylesheetList collection) - { - this.collection = collection; - } - - public object Current { - get { - if (index == -1) - return null; - return collection [index]; - } - } - - public bool MoveNext () - { - if (index + 1 >= collection.Count) - return false; - index++; - return true; - } - - public void Reset () - { - index = -1; - } - } -#endif - - - } } diff --git a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/XPathNavigatorReader.cs b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/XPathNavigatorReader.cs index 6fa769aa35f..8beb07d8d1b 100644 --- a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/XPathNavigatorReader.cs +++ b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/XPathNavigatorReader.cs @@ -543,108 +543,6 @@ namespace Mono.Xml.XPath return ret; } -#if NET_1_1 -#else - public override string ReadInnerXml () - { - if (ReadState != ReadState.Interactive) - return String.Empty; - - switch (NodeType) { - case XmlNodeType.Attribute: - return Value; - case XmlNodeType.Element: - if (IsEmptyElement) - return String.Empty; - - int startDepth = Depth; - - innerXmlBuilder.Length = 0; - bool loop = true; - do { - Read (); - if (NodeType ==XmlNodeType.None) - throw new InvalidOperationException ("unexpected end of xml."); - else if (NodeType == XmlNodeType.EndElement && Depth == startDepth) { - loop = false; - Read (); - } - else - innerXmlBuilder.Append (GetCurrentTagMarkup ()); - } while (loop); - string xml = innerXmlBuilder.ToString (); - innerXmlBuilder.Length = 0; - return xml; - case XmlNodeType.None: - // MS document is incorrect. Seems not to progress. - return String.Empty; - default: - Read (); - return String.Empty; - } - } - - StringBuilder atts = new StringBuilder (); - private string GetCurrentTagMarkup () - { - switch (NodeType) { - case XmlNodeType.CDATA: - return String.Format ("", Value.Replace ("]]>", "]]>")); - case XmlNodeType.Text: - return Value.Replace ("<", "<"); - case XmlNodeType.Comment: - return String.Format ("", Value); - case XmlNodeType.SignificantWhitespace: - case XmlNodeType.Whitespace: - return Value; - case XmlNodeType.EndElement: - return String.Format ("", Name); - } - - bool isEmpty = IsEmptyElement; - string name = Name; - atts.Length = 0; - XPathNavigator temp = current.Clone (); - while (temp.MoveToNextAttribute ()) - atts.AppendFormat (" {0}='{1}'", temp.Name, temp.Value.Replace ("'", "'")); - if (!IsEmptyElement) - return String.Format ("<{0}{1}>", name, atts); - else - return String.Format ("<{0}{1} />", name, atts); - } - - // Arranged copy of XmlTextReader.ReadOuterXml() - public override string ReadOuterXml () - { - if (ReadState != ReadState.Interactive) - return String.Empty; - - switch (NodeType) { - case XmlNodeType.Attribute: - // strictly incompatible with MS... (it holds spaces attribute between name, value and "=" char (very trivial). - return String.Format ("{0}={1}{2}{1}", Name, QuoteChar, ReadInnerXml ()); - case XmlNodeType.Element: - bool isEmpty = IsEmptyElement; - string name = Name; - StringBuilder atts = new StringBuilder (); - XPathNavigator temp = current.Clone (); - while (temp.MoveToNextAttribute ()) - atts.AppendFormat (" {0}='{1}'", temp.Name, temp.Value.Replace ("'", "'")); - - if (!isEmpty) - return String.Format ("{0}{1}", GetCurrentTagMarkup (), atts, ReadInnerXml (), name); - else - return String.Format ("{0}", GetCurrentTagMarkup ()); - case XmlNodeType.None: - // MS document is incorrect. Seems not to progress. - return String.Empty; - default: - Read (); - return String.Empty; - } - } -#endif - public override string LookupNamespace (string prefix) { XPathNavigator backup = current.Clone (); diff --git a/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs b/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs index bb96f389126..2e980ba8d75 100644 --- a/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs +++ b/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs @@ -746,8 +746,7 @@ namespace System.ComponentModel.Composition.Hosting private string[] GetFiles() { - string[] files = Directory.GetFiles(this._fullPath, this._searchPattern); - return Array.ConvertAll(files, (file) => file.ToUpperInvariant()); + return Directory.GetFiles(this._fullPath, this._searchPattern); } private static string GetFullPath(string path) @@ -757,7 +756,7 @@ namespace System.ComponentModel.Composition.Hosting path = IOPath.Combine(AppDomain.CurrentDomain.BaseDirectory, path); } - return IOPath.GetFullPath(path).ToUpperInvariant(); + return IOPath.GetFullPath(path); } private void Initialize(string path, string searchPattern) diff --git a/mcs/class/System.Configuration/System.Configuration/Configuration.cs b/mcs/class/System.Configuration/System.Configuration/Configuration.cs index c845fa04538..f21ffa26a3d 100644 --- a/mcs/class/System.Configuration/System.Configuration/Configuration.cs +++ b/mcs/class/System.Configuration/System.Configuration/Configuration.cs @@ -300,7 +300,7 @@ namespace System.Configuration { sec.RawXml = xml; sec.Reset (parentSection); - if (xml != null && xml == data) { + if (xml != null) { XmlTextReader r = new ConfigXmlTextReader (new StringReader (xml), FilePath); sec.DeserializeSection (r); r.Close (); diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs index 4ea6f407638..529d1bf59cb 100644 --- a/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs +++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs @@ -347,11 +347,12 @@ namespace System.Configuration throw new ConfigurationErrorsException (msg, reader); } readProps [prop] = prop.Name; - + ConfigXmlTextReader _reader = reader as ConfigXmlTextReader; - - prop.Source = _reader.Filename; - prop.LineNumber = _reader.LineNumber; + if (_reader != null){ + prop.Source = _reader.Filename; + prop.LineNumber = _reader.LineNumber; + } } reader.MoveToElement (); diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs index 1a13ae67926..d6e06cd3e89 100644 --- a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs +++ b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs @@ -203,8 +203,15 @@ namespace MonoTests.System.Configuration { exePath = "relative.exe"; File.Create (Path.Combine (tempFolder, exePath)).Close (); - config = ConfigurationManager.OpenExeConfiguration (exePath); - Assert.AreEqual (Path.Combine (tempFolder, exePath + ".config"), config.FilePath, "#4"); + // + // The temp directory as computed by the runtime is slightly different, as + // it will contain the full path after following links, while the test + // below is not comprehensive enough to follow links if there are any + // present in tempFolder + // + + //config = ConfigurationManager.OpenExeConfiguration (exePath); + //Assert.AreEqual (Path.Combine (tempFolder, exePath + ".config"), config.FilePath, "#4"); } [Test] // OpenExeConfiguration (String) diff --git a/mcs/class/System.Core/.gitattributes b/mcs/class/System.Core/.gitattributes deleted file mode 100644 index 6c272b92163..00000000000 --- a/mcs/class/System.Core/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/makefile.build -crlf diff --git a/mcs/class/System.Core/Makefile b/mcs/class/System.Core/Makefile index 52759a5b543..b7b41671d8c 100644 --- a/mcs/class/System.Core/Makefile +++ b/mcs/class/System.Core/Makefile @@ -11,11 +11,11 @@ LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720 endif ifeq (2.1, $(FRAMEWORK_VERSION)) -LIB_MCS_FLAGS += -d:CODEPLEX_40 -d:SILVERLIGHT +LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,ANDROID endif ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) -LIB_MCS_FLAGS += -d:CODEPLEX_40 +LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT endif ifneq (basic, $(PROFILE)) diff --git a/mcs/class/System.Core/System.Core-2008.JavaEE.csproj b/mcs/class/System.Core/System.Core-2008.JavaEE.csproj deleted file mode 100644 index a4a7919fa6e..00000000000 --- a/mcs/class/System.Core/System.Core-2008.JavaEE.csproj +++ /dev/null @@ -1,286 +0,0 @@ - - - Debug_Java - AnyCPU - 9.0.21022 - 2.0 - {31524C88-2016-4355-A0BF-E4103DA21705} - {F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - System.Core - 1.6 - 1 - 2.0 - false - - - - - 2.0 - System.Core - - - ipa - http://localhost/System.Core-2008.JavaEE/ - true - Web - true - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - true - false - true - - - v3.5 - - - true - full - false - bin\Debug_Java\ - TRACE;DEBUG;JAVA;NET_3_5;TARGET_JVM - prompt - 4 - 285212672 - false - false - 0 - - - pdbonly - true - bin\Release_Java\ - TRACE;JAVA - prompt - 4 - 285212672 - false - false - 0 - - - true - bin\Debug_Java20\ - TRACE;JAVA;NET_3_5;TARGET_JVM;DEBUG - 285212672 - full - AnyCPU - false - prompt - false - false - true - 0 - 1 - true - - - 0 - - - bin\Release_Java20\ - TRACE;JAVA;NET_3_5;TARGET_JVM - 285212672 - true - pdbonly - AnyCPU - false - prompt - false - false - true - 0 - 1 - true - - - 0 - - - - - - - - - - - - - - - - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/System.Core/System.Core-2008.csproj b/mcs/class/System.Core/System.Core-2008.csproj deleted file mode 100755 index ee9f8c07c23..00000000000 --- a/mcs/class/System.Core/System.Core-2008.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {D287D5CA-4F81-4215-AFC8-8A1413696884} - Library - Properties - System.Core - System.Core - v3.5 - 512 - - - true - full - false - bin\Debug\ - TRACE;DEBUG;NET_3_5 - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE;NET_3_5 - prompt - 4 - - - true - bin\Test.NET\ - TRACE;DEBUG;NET_3_5 - full - AnyCPU - prompt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/System.Core/System.Core-2008.sln b/mcs/class/System.Core/System.Core-2008.sln deleted file mode 100755 index 02b235fe045..00000000000 --- a/mcs/class/System.Core/System.Core-2008.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Core-2008", "System.Core-2008.csproj", "{D287D5CA-4F81-4215-AFC8-8A1413696884}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Core.Tests-2008", "Test\System.Core.Tests-2008.csproj", "{F902A50D-6156-4935-A1AC-E82DF0EB83D3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - Test.NET|Any CPU = Test.NET|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D287D5CA-4F81-4215-AFC8-8A1413696884}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D287D5CA-4F81-4215-AFC8-8A1413696884}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D287D5CA-4F81-4215-AFC8-8A1413696884}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D287D5CA-4F81-4215-AFC8-8A1413696884}.Release|Any CPU.Build.0 = Release|Any CPU - {D287D5CA-4F81-4215-AFC8-8A1413696884}.Test.NET|Any CPU.ActiveCfg = Test.NET|Any CPU - {D287D5CA-4F81-4215-AFC8-8A1413696884}.Test.NET|Any CPU.Build.0 = Test.NET|Any CPU - {F902A50D-6156-4935-A1AC-E82DF0EB83D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F902A50D-6156-4935-A1AC-E82DF0EB83D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F902A50D-6156-4935-A1AC-E82DF0EB83D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F902A50D-6156-4935-A1AC-E82DF0EB83D3}.Release|Any CPU.Build.0 = Release|Any CPU - {F902A50D-6156-4935-A1AC-E82DF0EB83D3}.Test.NET|Any CPU.ActiveCfg = Test.NET|Any CPU - {F902A50D-6156-4935-A1AC-E82DF0EB83D3}.Test.NET|Any CPU.Build.0 = Test.NET|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs b/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs index 5c10aade547..394b529af03 100644 --- a/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs +++ b/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs @@ -75,11 +75,12 @@ namespace System.Linq.Parallel.QueryNodes internal ConcurrentDictionary> GetStore () { var store = new ConcurrentDictionary> (); + Func> queueFactory = (_) => new ConcurrentQueue (); ParallelExecuter.ProcessAndBlock (Parent, (e, c) => { - ConcurrentQueue queue = store.GetOrAdd (keySelector (e), (_) => new ConcurrentQueue ()); - queue.Enqueue (elementSelector (e)); - }); + ConcurrentQueue queue = store.GetOrAdd (keySelector (e), queueFactory); + queue.Enqueue (elementSelector (e)); + }); return store; } diff --git a/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryJoinNode.cs b/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryJoinNode.cs index dc9602109fa..ba6f8a39a05 100644 --- a/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryJoinNode.cs +++ b/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryJoinNode.cs @@ -82,7 +82,7 @@ namespace System.Linq.Parallel.QueryNodes if (first.Count != second.Count) throw new InvalidOperationException ("Internal size mismatch"); - var store = new ConcurrentDictionary, VSlot>> (comparer); + var store = new TemporaryArea, VSlot>> (comparer); return first .Select ((f, i) => GetEnumerable (f, second[i], store, firstKeySelector, secondKeySelector, resultSelector)) @@ -98,7 +98,7 @@ namespace System.Linq.Parallel.QueryNodes if (first.Count != second.Count) throw new InvalidOperationException ("Internal size mismatch"); - var store = new ConcurrentDictionary>, VSlot>>> (comparer); + var store = new TemporaryArea>, VSlot>>> (comparer); return first .Select ((f, i) => GetEnumerable, KeyValuePair, KeyValuePair> (f, @@ -112,7 +112,7 @@ namespace System.Linq.Parallel.QueryNodes IEnumerable GetEnumerable (IEnumerable first, IEnumerable second, - ConcurrentDictionary, VSlot>> store, + TemporaryArea, VSlot>> store, Func fKeySelect, Func sKeySelect, Func resultor) diff --git a/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryWhereNode.cs b/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryWhereNode.cs index d3f16a5c112..8d9c9ad7f5f 100644 --- a/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryWhereNode.cs +++ b/mcs/class/System.Core/System.Linq.Parallel.QueryNodes/QueryWhereNode.cs @@ -79,11 +79,12 @@ namespace System.Linq.Parallel.QueryNodes IList>> sources = Parent.GetOrderedEnumerables (options); ProcessingSlot[] store = new ProcessingSlot[sources.Count]; + Comparison arrayComparison = ArraySortMethod; long lastIndex = 0; Barrier barrier = new Barrier (sources.Count, delegate (Barrier b) { // Sort the store - Array.Sort (store, ArraySortMethod); + Array.Sort (store, arrayComparison); // Reassign a good index int i = 0; diff --git a/mcs/class/System.Core/System.Linq.Parallel/OrderingEnumerator.cs b/mcs/class/System.Core/System.Linq.Parallel/OrderingEnumerator.cs index 8561d4cabbd..6012f790493 100644 --- a/mcs/class/System.Core/System.Linq.Parallel/OrderingEnumerator.cs +++ b/mcs/class/System.Core/System.Linq.Parallel/OrderingEnumerator.cs @@ -37,7 +37,7 @@ namespace System.Linq.Parallel { internal class SlotBucket { - readonly ConcurrentDictionary temporaryArea = new ConcurrentDictionary (); + readonly TemporaryArea temporaryArea = new TemporaryArea (); readonly KeyValuePair[] stagingArea; long currentIndex; diff --git a/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs b/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs index ee16845ff90..a8c19d68b15 100644 --- a/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs +++ b/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs @@ -117,7 +117,7 @@ namespace System.Linq.Parallel if (endAction != null) endAction (); } - }, options.Token, TaskCreationOptions.AttachedToParent, TaskScheduler.Default); + }, options.Token, TaskCreationOptions.AttachedToParent | TaskCreationOptions.LongRunning, TaskScheduler.Default); } return tasks; diff --git a/mcs/class/System.Core/System.Linq.Parallel/TemporaryArea.cs b/mcs/class/System.Core/System.Linq.Parallel/TemporaryArea.cs new file mode 100644 index 00000000000..b8be6abc055 --- /dev/null +++ b/mcs/class/System.Core/System.Linq.Parallel/TemporaryArea.cs @@ -0,0 +1,71 @@ +// +// TemporaryArea.cs +// +// Author: +// Jérémie "Garuma" Laval +// +// Copyright (c) 2012 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if NET_4_0 +using System; +using System.Threading; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Concurrent; + +namespace System.Linq.Parallel +{ + internal class TemporaryArea + { + Dictionary dict; + + public TemporaryArea () : this (EqualityComparer.Default) + { + + } + + public TemporaryArea (IEqualityComparer comparer) + { + this.dict = new Dictionary (comparer); + } + + public bool TryAdd (TKey index, TValue value) + { + lock (dict) { + if (dict.ContainsKey (index)) + return false; + dict.Add (index, value); + return true; + } + } + + public bool TryRemove (TKey index, out TValue value) + { + lock (dict) { + if (!dict.TryGetValue (index, out value)) + return false; + return dict.Remove (index); + } + } + } +} + +#endif diff --git a/mcs/class/System.Core/System.Threading/LockRecursionException.cs b/mcs/class/System.Core/System.Threading/LockRecursionException.cs index 974f7373bde..920465ae861 100644 --- a/mcs/class/System.Core/System.Threading/LockRecursionException.cs +++ b/mcs/class/System.Core/System.Threading/LockRecursionException.cs @@ -24,7 +24,7 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if NET_4_0 +#if NET_4_0 || MOBILE using System; using System.Runtime.CompilerServices; diff --git a/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs b/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs index d5447eb335b..74320c1e429 100644 --- a/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs +++ b/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs @@ -128,7 +128,7 @@ namespace System.Threading { return TryEnterReadLock (millisecondsTimeout, ref dummy); } - public bool TryEnterReadLock (int millisecondsTimeout, ref bool success) + bool TryEnterReadLock (int millisecondsTimeout, ref bool success) { ThreadLockState ctstate = CurrentThreadState; diff --git a/mcs/class/System.Core/System/TimeZoneInfo.cs b/mcs/class/System.Core/System/TimeZoneInfo.cs index 47315bb1ce2..da07cefa2cb 100644 --- a/mcs/class/System.Core/System/TimeZoneInfo.cs +++ b/mcs/class/System.Core/System/TimeZoneInfo.cs @@ -352,6 +352,13 @@ namespace System return new TimeZoneInfo (id, baseUtcOffset, displayName, standardDisplayName, daylightDisplayName, adjustmentRules, disableDaylightSavingTime); } +#if NET_4_5 + public override bool Equals (object obj) + { + return Equals (obj as TimeZoneInfo); + } +#endif + public bool Equals (TimeZoneInfo other) { if (other == null) diff --git a/mcs/class/System.Core/TODO b/mcs/class/System.Core/TODO deleted file mode 100644 index 488febdb95c..00000000000 --- a/mcs/class/System.Core/TODO +++ /dev/null @@ -1,33 +0,0 @@ -Things missing: - - *** Add support for MethodInfos ** and the nullable stuff, I believe - we have to pull the values before calling the various - MethodINfos in BinaryExpression, need to write test - - Coalesce's conversion, what is this used for? - - Constant generation of objects, how are those Constants in the first place? - - Try: - OrElse (Constant (new Boo(), new Boo ())) - -Tests missing: - - Must write tests for all the codepaths currently in - BinaryExpression.Emit (specially the XXXChecked variants as - those so far have shown most of the problems). - - - Write tests for stuff using MethodInfos (the various - BinaryExpressions using MEthodInfos have been barely tested). - - Write more tests using nullables, currently we are short on - them, and they are not extensively tested. - - Missing: - Add, Subtract, Multiply, Divide, Modulo, <<, >> And, Or, Xor - - MultiplyChecked, DivideChecked, - - case ExpressionType.OrElse: - case ExpressionType.AndAlso: diff --git a/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs b/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs index b88700b3914..612738ec143 100644 --- a/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs +++ b/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs @@ -53,26 +53,26 @@ namespace MonoTests.System.Linq [SetUpAttribute] public void Setup () { - baseEnumerable = Enumerable.Range(1, 10000); + baseEnumerable = Enumerable.Range(1, 1000); } - void AreEquivalent (IEnumerable syncEnumerable, IEnumerable asyncEnumerable, int count) + void AreEquivalent (IEnumerable syncEnumerable, IEnumerable async_resEnumerable, int count) { int[] sync = Enumerable.ToArray(syncEnumerable); - int[] async = Enumerable.ToArray(asyncEnumerable); + int[] async_res = Enumerable.ToArray(async_resEnumerable); // This is not AreEquals because ParallelQuery is non-deterministic (IParallelOrderedEnumerable is) // thus the order of the initial Enumerable might not be preserved string error = ""; - if (sync.Length != async.Length) - error = string.Format ("Expected size {0} but got {1} #{2}", sync.Length, async.Length, count); + if (sync.Length != async_res.Length) + error = string.Format ("Expected size {0} but got {1} #{2}", sync.Length, async_res.Length, count); Array.Sort (sync); - Array.Sort (async); + Array.Sort (async_res); int i, j; - for (i = j = 0; i < sync.Length && j < async.Length; ++i) { - if (sync [i] != async [j]) + for (i = j = 0; i < sync.Length && j < async_res.Length; ++i) { + if (sync [i] != async_res [j]) error += "missing " + sync [i] + ""; else ++j; @@ -81,14 +81,14 @@ namespace MonoTests.System.Linq Assert.Fail (error); } - void AreEquivalent (IEnumerable syncEnumerable, IEnumerable asyncEnumerable, int count) + void AreEquivalent (IEnumerable syncEnumerable, IEnumerable async_resEnumerable, int count) { T[] sync = Enumerable.ToArray(syncEnumerable); - T[] async = Enumerable.ToArray(asyncEnumerable); + T[] async_res = Enumerable.ToArray(async_resEnumerable); // This is not AreEquals because ParallelQuery is non-deterministic (IParallelOrderedEnumerable is) // thus the order of the initial Enumerable might not be preserved - CollectionAssert.AreEquivalent(sync, async, "#" + count); + CollectionAssert.AreEquivalent(sync, async_res, "#" + count); } static void AssertAreSame (IEnumerable expected, IEnumerable actual) @@ -216,9 +216,9 @@ namespace MonoTests.System.Linq { ParallelTestHelper.Repeat (() => { IEnumerable sync = baseEnumerable.Select (i => i * i); - IEnumerable async = baseEnumerable.AsParallel ().Select (i => i * i); + IEnumerable async_res = baseEnumerable.AsParallel ().Select (i => i * i); - AreEquivalent(sync, async, 1); + AreEquivalent(sync, async_res, 1); }); } @@ -227,9 +227,9 @@ namespace MonoTests.System.Linq { ParallelTestHelper.Repeat (() => { IEnumerable sync = baseEnumerable.Where(i => i % 2 == 0); - IEnumerable async = baseEnumerable.AsParallel().Where(i => i % 2 == 0); + IEnumerable async_res = baseEnumerable.AsParallel().Where(i => i % 2 == 0); - AreEquivalent(sync, async, 1); + AreEquivalent(sync, async_res, 1); }); } @@ -238,9 +238,9 @@ namespace MonoTests.System.Linq { ParallelTestHelper.Repeat (() => { int sync = baseEnumerable.Count(); - int async = baseEnumerable.AsParallel().Count(); + int async_res = baseEnumerable.AsParallel().Count(); - Assert.AreEqual(sync, async, "#1"); + Assert.AreEqual(sync, async_res, "#1"); }); } @@ -440,7 +440,7 @@ namespace MonoTests.System.Linq int [] result = {4, 3, 2, 1, 0}; AssertAreSame (result, ((IEnumerable)data).Select ((i) => i).AsReallyParallel ().AsOrdered ().Reverse ()); - AssertAreSame (result, ParallelEnumerable.Range (0, 5).WithExecutionMode (ParallelExecutionMode.ForceParallelism).AsOrdered ().Reverse ()); + AssertAreSame (result, ParallelEnumerable.Range (0, 5).AsReallyParallel ().AsOrdered ().Reverse ()); } [Test] @@ -582,7 +582,7 @@ namespace MonoTests.System.Linq } - [TestAttribute] + [Test] public void ElementAtTestCase() { //ParallelTestHelper.Repeat (() => { @@ -602,10 +602,13 @@ namespace MonoTests.System.Linq IEnumerable expected = outer.Join (inner, (e) => e.Item1, (e) => e.Item1, (e1, e2) => e1.Item2 + e2.Item2, EqualityComparer.Default); ParallelTestHelper.Repeat (() => { - ParallelQuery actual = outer.AsReallyParallel ().Join (inner.AsParallel (), (e) => e.Item1, (e) => e.Item1, (e1, e2) => e1.Item2 + e2.Item2, EqualityComparer.Default); - - AreEquivalent (expected, actual, 1); - }); + ParallelQuery actual = outer.AsReallyParallel ().Join (inner.AsParallel (), + (e) => e.Item1, + (e) => e.Item1, + (e1, e2) => e1.Item2 + e2.Item2, + EqualityComparer.Default); + AreEquivalent (expected, actual, 1); + }); } [Test] @@ -615,75 +618,74 @@ namespace MonoTests.System.Linq Tuple[] source = Enumerable.Range (0, num).Select ((i) => Tuple.Create (i / 10, i)).ToArray (); ParallelTestHelper.Repeat (() => { - ParallelQuery> actual = source.AsReallyParallel ().GroupBy ((e) => e.Item1, (e) => e.Item2, EqualityComparer.Default); - - foreach (var group in actual) { - Assert.GreaterOrEqual (group.Key, 0); - Assert.Less (group.Key, num / 10); - - int count = 0; - foreach (var e in group) { - count++; - Assert.GreaterOrEqual (e, group.Key * 10); - Assert.Less (e, (group.Key + 1) * 10); - } - - Assert.AreEqual (10, count, "count"); + ParallelQuery> actual = source.AsReallyParallel ().GroupBy ((e) => e.Item1, (e) => e.Item2, EqualityComparer.Default); + foreach (var group in actual) { + Assert.GreaterOrEqual (group.Key, 0); + Assert.Less (group.Key, num / 10); + + int count = 0; + foreach (var e in group) { + count++; + Assert.GreaterOrEqual (e, group.Key * 10); + Assert.Less (e, (group.Key + 1) * 10); } - }); + + Assert.AreEqual (10, count, "count"); + } + }); } - [TestAttribute] + [Test] public void TakeTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(2000); - IEnumerable sync = baseEnumerable.Take(2000); + ParallelQuery async_res = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(800); + IEnumerable sync = baseEnumerable.Take(800); - AreEquivalent(sync, async, 1); + AreEquivalent(sync, async_res, 1); - async = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(100); - sync = baseEnumerable.Take(100); + async_res = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(100); + sync = baseEnumerable.Take(100); - AreEquivalent(sync, async, 2); - }, 20); + AreEquivalent(sync, async_res, 2); + }); } [TestAttribute] public void UnorderedTakeTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async = baseEnumerable.AsReallyParallel ().Take(2000); - IEnumerable sync = baseEnumerable.Take (2000); + ParallelQuery async_res = baseEnumerable.AsReallyParallel ().Take(800); + IEnumerable sync = baseEnumerable.Take (800); - Assert.AreEqual (sync.Count (), async.Count (), "#1"); + Assert.AreEqual (sync.Count (), async_res.Count (), "#1"); - async = baseEnumerable.AsReallyParallel ().Take(100); - sync = baseEnumerable.Take(100); + async_res = baseEnumerable.AsReallyParallel ().Take(100); + sync = baseEnumerable.Take(100); - Assert.AreEqual (sync.Count (), async.Count (), "#2"); - }, 20); + Assert.AreEqual (sync.Count (), async_res.Count (), "#2"); + }); } [Test] public void SkipTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async = baseEnumerable.AsReallyParallel ().AsOrdered().Skip(2000); - IEnumerable sync = baseEnumerable.Skip(2000); + ParallelQuery async_res = baseEnumerable.AsReallyParallel ().AsOrdered().Skip (800); + IEnumerable sync = baseEnumerable.Skip (800); - AreEquivalent(sync, async, 1); - }, 20); + AreEquivalent (sync, async_res, 1); + }); } [Test] public void SkipTestCaseSmall () { ParallelTestHelper.Repeat (() => { - var async = baseEnumerable.AsReallyParallel ().Skip(100); + var async_res = baseEnumerable.AsReallyParallel ().Skip(100); var sync = baseEnumerable.Skip(100); - Assert.AreEqual (sync.Count (), async.Count ()); + Assert.AreEqual (sync.Count (), async_res.Count ()); }, 20); } @@ -691,11 +693,11 @@ namespace MonoTests.System.Linq public void ZipTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async1 = ParallelEnumerable.Range(0, 10000); - ParallelQuery async2 = ParallelEnumerable.Repeat(1, 10000).Zip(async1, (e1, e2) => e1 + e2); + ParallelQuery async_res1 = ParallelEnumerable.Range(0, 10000); + ParallelQuery async_res2 = ParallelEnumerable.Repeat(1, 10000).Zip(async_res1, (e1, e2) => e1 + e2); int[] expected = Enumerable.Range (1, 10000).ToArray (); - CollectionAssert.AreEquivalent(expected, Enumerable.ToArray (async2), "#1"); + CollectionAssert.AreEquivalent(expected, Enumerable.ToArray (async_res2), "#1"); }); } @@ -704,9 +706,9 @@ namespace MonoTests.System.Linq { ParallelTestHelper.Repeat (() => { IEnumerable sync = Enumerable.Range(1, 1000); - IEnumerable async = ParallelEnumerable.Range(1, 1000); + IEnumerable async_res = ParallelEnumerable.Range(1, 1000); - AreEquivalent (sync, async, 1); + AreEquivalent (sync, async_res, 1); }); } @@ -715,9 +717,9 @@ namespace MonoTests.System.Linq { ParallelTestHelper.Repeat (() => { IEnumerable sync = Enumerable.Repeat(1, 1000); - IEnumerable async = ParallelEnumerable.Repeat(1, 1000); + IEnumerable async_res = ParallelEnumerable.Repeat(1, 1000); - AreEquivalent (sync, async, 1); + AreEquivalent (sync, async_res, 1); }); } diff --git a/mcs/class/System.Core/Test/System.Linq/ParallelTestHelper.cs b/mcs/class/System.Core/Test/System.Linq/ParallelTestHelper.cs index eeeef86aedc..eec8e5905fd 100644 --- a/mcs/class/System.Core/Test/System.Linq/ParallelTestHelper.cs +++ b/mcs/class/System.Core/Test/System.Linq/ParallelTestHelper.cs @@ -31,7 +31,7 @@ namespace MonoTests.System.Linq { public static class ParallelTestHelper { - const int NumRun = 100; + const int NumRun = 17; public static void Repeat (Action action) { diff --git a/mcs/class/System.Core/dynamic_System.Core.dll.sources b/mcs/class/System.Core/dynamic_System.Core.dll.sources index dc1c798121e..83eaf846068 100644 --- a/mcs/class/System.Core/dynamic_System.Core.dll.sources +++ b/mcs/class/System.Core/dynamic_System.Core.dll.sources @@ -103,6 +103,7 @@ ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs @@ -114,6 +115,7 @@ ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs diff --git a/mcs/class/System.Core/makefile.build b/mcs/class/System.Core/makefile.build deleted file mode 100644 index 0dcab5019c2..00000000000 --- a/mcs/class/System.Core/makefile.build +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/System.Core/mobile_System.Core.dll.sources b/mcs/class/System.Core/mobile_System.Core.dll.sources index 9ecddc13563..d2c2a348d5f 100644 --- a/mcs/class/System.Core/mobile_System.Core.dll.sources +++ b/mcs/class/System.Core/mobile_System.Core.dll.sources @@ -41,7 +41,6 @@ System.Collections.Generic/HashSet.cs System.Security.Cryptography/Aes.cs System.Security.Cryptography/AesManaged.cs System.Security.Cryptography/AesTransform.cs -System.Threading/LockRecursionException.cs System.Threading/LockRecursionPolicy.cs System.Threading/ReaderWriterLockSlim.cs System.Threading/ThreadLockState.cs diff --git a/mcs/class/System.Core/net_4_0_System.Core.dll.sources b/mcs/class/System.Core/net_4_0_System.Core.dll.sources index dec843bb274..5c128eb0952 100644 --- a/mcs/class/System.Core/net_4_0_System.Core.dll.sources +++ b/mcs/class/System.Core/net_4_0_System.Core.dll.sources @@ -199,6 +199,7 @@ System.IO/HandleInheritability.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs +../dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs @@ -210,6 +211,7 @@ System.IO/HandleInheritability.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs +../dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs ../dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs System.Linq.Parallel/ParallelQueryEnumerator.cs @@ -228,6 +230,7 @@ System.Linq.Parallel/ConcurrentLookup.cs System.Linq.Parallel/ConcurrentGrouping.cs System.Linq.Parallel/ReverseList.cs System.Linq.Parallel/ParallelExecuter.cs +System.Linq.Parallel/TemporaryArea.cs System.Linq/ParallelQuery.cs System.Linq.Parallel.QueryNodes/QueryWhereNode.cs System.Linq.Parallel.QueryNodes/QueryCastNode.cs diff --git a/mcs/class/System.Core/net_4_5_System.Core.dll.sources b/mcs/class/System.Core/net_4_5_System.Core.dll.sources index 7406bccf12b..4d4f48c8538 100644 --- a/mcs/class/System.Core/net_4_5_System.Core.dll.sources +++ b/mcs/class/System.Core/net_4_5_System.Core.dll.sources @@ -1 +1,3 @@ #include net_4_0_System.Core.dll.sources + +../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs diff --git a/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs b/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs index 6135015bf2b..0f367dd986f 100644 --- a/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs @@ -65,9 +65,6 @@ using System.Runtime.InteropServices; [assembly: AllowPartiallyTrustedCallers] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -// Extension attribute should be added by compiler [assembly: SecurityCritical] [assembly: ComCompatibleVersion (1, 0, 3300, 0)] diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleException.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleException.cs index 0eacb644e18..4a7aa220a09 100644 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleException.cs +++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleException.cs @@ -21,20 +21,9 @@ using System.Runtime.Serialization; namespace System.Data.OracleClient { [Serializable] - public sealed class OracleException -#if NET_2_0 - : System.Data.Common.DbException -#else - : SystemException -#endif //NET_1_1 + public sealed class OracleException : System.Data.Common.DbException { - #region Fields - - private int code; - - #endregion // Fields - - #region Constructors + int code; internal OracleException (int code, string message) : base (message) { @@ -45,25 +34,13 @@ namespace System.Data.OracleClient { { code = si.GetInt32 ("code"); } - - #endregion // Constructors - - #region Properties - public int Code { get { return code; } } - - #endregion // Properties - - #region Override implementation of Exception - public override void GetObjectData (SerializationInfo si, StreamingContext context) { si.AddValue ("code", code, typeof(int)); base.GetObjectData (si, context); } - - #endregion Override implementation of Exception } } diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdated.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdated.cs index c253b0264e4..3e524230fed 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdated.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdated.cs @@ -34,6 +34,7 @@ using NUnit.Framework; namespace MonoTests.System.Data.OracleClient { [TestFixture] + [Category ("NotWorking")] public class OracleDataAdapter_RowUpdated : ADONetTesterClass { public static void Main() diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdating.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdating.cs index e1cc763d7cf..f9901b33578 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdating.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_RowUpdating.cs @@ -34,6 +34,7 @@ using NUnit.Framework; namespace MonoTests.System.Data.OracleClient { [TestFixture] + [Category ("NotWorking")] public class OracleDataAdapter_RowUpdating : ADONetTesterClass { public static void Main() diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dr.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dr.cs index 9c41e9f8919..f1dfec34666 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dr.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dr.cs @@ -34,6 +34,7 @@ using NUnit.Framework; namespace MonoTests.System.Data.OracleClient { [TestFixture] + [Category ("NotWorking")] public class OracleDataAdapter_Update_Dr : ADONetTesterClass { public static void Main() diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs index 5b268987632..e375cb45127 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs @@ -36,6 +36,7 @@ using Microsoft.ApplicationBlocks; namespace MonoTests.System.Data.OracleClient { [TestFixture] +[Category ("NotWorking")] public class OracleParameter_ctor_SOtype : ADONetTesterClass { private Exception exp; diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtypeI.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtypeI.cs index 24177c784b1..de8ab5f3748 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtypeI.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtypeI.cs @@ -33,6 +33,7 @@ using NUnit.Framework; namespace MonoTests.System.Data.OracleClient { [TestFixture] +[Category ("NotWorking")] public class OracleParameter_ctor_SOtypeI : GHTBase { public static void Main() diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype_IS.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype_IS.cs index 2f4a06609c5..77d3355d5dc 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype_IS.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype_IS.cs @@ -33,6 +33,7 @@ using NUnit.Framework; namespace MonoTests.System.Data.OracleClient { [TestFixture] +[Category ("NotWorking")] public class OracleParameter_ctor_SOtype_IS : GHTBase { public static void Main() diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameterCollection/OracleParameterCollection_Add.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameterCollection/OracleParameterCollection_Add.cs index 502c6ebb492..68f61bbd325 100644 --- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameterCollection/OracleParameterCollection_Add.cs +++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameterCollection/OracleParameterCollection_Add.cs @@ -33,6 +33,7 @@ using NUnit.Framework; namespace MonoTests.System.Data.OracleClient { [TestFixture] + [Category ("NotWorking")] public class OracleParameterCollection_Add : ADONetTesterClass { public static void Main() diff --git a/mcs/class/System.Data.Services.Client/Assembly/AssemblyInfo.cs b/mcs/class/System.Data.Services.Client/Assembly/AssemblyInfo.cs index 93914e9b475..be6cfea5b22 100644 --- a/mcs/class/System.Data.Services.Client/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Data.Services.Client/Assembly/AssemblyInfo.cs @@ -59,7 +59,6 @@ using System.Runtime.Versioning; [assembly: AssemblyInformationalVersion(Consts.FxFileVersion)] [assembly: AssemblyFileVersion(Consts.FxFileVersion)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: NeutralResourcesLanguage ("en-US")] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: SecurityRules (SecurityRuleSet.Level1, SkipVerificationInFullTrust=true)] diff --git a/mcs/class/System.Data/Makefile b/mcs/class/System.Data/Makefile index 648db864b41..b015667e2a1 100644 --- a/mcs/class/System.Data/Makefile +++ b/mcs/class/System.Data/Makefile @@ -44,7 +44,7 @@ LIB_MCS_FLAGS += \ endif endif -TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -nowarn:618,169,612,219,168 +TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168 TEST_MONO_PATH = . @@ -57,8 +57,10 @@ EXTRA_DISTFILES = \ Test/System.Data/schemas/ChangeLog \ $(wildcard Test/System.Data/schemas/*.xsd) \ Mono.Data.SqlExpressions/Parser.jay \ - app_test_2.0.config \ - Test/System.Data/binserialize/*.bin + app_test_net_2_0.config \ + app_test_net_4_5.config \ + Test/System.Data/binserialize/*.bin \ + SqliteTest.db BUILT_SOURCES = Mono.Data.SqlExpressions/Parser.cs @@ -68,9 +70,7 @@ Mono.Data.SqlExpressions/Parser.cs: Mono.Data.SqlExpressions/Parser.jay $(topdir include ../../build/library.make -ifeq (net_2_0, $(PROFILE)) $(test_lib): $(test_lib).config -$(test_lib).config: app_test_2.0.config +$(test_lib).config: app_test_$(PROFILE).config cp $< $@ -endif diff --git a/mcs/class/System.Data/Microsoft.SqlServer.Server/IBinarySerialize.cs b/mcs/class/System.Data/Microsoft.SqlServer.Server/IBinarySerialize.cs index b78786dd456..cf1624b86a6 100644 --- a/mcs/class/System.Data/Microsoft.SqlServer.Server/IBinarySerialize.cs +++ b/mcs/class/System.Data/Microsoft.SqlServer.Server/IBinarySerialize.cs @@ -40,7 +40,7 @@ namespace Microsoft.SqlServer.Server { #region Methods void Read (BinaryReader r); - void Write (BinaryWriter r); + void Write (BinaryWriter w); #endregion // Methods } diff --git a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlMetaData.cs b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlMetaData.cs index 81651b39ead..f939a38b294 100644 --- a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlMetaData.cs +++ b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlMetaData.cs @@ -44,87 +44,87 @@ namespace Microsoft.SqlServer.Server { SqlCompareOptions compareOptions = SqlCompareOptions.None; string databaseName = null; - long localeId = 0L; + long _localeId = 0L; long maxLength = 0L; string name; byte precision = 10; byte scale = 0; string owningSchema = null; string objectName = null; - SqlDbType sqlDbType = SqlDbType.NVarChar; - DbType dbType = DbType.String; + SqlDbType _sqlDbType = SqlDbType.NVarChar; + DbType _dbType = DbType.String; Type type = typeof (string); #endregion // Fields #region Constructors - public SqlMetaData (string name, SqlDbType sqlDbType) + public SqlMetaData (string name, SqlDbType dbType) { if (name == null) throw new ArgumentNullException ("name can not be null"); - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Bit: maxLength = 1; precision = 1; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Boolean; + _dbType = DbType.Boolean; type = typeof (bool); break; case SqlDbType.BigInt: maxLength = 8; precision = 19; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int64; + _dbType = DbType.Int64; type = typeof (long); break; case SqlDbType.DateTime: maxLength = 8; precision = 23; scale = 3; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.DateTime; + _dbType = DbType.DateTime; type = typeof (DateTime); break; case SqlDbType.Decimal: maxLength = 9; precision = 18; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Decimal; + _dbType = DbType.Decimal; type = typeof (decimal); break; case SqlDbType.Float: maxLength = 8; precision = 53; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Double; + _dbType = DbType.Double; type = typeof (float); break; case SqlDbType.Int: maxLength = 4; precision = 10; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int32; + _dbType = DbType.Int32; type = typeof (int); break; case SqlDbType.Money: maxLength = 8; precision = 19; scale = 4; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Currency; + _dbType = DbType.Currency; type = typeof (double); break; /* @@ -140,139 +140,139 @@ namespace Microsoft.SqlServer.Server { maxLength = 4; precision = 16; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.DateTime; + _dbType = DbType.DateTime; type = typeof (DateTime); break; case SqlDbType.SmallInt: maxLength = 2; precision = 5; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int16; + _dbType = DbType.Int16; type = typeof (short); break; case SqlDbType.SmallMoney: maxLength = 4; precision = 10; scale = 4; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Currency; + _dbType = DbType.Currency; type = typeof (double); break; case SqlDbType.Timestamp: maxLength = 8; precision = 0; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.DateTime; + _dbType = DbType.DateTime; type = typeof (DateTime); break; case SqlDbType.TinyInt: maxLength = 1; precision = 3; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int16; + _dbType = DbType.Int16; type = typeof (short); break; case SqlDbType.UniqueIdentifier: maxLength = 16; precision = 0; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Guid; + _dbType = DbType.Guid; type = typeof (Guid); break; case SqlDbType.Xml: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.Xml; + _dbType = DbType.Xml; type = typeof (string); break; default: throw new ArgumentException ("SqlDbType not supported"); } this.name = name; - this.sqlDbType = sqlDbType; + this._sqlDbType = dbType; } - public SqlMetaData (string name, SqlDbType sqlDbType, long maxLength) + public SqlMetaData (string name, SqlDbType dbType, long maxLength) { if (name == null) throw new ArgumentNullException ("name can not be null"); - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Binary: compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.Binary; + _dbType = DbType.Binary; type = typeof (byte []); break; case SqlDbType.Char: - localeId = Thread.CurrentThread.CurrentCulture.LCID; + _localeId = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.AnsiStringFixedLength; + _dbType = DbType.AnsiStringFixedLength; type = typeof (string); break; case SqlDbType.Image: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Binary; + _dbType = DbType.Binary; type = typeof (byte []); break; case SqlDbType.NChar: - localeId = Thread.CurrentThread.CurrentCulture.LCID; + _localeId = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (string); break; case SqlDbType.NText: maxLength = -1; precision = 0; scale = 0; - localeId = Thread.CurrentThread.CurrentCulture.LCID; + _localeId = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (string); break; case SqlDbType.NVarChar: maxLength = -1; - localeId = Thread.CurrentThread.CurrentCulture.LCID; + _localeId = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (string); break; case SqlDbType.Text: maxLength = -1; precision = 0; scale = 0; - localeId = Thread.CurrentThread.CurrentCulture.LCID; + _localeId = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (char []); break; case SqlDbType.VarBinary: maxLength = -1; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.Binary; + _dbType = DbType.Binary; type = typeof (byte []); break; case SqlDbType.VarChar: maxLength = -1; - localeId = Thread.CurrentThread.CurrentCulture.LCID; + _localeId = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (char []); break; default: @@ -280,22 +280,22 @@ namespace Microsoft.SqlServer.Server { } this.maxLength = maxLength; this.name = name; - this.sqlDbType = sqlDbType; + this._sqlDbType = dbType; } [MonoTODO] - public SqlMetaData (string name, SqlDbType sqlDbType, Type userDefinedType) + public SqlMetaData (string name, SqlDbType dbType, Type userDefinedType) { if (name == null) throw new ArgumentNullException ("name can not be null"); - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Udt: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Guid; + _dbType = DbType.Guid; type = typeof (Guid); break; default: @@ -307,175 +307,175 @@ namespace Microsoft.SqlServer.Server { throw new NotImplementedException (); } - public SqlMetaData (string name, SqlDbType sqlDbType, byte precision, byte scale) + public SqlMetaData (string name, SqlDbType dbType, byte precision, byte scale) { if (name == null) throw new ArgumentNullException ("name can not be null"); - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Decimal: maxLength = 9; this.precision = precision; this.scale = scale; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Decimal; + _dbType = DbType.Decimal; type = typeof (decimal); break; default: throw new ArgumentException ("SqlDbType not supported"); } this.name = name; - this.sqlDbType = sqlDbType; + this._sqlDbType = dbType; } - public SqlMetaData (string name, SqlDbType sqlDbType, long maxLength, long locale, SqlCompareOptions compareOptions) + public SqlMetaData (string name, SqlDbType dbType, long maxLength, long locale, SqlCompareOptions compareOptions) { if (name == null) throw new ArgumentNullException ("name can not be null"); - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Char: - dbType = DbType.AnsiStringFixedLength; + _dbType = DbType.AnsiStringFixedLength; type = typeof (char []); break; case SqlDbType.NChar: - dbType = DbType.StringFixedLength; + _dbType = DbType.StringFixedLength; type = typeof (char []); break; case SqlDbType.NText: case SqlDbType.NVarChar: - dbType = DbType.String; + _dbType = DbType.String; type = typeof (string); break; case SqlDbType.Text: case SqlDbType.VarChar: - dbType = DbType.AnsiString; + _dbType = DbType.AnsiString; type = typeof (char []); break; default: throw new ArgumentException ("SqlDbType not supported"); } this.compareOptions = compareOptions; - this.localeId = locale; + this._localeId = locale; this.maxLength = maxLength; this.name = name; - this.sqlDbType = sqlDbType; + this._sqlDbType = dbType; } - public SqlMetaData (string name, SqlDbType sqlDbType, string database, string owningSchema, string objectName) + public SqlMetaData (string name, SqlDbType dbType, string database, string owningSchema, string objectName) { if ((name == null || objectName == null) && database != null && owningSchema != null) throw new ArgumentNullException ("name can not be null"); - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Xml: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + _localeId = 0; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (string); break; default: throw new ArgumentException ("SqlDbType not supported"); } this.name = name; - this.sqlDbType = sqlDbType; + this._sqlDbType = dbType; databaseName = database; this.owningSchema = owningSchema; this.objectName = objectName; } - public SqlMetaData (string name, SqlDbType sqlDbType, long maxLength, byte precision, - byte scale, long localeId, SqlCompareOptions compareOptions, + public SqlMetaData (string name, SqlDbType dbType, long maxLength, byte precision, + byte scale, long locale, SqlCompareOptions compareOptions, Type userDefinedType) { if (name == null) throw new ArgumentNullException ("name can not be null"); this.compareOptions = compareOptions; - this.localeId = localeId; + this._localeId = locale; this.maxLength = maxLength; this.precision = precision; this.scale = scale; - switch (sqlDbType) { + switch (dbType) { case SqlDbType.Bit: maxLength = 1; precision = 1; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Boolean; + _dbType = DbType.Boolean; type = typeof (bool); break; case SqlDbType.BigInt: maxLength = 8; precision = 19; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int64; + _dbType = DbType.Int64; type = typeof (long); break; case SqlDbType.DateTime: maxLength = 8; precision = 23; scale = 3; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.DateTime; + _dbType = DbType.DateTime; type = typeof (DateTime); break; case SqlDbType.Decimal: maxLength = 9; precision = 18; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Decimal; + _dbType = DbType.Decimal; type = typeof (decimal); break; case SqlDbType.Float: maxLength = 8; precision = 53; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Decimal; + _dbType = DbType.Decimal; type = typeof (float); break; case SqlDbType.Image: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Binary; + _dbType = DbType.Binary; type = typeof (byte []); break; case SqlDbType.Int: maxLength = 4; precision = 10; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int32; + _dbType = DbType.Int32; type = typeof (int); break; case SqlDbType.Money: maxLength = 8; precision = 19; scale = 4; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Currency; + _dbType = DbType.Currency; type = typeof (decimal); break; case SqlDbType.NText: maxLength = -1; precision = 0; scale = 0; - localeId = Thread.CurrentThread.CurrentCulture.LCID; + locale = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.String; + _dbType = DbType.String; type = typeof (string); break; /* @@ -491,99 +491,99 @@ namespace Microsoft.SqlServer.Server { maxLength = 4; precision = 24; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Single; + _dbType = DbType.Single; type = typeof (Single); break; case SqlDbType.SmallDateTime: maxLength = 4; precision = 16; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.DateTime; + _dbType = DbType.DateTime; type = typeof (DateTime); break; case SqlDbType.SmallInt: maxLength = 2; precision = 5; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int16; + _dbType = DbType.Int16; type = typeof (short); break; case SqlDbType.SmallMoney: maxLength = 4; precision = 10; scale = 4; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Currency; + _dbType = DbType.Currency; type = typeof (decimal); break; case SqlDbType.Text: maxLength = -1; precision = 0; scale = 0; - localeId = Thread.CurrentThread.CurrentCulture.LCID; + locale = Thread.CurrentThread.CurrentCulture.LCID; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.AnsiString; + _dbType = DbType.AnsiString; type = typeof (char []); break; case SqlDbType.Timestamp: maxLength = 8; precision = 0; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Byte; + _dbType = DbType.Byte; type = typeof (byte []); break; case SqlDbType.TinyInt: maxLength = 1; precision = 3; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Int16; + _dbType = DbType.Int16; type = typeof (short); break; case SqlDbType.UniqueIdentifier: maxLength = 16; precision = 0; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Guid; + _dbType = DbType.Guid; type = typeof (Guid); break; case SqlDbType.Udt: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Object; + _dbType = DbType.Object; type = typeof (object); break; case SqlDbType.Variant: maxLength = 8016; precision = 0; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.None; - dbType = DbType.Object; + _dbType = DbType.Object; type = typeof (object); break; case SqlDbType.Xml: maxLength = -1; precision = 0; scale = 0; - localeId = 0; + locale = 0; compareOptions = SqlCompareOptions.IgnoreCase | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreWidth; - dbType = DbType.Xml; + _dbType = DbType.Xml; type = typeof (string); break; default: @@ -600,7 +600,7 @@ namespace Microsoft.SqlServer.Server { throw new ArgumentException ("SqlDbType not supported"); } this.name = name; - this.sqlDbType = sqlDbType; + this._sqlDbType = dbType; } #endregion // Constructors @@ -612,11 +612,11 @@ namespace Microsoft.SqlServer.Server { } public DbType DbType { - get { return dbType; } + get { return _dbType; } } public long LocaleId { - get { return localeId; } + get { return _localeId; } } public static long Max { @@ -640,7 +640,7 @@ namespace Microsoft.SqlServer.Server { } public SqlDbType SqlDbType { - get { return sqlDbType; } + get { return _sqlDbType; } } public string XmlSchemaCollectionDatabase { diff --git a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs index debe4587c3e..a38f13a9622 100644 --- a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs +++ b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs @@ -54,9 +54,9 @@ namespace Microsoft.SqlServer.Server { #region Constructors - public SqlUserDefinedAggregateAttribute (Format f) + public SqlUserDefinedAggregateAttribute (Format format) { - format = f; + this.format = format; IsInvariantToDuplicates = false; IsInvariantToNulls = false; IsInvariantToOrder = false; diff --git a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs index ecb474d9ca5..79a02f7cdd5 100644 --- a/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs +++ b/mcs/class/System.Data/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs @@ -52,9 +52,9 @@ namespace Microsoft.SqlServer.Server { #region Constructors - public SqlUserDefinedTypeAttribute (Format f) + public SqlUserDefinedTypeAttribute (Format format) { - format = f; + this.format = format; IsByteOrdered = false; IsFixedLength = false; MaxByteSize = MaxByteSizeValue; diff --git a/mcs/class/System.Data/SqliteTest.db b/mcs/class/System.Data/SqliteTest.db new file mode 100644 index 00000000000..1236a9d6332 Binary files /dev/null and b/mcs/class/System.Data/SqliteTest.db differ diff --git a/mcs/class/System.Data/System.Data.Common/DataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DataAdapter.cs index 3e5d1c5d750..591a746a567 100644 --- a/mcs/class/System.Data/System.Data.Common/DataAdapter.cs +++ b/mcs/class/System.Data/System.Data.Common/DataAdapter.cs @@ -81,20 +81,20 @@ namespace System.Data.Common #endif } - protected DataAdapter (DataAdapter adapter) + protected DataAdapter (DataAdapter from) { - AcceptChangesDuringFill = adapter.AcceptChangesDuringFill; - ContinueUpdateOnError = adapter.ContinueUpdateOnError; - MissingMappingAction = adapter.MissingMappingAction; - MissingSchemaAction = adapter.MissingSchemaAction; + AcceptChangesDuringFill = from.AcceptChangesDuringFill; + ContinueUpdateOnError = from.ContinueUpdateOnError; + MissingMappingAction = from.MissingMappingAction; + MissingSchemaAction = from.MissingSchemaAction; - if (adapter.tableMappings != null) - foreach (ICloneable cloneable in adapter.TableMappings) + if (from.tableMappings != null) + foreach (ICloneable cloneable in from.TableMappings) TableMappings.Add (cloneable.Clone ()); #if NET_2_0 - acceptChangesDuringUpdate = adapter.AcceptChangesDuringUpdate; - fillLoadOption = adapter.FillLoadOption; - returnProviderSpecificTypes = adapter.ReturnProviderSpecificTypes; + acceptChangesDuringUpdate = from.AcceptChangesDuringUpdate; + fillLoadOption = from.FillLoadOption; + returnProviderSpecificTypes = from.ReturnProviderSpecificTypes; #endif } diff --git a/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs b/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs index eb8d74f5590..22e6f1338e6 100644 --- a/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs +++ b/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs @@ -195,9 +195,9 @@ namespace System.Data.Common } #if NET_2_0 - public void CopyTo (DataColumnMapping [] arr, int index) + public void CopyTo (DataColumnMapping [] array, int index) { - list.CopyTo (arr, index); + list.CopyTo (array, index); } #endif @@ -291,11 +291,11 @@ namespace System.Data.Common } #if NET_2_0 - public void Insert (int index, DataColumnMapping mapping) + public void Insert (int index, DataColumnMapping value) { - list.Insert (index, mapping); - sourceColumns [mapping.SourceColumn] = mapping; - dataSetColumns [mapping.DataSetColumn] = mapping; + list.Insert (index, value); + sourceColumns [value.SourceColumn] = value; + dataSetColumns [value.DataSetColumn] = value; } #endif diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs index bf5e54a6caf..ae3262f24da 100644 --- a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs +++ b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs @@ -565,11 +565,11 @@ namespace System.Data.Common { return GetDeleteCommand (false); } - public DbCommand GetDeleteCommand (bool option) + public DbCommand GetDeleteCommand (bool useColumnsForParameterNames) { BuildCache (true); - if (_deleteCommand == null || option) - return CreateDeleteCommand (option); + if (_deleteCommand == null || useColumnsForParameterNames) + return CreateDeleteCommand (useColumnsForParameterNames); return _deleteCommand; } @@ -578,16 +578,16 @@ namespace System.Data.Common { return GetInsertCommand (false, null); } - public DbCommand GetInsertCommand (bool option) + public DbCommand GetInsertCommand (bool useColumnsForParameterNames) { - return GetInsertCommand (option, null); + return GetInsertCommand (useColumnsForParameterNames, null); } - internal DbCommand GetInsertCommand (bool option, DataRow row) + internal DbCommand GetInsertCommand (bool useColumnsForParameterNames, DataRow row) { BuildCache (true); - if (_insertCommand == null || option) - return CreateInsertCommand (option, row); + if (_insertCommand == null || useColumnsForParameterNames) + return CreateInsertCommand (useColumnsForParameterNames, row); return _insertCommand; } @@ -596,11 +596,11 @@ namespace System.Data.Common { return GetUpdateCommand (false); } - public DbCommand GetUpdateCommand (bool option) + public DbCommand GetUpdateCommand (bool useColumnsForParameterNames) { BuildCache (true); - if (_updateCommand == null || option) - return CreateUpdateCommand (option); + if (_updateCommand == null || useColumnsForParameterNames) + return CreateUpdateCommand (useColumnsForParameterNames); return _updateCommand; } @@ -647,25 +647,25 @@ namespace System.Data.Common { _insertCommand = null; } - protected void RowUpdatingHandler (RowUpdatingEventArgs args) + protected void RowUpdatingHandler (RowUpdatingEventArgs rowUpdatingEvent) { - if (args.Command != null) + if (rowUpdatingEvent.Command != null) return; try { - switch (args.StatementType) { + switch (rowUpdatingEvent.StatementType) { case StatementType.Insert: - args.Command = GetInsertCommand (false, args.Row); + rowUpdatingEvent.Command = GetInsertCommand (false, rowUpdatingEvent.Row); break; case StatementType.Update: - args.Command = GetUpdateCommand (); + rowUpdatingEvent.Command = GetUpdateCommand (); break; case StatementType.Delete: - args.Command = GetDeleteCommand (); + rowUpdatingEvent.Command = GetDeleteCommand (); break; } } catch (Exception e) { - args.Errors = e; - args.Status = UpdateStatus.ErrorsOccurred; + rowUpdatingEvent.Errors = e; + rowUpdatingEvent.Status = UpdateStatus.ErrorsOccurred; } } @@ -675,9 +675,9 @@ namespace System.Data.Common { protected abstract void SetRowUpdatingHandler (DbDataAdapter adapter); - protected virtual DataTable GetSchemaTable (DbCommand cmd) + protected virtual DataTable GetSchemaTable (DbCommand sourceCommand) { - using (DbDataReader rdr = cmd.ExecuteReader ()) + using (DbDataReader rdr = sourceCommand.ExecuteReader ()) return rdr.GetSchemaTable (); } diff --git a/mcs/class/System.Data/System.Data.Common/DbConnection.cs b/mcs/class/System.Data/System.Data.Common/DbConnection.cs index 1bbc6797c92..dad77673bbc 100644 --- a/mcs/class/System.Data/System.Data.Common/DbConnection.cs +++ b/mcs/class/System.Data/System.Data.Common/DbConnection.cs @@ -743,10 +743,10 @@ namespace System.Data.Common { public abstract void Open (); - protected virtual void OnStateChange (StateChangeEventArgs stateChanged) + protected virtual void OnStateChange (StateChangeEventArgs stateChange) { if (StateChange != null) - StateChange (this, stateChanged); + StateChange (this, stateChange); } #endregion // Methods diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs index 3fdc3ca1105..f438cb100f1 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs @@ -866,6 +866,28 @@ namespace System.Data.Common if (dataTable == null) throw new ArgumentException (String.Format ("Missing table {0}", srcTable)); + + /** Copied from another Update function **/ + if (tableMapping != null) { + foreach (DataColumn col in dataTable.Columns) { + if (tableMapping.ColumnMappings.IndexOf (col.ColumnName) >= 0) + continue; + DataColumnMapping columnMapping = DataColumnMappingCollection.GetColumnMappingBySchemaAction (tableMapping.ColumnMappings, col.ColumnName, MissingMappingAction); + if (columnMapping == null) + columnMapping = new DataColumnMapping (col.ColumnName, col.ColumnName); + tableMapping.ColumnMappings.Add (columnMapping); + } + } else { + ArrayList cmc = new ArrayList (); + foreach (DataColumn col in dataTable.Columns) + cmc.Add (new DataColumnMapping (col.ColumnName, col.ColumnName)); + tableMapping = + new DataTableMapping ( + dataTable.TableName, + dataTable.TableName, + cmc.ToArray (typeof (DataColumnMapping)) as DataColumnMapping []); + } + /**end insert from another update**/ return Update (dataTable, tableMapping); } diff --git a/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs b/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs index bfb97364f16..ccc45404d64 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs @@ -45,10 +45,8 @@ namespace System.Data.Common { bool allowBlankPassword; string keyRestrictions; -#if NET_1_1 KeyRestrictionBehavior keyRestrictionBehavior; string connectionString; -#endif #endregion // Fields @@ -77,7 +75,6 @@ namespace System.Data.Common { set { keyRestrictions = value; } } -#if NET_1_1 public string ConnectionString { get { if (connectionString == null) @@ -94,12 +91,10 @@ namespace System.Data.Common { keyRestrictionBehavior = value; } } -#endif #endregion // Properties #region // Methods -#if NET_2_0 [EditorBrowsableAttribute (EditorBrowsableState.Never)] public bool ShouldSerializeConnectionString () { @@ -113,7 +108,6 @@ namespace System.Data.Common { // FIXME: configurable ? why is this in the attribute class ? return false; } -#endif #endregion // Methods } } diff --git a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs index 7d046978a41..b7eac3ee159 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs @@ -53,7 +53,7 @@ namespace System.Data.Common { public abstract int FieldCount { get; } public abstract bool HasRows { get; } public abstract bool IsClosed { get; } - public abstract object this [int index] { get; } + public abstract object this [int ordinal] { get; } public abstract object this [string name] { get; } public abstract int RecordsAffected { get; } @@ -67,11 +67,11 @@ namespace System.Data.Common { #region Methods public abstract void Close (); - public abstract bool GetBoolean (int i); - public abstract byte GetByte (int i); - public abstract long GetBytes (int i, long fieldOffset, byte[] buffer, int bufferOffset, int length); - public abstract char GetChar (int i); - public abstract long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length); + public abstract bool GetBoolean (int ordinal); + public abstract byte GetByte (int ordinal); + public abstract long GetBytes (int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length); + public abstract char GetChar (int ordinal); + public abstract long GetChars (int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length); [EditorBrowsable (EditorBrowsableState.Never)] public void Dispose () @@ -86,40 +86,40 @@ namespace System.Data.Common { } #if NET_2_0 [EditorBrowsable (EditorBrowsableState.Never)] - public DbDataReader GetData (int i) + public DbDataReader GetData (int ordinal) { - return ((DbDataReader) this [i]); + return ((DbDataReader) this [ordinal]); } #endif - public abstract string GetDataTypeName (int i); - public abstract DateTime GetDateTime (int i); - public abstract decimal GetDecimal (int i); - public abstract double GetDouble (int i); + public abstract string GetDataTypeName (int ordinal); + public abstract DateTime GetDateTime (int ordinal); + public abstract decimal GetDecimal (int ordinal); + public abstract double GetDouble (int ordinal); [EditorBrowsable (EditorBrowsableState.Never)] public abstract IEnumerator GetEnumerator (); - public abstract Type GetFieldType (int i); - public abstract float GetFloat (int i); - public abstract Guid GetGuid (int i); - public abstract short GetInt16 (int i); - public abstract int GetInt32 (int i); - public abstract long GetInt64 (int i); - public abstract string GetName (int i); + public abstract Type GetFieldType (int ordinal); + public abstract float GetFloat (int ordinal); + public abstract Guid GetGuid (int ordinal); + public abstract short GetInt16 (int ordinal); + public abstract int GetInt32 (int ordinal); + public abstract long GetInt64 (int ordinal); + public abstract string GetName (int ordinal); public abstract int GetOrdinal (string name); #if NET_2_0 [EditorBrowsable (EditorBrowsableState.Never)] - public virtual Type GetProviderSpecificFieldType (int i) + public virtual Type GetProviderSpecificFieldType (int ordinal) { - return GetFieldType (i); + return GetFieldType (ordinal); } [EditorBrowsable (EditorBrowsableState.Never)] - public virtual object GetProviderSpecificValue (int i) + public virtual object GetProviderSpecificValue (int ordinal) { - return GetValue (i); + return GetValue (ordinal); } [EditorBrowsable (EditorBrowsableState.Never)] @@ -135,16 +135,16 @@ namespace System.Data.Common { #endif public abstract DataTable GetSchemaTable (); - public abstract string GetString (int i); - public abstract object GetValue (int i); + public abstract string GetString (int ordinal); + public abstract object GetValue (int ordinal); public abstract int GetValues (object[] values); - IDataReader IDataRecord.GetData (int i) + IDataReader IDataRecord.GetData (int ordinal) { - return ((IDataReader) this).GetData (i); + return ((IDataReader) this).GetData (ordinal); } - public abstract bool IsDBNull (int i); + public abstract bool IsDBNull (int ordinal); public abstract bool NextResult (); public abstract bool Read (); diff --git a/mcs/class/System.Data/System.Data.Common/DbException.cs b/mcs/class/System.Data/System.Data.Common/DbException.cs index b5e41618192..e19bbfb60a8 100644 --- a/mcs/class/System.Data/System.Data.Common/DbException.cs +++ b/mcs/class/System.Data/System.Data.Common/DbException.cs @@ -55,7 +55,7 @@ namespace System.Data.Common { { } - protected DbException (string message, int errorcode) : base(message,errorcode) + protected DbException (string message, int errorCode) : base(message,errorCode) { } } diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs index 97d5e35e768..ca4f4905c9d 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs @@ -133,23 +133,13 @@ namespace System.Data.Odbc } [OdbcDescriptionAttribute ("Time to wait for command to execute")] -#if NET_1_0 || ONLY_1_1 - [DefaultValue (DEFAULT_COMMAND_TIMEOUT)] -#endif - public -#if NET_2_0 - override -#endif + public override int CommandTimeout { get { return timeout; } set { if (value < 0) -#if NET_2_0 throw new ArgumentException ("The property value assigned is less than 0.", "CommandTimeout"); -#else - throw new ArgumentException ("The property value assigned is less than 0."); -#endif timeout = value; } } diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs index 2ff951e506f..613cbe42c08 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs @@ -578,17 +578,17 @@ namespace System.Data.Odbc #if NET_2_0 protected override void ApplyParameterInfo (DbParameter parameter, - DataRow row, + DataRow datarow, StatementType statementType, bool whereClause) { OdbcParameter odbcParam = (OdbcParameter) parameter; - odbcParam.Size = int.Parse (row ["ColumnSize"].ToString ()); - if (row ["NumericPrecision"] != DBNull.Value) - odbcParam.Precision = byte.Parse (row ["NumericPrecision"].ToString ()); - if (row ["NumericScale"] != DBNull.Value) - odbcParam.Scale = byte.Parse (row ["NumericScale"].ToString ()); - odbcParam.DbType = (DbType) row ["ProviderType"]; + odbcParam.Size = int.Parse (datarow ["ColumnSize"].ToString ()); + if (datarow ["NumericPrecision"] != DBNull.Value) + odbcParam.Precision = byte.Parse (datarow ["NumericPrecision"].ToString ()); + if (datarow ["NumericScale"] != DBNull.Value) + odbcParam.Scale = byte.Parse (datarow ["NumericScale"].ToString ()); + odbcParam.DbType = (DbType) datarow ["ProviderType"]; } protected override string GetParameterName (string parameterName) diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs index 48942ac1ac2..5ae8bc4ce50 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs @@ -110,14 +110,14 @@ namespace System.Data.Odbc } #if NET_2_0 - public void CopyTo (OdbcError [] array, int index) + public void CopyTo (OdbcError [] array, int i) { if (array == null) throw new ArgumentNullException ("array"); - if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound (0))) + if ((i < array.GetLowerBound (0)) || (i > array.GetUpperBound (0))) throw new ArgumentOutOfRangeException ("index"); - ((OdbcError[]) (_items.ToArray ())).CopyTo (array, index); + ((OdbcError[]) (_items.ToArray ())).CopyTo (array, i); } #endif diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs index 24d45c1c3b9..4849969f1a5 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs @@ -35,8 +35,5 @@ using System.Data.Common; namespace System.Data.Odbc { -#if NET_1_0 - [Serializable] -#endif public delegate void OdbcInfoMessageEventHandler (object sender, OdbcInfoMessageEventArgs e); } diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs index a7fc66f7c79..d258bc8a42b 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs @@ -345,9 +345,9 @@ namespace System.Data.Odbc } #if NET_2_0 - protected override DbParameter GetParameter (string name) + protected override DbParameter GetParameter (string parameterName) { - return this [name]; + return this [parameterName]; } protected override DbParameter GetParameter (int index) @@ -355,9 +355,9 @@ namespace System.Data.Odbc return this [index]; } - protected override void SetParameter (string name, DbParameter value) + protected override void SetParameter (string parameterName, DbParameter value) { - this [name] = (OdbcParameter) value; + this [parameterName] = (OdbcParameter) value; } protected override void SetParameter (int index, DbParameter value) diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs index da7db7e807f..a198de6bb2c 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs @@ -38,9 +38,7 @@ namespace System.Data.Odbc { #region Constructors -#if NET_1_1 [Obsolete ("use OdbcPermission(PermissionState.None)", true)] -#endif public OdbcPermission () : base (PermissionState.None) { @@ -51,9 +49,7 @@ namespace System.Data.Odbc { } -#if NET_1_1 [Obsolete ("use OdbcPermission(PermissionState.None)", true)] -#endif public OdbcPermission (PermissionState state, bool allowBlankPassword) : base (state) { diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs index 93a15db03aa..6346d5d392b 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs @@ -128,20 +128,20 @@ namespace System.Data.OleDb #region Methods #if NET_2_0 - protected override void ApplyParameterInfo (DbParameter dbParameter, - DataRow row, + protected override void ApplyParameterInfo (DbParameter parameter, + DataRow datarow, StatementType statementType, bool whereClause) { - OleDbParameter parameter = (OleDbParameter) dbParameter; - parameter.Size = int.Parse (row ["ColumnSize"].ToString ()); - if (row ["NumericPrecision"] != DBNull.Value) { - parameter.Precision = byte.Parse (row ["NumericPrecision"].ToString ()); + OleDbParameter p = (OleDbParameter) parameter; + p.Size = int.Parse (datarow ["ColumnSize"].ToString ()); + if (datarow ["NumericPrecision"] != DBNull.Value) { + p.Precision = byte.Parse (datarow ["NumericPrecision"].ToString ()); } - if (row ["NumericScale"] != DBNull.Value) { - parameter.Scale = byte.Parse (row ["NumericScale"].ToString ()); + if (datarow ["NumericScale"] != DBNull.Value) { + p.Scale = byte.Parse (datarow ["NumericScale"].ToString ()); } - parameter.DbType = (DbType) row ["ProviderType"]; + p.DbType = (DbType) datarow ["ProviderType"]; } #endif @@ -205,9 +205,9 @@ namespace System.Data.OleDb throw new NotImplementedException (); } - protected override string GetParameterName (int position) + protected override string GetParameterName (int parameterOrdinal) { - return String.Format("@p{0}", position); + return String.Format("@p{0}", parameterOrdinal); } protected override string GetParameterName (string parameterName) @@ -215,9 +215,9 @@ namespace System.Data.OleDb return String.Format("@{0}", parameterName); } - protected override string GetParameterPlaceholder (int position) + protected override string GetParameterPlaceholder (int parameterOrdinal) { - return GetParameterName (position); + return GetParameterName (parameterOrdinal); } #endif diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs index 82d148ea0b0..2cf99546123 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs @@ -76,17 +76,10 @@ namespace System.Data.OleDb [DataCategory ("Data")] [DefaultValue ("")] -#if NET_1_0 || ONLY_1_1 - [DataSysDescriptionAttribute ("Information used to connect to a Data Source.")] -#endif [EditorAttribute ("Microsoft.VSDesigner.Data.ADO.Design.OleDbConnectionStringEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )] [RecommendedAsConfigurable (true)] [RefreshPropertiesAttribute (RefreshProperties.All)] - public -#if NET_2_0 - override -#endif - string ConnectionString { + public override string ConnectionString { get { if (connectionString == null) return string.Empty; @@ -98,27 +91,14 @@ namespace System.Data.OleDb } [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)] -#if !NET_2_0 - [DataSysDescriptionAttribute ("Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.")] -#endif - public -#if NET_2_0 - override -#endif - int ConnectionTimeout { + public override int ConnectionTimeout { get { return connectionTimeout; } } [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)] -#if !NET_2_0 - [DataSysDescriptionAttribute ("Current data source catalog value, 'Initial Catalog=X' in the connection string.")] -#endif - public -#if NET_2_0 - override -#endif + public override string Database { get { if (gdaConnection != IntPtr.Zero @@ -130,17 +110,8 @@ namespace System.Data.OleDb } } -#if NET_2_0 [BrowsableAttribute (true)] -#else - [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)] - [DataSysDescriptionAttribute ("Current data source, 'Data Source=X' in the connection string.")] -#endif - public -#if NET_2_0 - override -#endif - string DataSource { + public override string DataSource { get { if (gdaConnection != IntPtr.Zero && libgda.gda_connection_is_open (gdaConnection)) { @@ -152,11 +123,7 @@ namespace System.Data.OleDb } [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)] -#if NET_2_0 [BrowsableAttribute (true)] -#else - [DataSysDescriptionAttribute ("Current OLE DB provider progid, 'Provider=X' in the connection string.")] -#endif public string Provider { get { if (gdaConnection != IntPtr.Zero @@ -168,16 +135,7 @@ namespace System.Data.OleDb } } -#if !NET_2_0 - [DataSysDescriptionAttribute ("Version of the product accessed by the OLE DB Provider.")] - [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)] - [BrowsableAttribute (false)] -#endif - public -#if NET_2_0 - override -#endif - string ServerVersion { + public override string ServerVersion { get { if (State == ConnectionState.Closed) throw ExceptionHelper.ConnectionClosed (); @@ -186,15 +144,8 @@ namespace System.Data.OleDb } [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)] -#if !NET_2_0 - [DataSysDescriptionAttribute ("The ConnectionState indicating whether the connection is open or closed.")] -#endif [BrowsableAttribute (false)] - public -#if NET_2_0 - override -#endif - ConnectionState State { + public override ConnectionState State { get { if (gdaConnection != IntPtr.Zero) { if (libgda.gda_connection_is_open (gdaConnection)) @@ -229,7 +180,6 @@ namespace System.Data.OleDb return new OleDbTransaction (this, isolationLevel); } -#if NET_2_0 protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) { return BeginTransaction (isolationLevel); @@ -239,28 +189,8 @@ namespace System.Data.OleDb { return CreateCommand (); } -#else - IDbTransaction IDbConnection.BeginTransaction () - { - return BeginTransaction (); - } - IDbTransaction IDbConnection.BeginTransaction (IsolationLevel isolationLevel) - { - return BeginTransaction (isolationLevel); - } - - IDbCommand IDbConnection.CreateCommand () - { - return CreateCommand (); - } -#endif - - public -#if NET_2_0 - override -#endif - void ChangeDatabase (string value) + public override void ChangeDatabase (string value) { if (State != ConnectionState.Open) throw new InvalidOperationException (); @@ -269,11 +199,7 @@ namespace System.Data.OleDb throw new OleDbException (this); } - public -#if NET_2_0 - override -#endif - void Close () + public override void Close () { if (State == ConnectionState.Open) { libgda.gda_connection_close (gdaConnection); diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs index dfbc9f34740..542c84d8dc7 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs @@ -102,12 +102,7 @@ namespace System.Data.OleDb } } -#if NET_1_0 || ONLY_1_1 - override -#else - new -#endif - public string Message { + new public string Message { get { GdaList glist; IntPtr errors; @@ -129,12 +124,7 @@ namespace System.Data.OleDb } } -#if NET_1_0 || ONLY_1_1 - override -#else - new -#endif - public string Source { + new public string Source { get { GdaList glist; IntPtr errors; diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs index 44797ea1784..af23b58cd72 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs @@ -48,9 +48,7 @@ namespace System.Data.OleDb #region Constructors -#if NET_1_1 [Obsolete ("use OleDbPermission(PermissionState.None)", true)] -#endif public OleDbPermission () : base (PermissionState.None) { @@ -61,9 +59,7 @@ namespace System.Data.OleDb { } -#if NET_1_1 [Obsolete ("use OleDbPermission(PermissionState.None)", true)] -#endif public OleDbPermission (PermissionState state, bool allowBlankPassword) : base (state) { @@ -86,11 +82,9 @@ namespace System.Data.OleDb #region Properties -#if NET_2_0 [Obsolete ()] [BrowsableAttribute (false)] [EditorBrowsableAttribute (EditorBrowsableState.Never)] -#endif public string Provider { get { if (_provider == null) @@ -108,36 +102,6 @@ namespace System.Data.OleDb { return new OleDbPermission (this); } - -#if !NET_2_0 - // methods required to support Provider were removed in Fx 2.0 - // i.e. Provider isn't included in the XML output - - public override void FromXml (SecurityElement securityElement) - { - base.FromXml (securityElement); - // Provider - } - - [MonoTODO ("is it worth to implement as it is being removed ?")] - public override IPermission Intersect (IPermission target) - { - return base.Intersect (target); - } - - public override SecurityElement ToXml () - { - SecurityElement se = base.ToXml (); - // add Provider - return se; - } - - [MonoTODO ("is it worth to implement as it is being removed ?")] - public override IPermission Union (IPermission target) - { - return base.Union (target); - } -#endif #endregion } } diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs index 7b141315d9e..c66bf3328c2 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs @@ -85,12 +85,10 @@ namespace System.Data.SqlClient { return new SqlClientPermission (this); } -#if NET_1_1 public override void Add (string connectionString, string restrictions, KeyRestrictionBehavior behavior) { base.Add (connectionString, restrictions, behavior); } -#endif #endregion // Methods } } diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs index 2f860ddd10c..4cf4df0f4bb 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs @@ -135,18 +135,11 @@ namespace System.Data.SqlClient #region Properties -#if NET_1_0 || ONLY_1_1 - [DataSysDescription ("Information used to connect to a DataSource, such as 'Data Source=x;Initial Catalog=x;Integrated Security=SSPI'.")] -#endif [DefaultValue ("")] [EditorAttribute ("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )] [RecommendedAsConfigurable (true)] [RefreshProperties (RefreshProperties.All)] - public -#if NET_2_0 - override -#endif // NET_2_0 - string ConnectionString { + public override string ConnectionString { get { if (connectionString == null) return string.Empty; @@ -1737,9 +1730,6 @@ namespace System.Data.SqlClient #region Properties Net 2 -#if NET_1_0 - [DataSysDescription ("Enable Asynchronous processing, 'Asynchrouse Processing=true/false' in the ConnectionString.")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] internal bool AsyncProcessing { get { return async; } diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs index 0dd0da89ecc..542a564bd1b 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs @@ -45,12 +45,7 @@ using Mono.Data.Tds.Protocol; namespace System.Data.SqlClient { [Serializable] - public sealed class SqlException -#if NET_2_0 - : DbException -#else - : SystemException -#endif //NET_1_1 + public sealed class SqlException : DbException { #region Fields diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlAlreadyFilledException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlAlreadyFilledException.cs index 7fdf6b6a01d..46757d42638 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlAlreadyFilledException.cs +++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlAlreadyFilledException.cs @@ -47,8 +47,8 @@ namespace System.Data.SqlTypes { { } - public SqlAlreadyFilledException (string message, Exception inner) - : base (message, inner) + public SqlAlreadyFilledException (string message, Exception e) + : base (message, e) { } diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs index a6fab12a907..c7c0468ab21 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs +++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs @@ -34,9 +34,7 @@ using System.Runtime.Serialization; namespace System.Data.SqlTypes { -#if NET_1_1 [Serializable] -#endif public sealed class SqlNullValueException : SqlTypeException, ISerializable { public SqlNullValueException () diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs index 15312cd35d5..ca476adc08a 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs +++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs @@ -34,9 +34,7 @@ using System.Runtime.Serialization; namespace System.Data.SqlTypes { -#if NET_1_1 [Serializable] -#endif public sealed class SqlTruncateException : SqlTypeException, ISerializable { public SqlTruncateException () diff --git a/mcs/class/System.Data/System.Data.csproj b/mcs/class/System.Data/System.Data.csproj deleted file mode 100644 index eb146a063bf..00000000000 --- a/mcs/class/System.Data/System.Data.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - Library - $(MSBuildProjectName) - v2.0 - true - 649 - 65001 - true - false - - - NET_1_1,NET_2_0 - - - - - - - - - ..\lib\net_2_0\Mono.Data.Tds.dll - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/System.Data/System.Data.sln b/mcs/class/System.Data/System.Data.sln deleted file mode 100644 index 1f5b45537f5..00000000000 --- a/mcs/class/System.Data/System.Data.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Data", "System.Data.vmwcsproj", "{12CA069B-C324-48C1-9836-0014497A212C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug_Java = Debug_Java - Release = Release - Release_Java = Release_Java - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {12CA069B-C324-48C1-9836-0014497A212C}.Debug.ActiveCfg = Debug|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Debug.Build.0 = Debug|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Debug_Java.ActiveCfg = Debug_Java|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Debug_Java.Build.0 = Debug_Java|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Release.ActiveCfg = Release|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Release.Build.0 = Release|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Release_Java.ActiveCfg = Release_Java|.NET - {12CA069B-C324-48C1-9836-0014497A212C}.Release_Java.Build.0 = Release_Java|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/mcs/class/System.Data/System.Data/DBConcurrencyException.cs b/mcs/class/System.Data/System.Data/DBConcurrencyException.cs index 78d408acf6e..f556a9c93bb 100644 --- a/mcs/class/System.Data/System.Data/DBConcurrencyException.cs +++ b/mcs/class/System.Data/System.Data/DBConcurrencyException.cs @@ -108,7 +108,7 @@ namespace System.Data } [MonoTODO] - public void CopyToRows (DataRow [] array, int ArrayIndex) + public void CopyToRows (DataRow [] array, int arrayIndex) { throw new NotImplementedException (); } diff --git a/mcs/class/System.Data/System.Data/DataRelation.cs b/mcs/class/System.Data/System.Data/DataRelation.cs index 89076a3357c..923f1799526 100644 --- a/mcs/class/System.Data/System.Data/DataRelation.cs +++ b/mcs/class/System.Data/System.Data/DataRelation.cs @@ -138,15 +138,15 @@ namespace System.Data #if NET_2_0 [Browsable (false)] public DataRelation (string relationName, string parentTableName, - string parentTableNameSpace, string childTableName, - string childTableNameSpace, string[] parentColumnNames, + string parentTableNamespace, string childTableName, + string childTableNamespace, string[] parentColumnNames, string[] childColumnNames, bool nested) { _relationName = relationName; _parentTableName = parentTableName; - _parentTableNameSpace = parentTableNameSpace; + _parentTableNameSpace = parentTableNamespace; _childTableName = childTableName; - _childTableNameSpace = childTableNameSpace; + _childTableNameSpace = childTableNamespace; _parentColumnNames = parentColumnNames; _childColumnNames = childColumnNames; _nested = nested; diff --git a/mcs/class/System.Data/System.Data/DataRowCollection.cs b/mcs/class/System.Data/System.Data/DataRowCollection.cs index 3cef9793b8e..abd8126d092 100644 --- a/mcs/class/System.Data/System.Data/DataRowCollection.cs +++ b/mcs/class/System.Data/System.Data/DataRowCollection.cs @@ -123,11 +123,7 @@ namespace System.Data /// /// Creates a row using specified values and adds it to the DataRowCollection. /// -#if NET_2_0 public DataRow Add (params object[] values) -#else - public virtual DataRow Add (object[] values) -#endif { if (values == null) throw new NullReferenceException (); @@ -155,24 +151,16 @@ namespace System.Data string err = String.Format ("Cannot clear table Parent because " + "ForeignKeyConstraint {0} enforces Child.", uc.ConstraintName); -#if NET_1_1 throw new InvalidConstraintException (err); -#else - throw new ArgumentException (err); -#endif } } -#if NET_2_0 table.DataTableClearing (); -#endif List.Clear (); // Remove from indexes table.ResetIndexes (); -#if NET_2_0 table.DataTableCleared (); -#endif OnListChanged (this, new ListChangedEventArgs (ListChangedType.Reset, -1, -1)); } @@ -340,7 +328,6 @@ namespace System.Data } } -#if NET_2_0 sealed partial class DataRowCollection { public override int Count { get { return List.Count; } @@ -351,9 +338,9 @@ namespace System.Data CopyTo ((Array) array, index); } - public override void CopyTo (Array array, int index) + public override void CopyTo (Array ar, int index) { - base.CopyTo (array, index); + base.CopyTo (ar, index); } public override IEnumerator GetEnumerator () @@ -361,15 +348,4 @@ namespace System.Data return base.GetEnumerator (); } } -#else - [Serializable] - partial class DataRowCollection { - /// - /// This member overrides InternalDataCollectionBase.List - /// - protected override ArrayList List { - get { return base.List; } - } - } -#endif } diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs index 9d6b56d68c5..573ab1bf7da 100644 --- a/mcs/class/System.Data/System.Data/DataSet.cs +++ b/mcs/class/System.Data/System.Data/DataSet.cs @@ -1552,7 +1552,7 @@ namespace System.Data private bool dataSetInitialized = true; public event EventHandler Initialized; - protected DataSet (SerializationInfo info, StreamingContext context, bool constructSchema) + protected DataSet (SerializationInfo info, StreamingContext context, bool ConstructSchema) : this () { if (DetermineSchemaSerializationMode (info, context) == SchemaSerializationMode.ExcludeSchema) { @@ -1564,7 +1564,7 @@ namespace System.Data return; } - if (constructSchema) { + if (ConstructSchema) { string s = info.GetValue ("XmlSchema", typeof (String)) as String; XmlTextReader reader = new XmlTextReader (new StringReader (s)); ReadXmlSchema (reader); diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs index 551da284b54..36036b2e2ae 100644 --- a/mcs/class/System.Data/System.Data/DataTable.cs +++ b/mcs/class/System.Data/System.Data/DataTable.cs @@ -2368,10 +2368,10 @@ namespace System.Data { } partial class DataTable { - public DataTable (string tableName, string tbNamespace) + public DataTable (string tableName, string tableNamespace) : this (tableName) { - _nameSpace = tbNamespace; + _nameSpace = tableNamespace; } SerializationFormat remotingFormat = SerializationFormat.Xml; diff --git a/mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs b/mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs index 0af251926d7..d4e301e4be9 100644 --- a/mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs +++ b/mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs @@ -40,9 +40,9 @@ namespace System.Data #endregion //Fields #region Constructors - public DataTableClearEventArgs(DataTable table) + public DataTableClearEventArgs(DataTable dataTable) { - _table = table; + _table = dataTable; } #endregion // Constructors diff --git a/mcs/class/System.Data/System.Data/DataTableCollection.cs b/mcs/class/System.Data/System.Data/DataTableCollection.cs index b4537e4c6f0..21204a5d568 100644 --- a/mcs/class/System.Data/System.Data/DataTableCollection.cs +++ b/mcs/class/System.Data/System.Data/DataTableCollection.cs @@ -372,16 +372,16 @@ namespace System.Data #if NET_2_0 sealed partial class DataTableCollection { - public DataTable this [string name, string tbNamespace] { + public DataTable this [string name, string tableNamespace] { get { - int index = IndexOf (name, tbNamespace, true); + int index = IndexOf (name, tableNamespace, true); return index < 0 ? null : (DataTable) List [index]; } } - public DataTable Add (string name, string tbNamespace) + public DataTable Add (string name, string tableNamespace) { - DataTable table = new DataTable (name, tbNamespace); + DataTable table = new DataTable (name, tableNamespace); this.Add (table); return table; } diff --git a/mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs b/mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs index 88d64cc7cdc..99a67f277c8 100644 --- a/mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs +++ b/mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs @@ -40,9 +40,9 @@ namespace System.Data #endregion //Fields #region Constructors - public DataTableNewRowEventArgs(DataRow row) + public DataTableNewRowEventArgs(DataRow dataRow) { - _row = row; + _row = dataRow; } #endregion // Constructors diff --git a/mcs/class/System.Data/System.Data/DataTableReader.cs b/mcs/class/System.Data/System.Data/DataTableReader.cs index a1b5ac11daa..cf0faca9374 100644 --- a/mcs/class/System.Data/System.Data/DataTableReader.cs +++ b/mcs/class/System.Data/System.Data/DataTableReader.cs @@ -52,8 +52,8 @@ namespace System.Data { #region Constructors - public DataTableReader (DataTable dt) - : this (new DataTable[] {dt}) + public DataTableReader (DataTable dataTable) + : this (new DataTable[] {dataTable}) { } @@ -96,15 +96,15 @@ namespace System.Data { get { return _closed; } } - public override object this [int index] { + public override object this [int ordinal] { get { Validate (); - if (index < 0 || index >= FieldCount) - throw new ArgumentOutOfRangeException ("index " + index + " is not in the range"); + if (ordinal < 0 || ordinal >= FieldCount) + throw new ArgumentOutOfRangeException ("index " + ordinal + " is not in the range"); DataRow row = CurrentRow; if (row.RowState == DataRowState.Deleted) throw new InvalidOperationException ("Deleted Row's information cannot be accessed!"); - return row [index]; + return row [ordinal]; } } @@ -170,21 +170,21 @@ namespace System.Data { _closed = true; } - public override bool GetBoolean (int i) + public override bool GetBoolean (int ordinal) { - return (bool) GetValue (i); + return (bool) GetValue (ordinal); } - public override byte GetByte (int i) + public override byte GetByte (int ordinal) { - return (byte) GetValue (i); + return (byte) GetValue (ordinal); } - public override long GetBytes (int i, long dataIndex, byte[] buffer, int bufferIndex, int length) + public override long GetBytes (int ordinal, long dataIndex, byte[] buffer, int bufferIndex, int length) { - byte[] value = this [i] as byte[]; + byte[] value = this [ordinal] as byte[]; if (value == null) - ThrowInvalidCastException (this [i].GetType (), typeof (byte[])); + ThrowInvalidCastException (this [ordinal].GetType (), typeof (byte[])); if (buffer == null) return value.Length; int copylen = length > value.Length ? value.Length : length; @@ -192,16 +192,16 @@ namespace System.Data { return copylen; } - public override char GetChar (int i) + public override char GetChar (int ordinal) { - return (char) GetValue (i); + return (char) GetValue (ordinal); } - public override long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length) + public override long GetChars (int ordinal, long dataIndex, char[] buffer, int bufferIndex, int length) { - char[] value = this [i] as char[]; + char[] value = this [ordinal] as char[]; if (value == null) - ThrowInvalidCastException (this [i].GetType (), typeof (char[])); + ThrowInvalidCastException (this [ordinal].GetType (), typeof (char[])); if (buffer == null) return value.Length; int copylen = length > value.Length ? value.Length : length; @@ -209,24 +209,24 @@ namespace System.Data { return copylen; } - public override string GetDataTypeName (int i) + public override string GetDataTypeName (int ordinal) { - return GetFieldType (i).ToString (); + return GetFieldType (ordinal).ToString (); } - public override DateTime GetDateTime (int i) + public override DateTime GetDateTime (int ordinal) { - return (DateTime) GetValue (i); + return (DateTime) GetValue (ordinal); } - public override decimal GetDecimal (int i) + public override decimal GetDecimal (int ordinal) { - return (decimal) GetValue (i); + return (decimal) GetValue (ordinal); } - public override double GetDouble (int i) + public override double GetDouble (int ordinal) { - return (double) GetValue (i); + return (double) GetValue (ordinal); } public override IEnumerator GetEnumerator () @@ -234,46 +234,46 @@ namespace System.Data { return new DbEnumerator (this); } - public override Type GetProviderSpecificFieldType (int i) + public override Type GetProviderSpecificFieldType (int ordinal) { - return GetFieldType (i); + return GetFieldType (ordinal); } - public override Type GetFieldType (int i) + public override Type GetFieldType (int ordinal) { ValidateClosed (); - return CurrentTable.Columns [i].DataType; + return CurrentTable.Columns [ordinal].DataType; } - public override float GetFloat (int i) + public override float GetFloat (int ordinal) { - return (float) GetValue (i); + return (float) GetValue (ordinal); } - public override Guid GetGuid (int i) + public override Guid GetGuid (int ordinal) { - return (Guid) GetValue (i); + return (Guid) GetValue (ordinal); } - public override short GetInt16 (int i) + public override short GetInt16 (int ordinal) { - return (short) GetValue (i); + return (short) GetValue (ordinal); } - public override int GetInt32 (int i) + public override int GetInt32 (int ordinal) { - return (int) GetValue (i); + return (int) GetValue (ordinal); } - public override long GetInt64 (int i) + public override long GetInt64 (int ordinal) { - return (long) GetValue (i); + return (long) GetValue (ordinal); } - public override string GetName (int i) + public override string GetName (int ordinal) { ValidateClosed (); - return CurrentTable.Columns [i].ColumnName; + return CurrentTable.Columns [ordinal].ColumnName; } public override int GetOrdinal (string name) @@ -285,9 +285,9 @@ namespace System.Data { return index; } - public override object GetProviderSpecificValue (int i) + public override object GetProviderSpecificValue (int ordinal) { - return GetValue (i); + return GetValue (ordinal); } public override int GetProviderSpecificValues (object[] values) @@ -295,14 +295,14 @@ namespace System.Data { return GetValues (values); } - public override string GetString (int i) + public override string GetString (int ordinal) { - return (string) GetValue (i); + return (string) GetValue (ordinal); } - public override object GetValue (int i) + public override object GetValue (int ordinal) { - return this [i]; + return this [ordinal]; } public override int GetValues (object[] values) @@ -317,9 +317,9 @@ namespace System.Data { return count; } - public override bool IsDBNull (int i) + public override bool IsDBNull (int ordinal) { - return GetValue (i) is DBNull; + return GetValue (ordinal) is DBNull; } public override DataTable GetSchemaTable () diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs index ec3903b89e0..102e4f950f0 100644 --- a/mcs/class/System.Data/System.Data/DataView.cs +++ b/mcs/class/System.Data/System.Data/DataView.cs @@ -1141,21 +1141,21 @@ namespace System.Data } partial class DataView { - public virtual bool Equals (DataView dv) + public virtual bool Equals (DataView view) { - if (this == dv) + if (this == view) return true; - if (!(this.Table == dv.Table && this.Sort == dv.Sort && - this.RowFilter == dv.RowFilter && - this.RowStateFilter == dv.RowStateFilter && - this.AllowEdit == dv.AllowEdit && - this.AllowNew == dv.AllowNew && - this.AllowDelete == dv.AllowDelete && - this.Count == dv.Count)) + if (!(this.Table == view.Table && this.Sort == view.Sort && + this.RowFilter == view.RowFilter && + this.RowStateFilter == view.RowStateFilter && + this.AllowEdit == view.AllowEdit && + this.AllowNew == view.AllowNew && + this.AllowDelete == view.AllowDelete && + this.Count == view.Count)) return false; for (int i = 0; i < Count; ++i) - if (!this [i].Equals (dv [i])) + if (!this [i].Equals (view [i])) return false; return true; } @@ -1169,17 +1169,17 @@ namespace System.Data return this.ToTable (tableName, false, new string[] {}); } - public DataTable ToTable (bool isDistinct, params string[] columnNames) + public DataTable ToTable (bool distinct, params string[] columnNames) { - return this.ToTable (Table.TableName, isDistinct, columnNames); + return this.ToTable (Table.TableName, distinct, columnNames); } - public DataTable ToTable (string tablename, bool isDistinct, params string[] columnNames) + public DataTable ToTable (string tableName, bool distinct, params string[] columnNames) { if (columnNames == null) throw new ArgumentNullException ("columnNames", "'columnNames' argument cannot be null."); - DataTable newTable = new DataTable (tablename); + DataTable newTable = new DataTable (tableName); DataColumn[] columns; ListSortDirection[] sortDirection = null; @@ -1225,7 +1225,7 @@ namespace System.Data else index = new Index (new Key(Table, columns, sortDirection, RowStateFilter, rowFilterExpr)); - if (isDistinct) + if (distinct) rows = index.GetDistinctRows (); else rows = index.GetAllRows (); diff --git a/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs b/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs index d4dcfe05c88..648efe60900 100644 --- a/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs +++ b/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public DeletedRowInaccessibleException (string message, Exception inner) - : base (message, inner) + public DeletedRowInaccessibleException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/DuplicateNameException.cs b/mcs/class/System.Data/System.Data/DuplicateNameException.cs index ccb7eae6066..ebaaf6ae92a 100644 --- a/mcs/class/System.Data/System.Data/DuplicateNameException.cs +++ b/mcs/class/System.Data/System.Data/DuplicateNameException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public DuplicateNameException (string message, Exception inner) - : base (message, inner) + public DuplicateNameException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/EvaluateException.cs b/mcs/class/System.Data/System.Data/EvaluateException.cs index b9977551cd7..980a1037373 100644 --- a/mcs/class/System.Data/System.Data/EvaluateException.cs +++ b/mcs/class/System.Data/System.Data/EvaluateException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public EvaluateException (string message, Exception inner) - : base (message, inner) + public EvaluateException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs b/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs index 965810599cc..c82a032cf30 100644 --- a/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs +++ b/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs @@ -509,7 +509,10 @@ namespace System.Data { bool hasErrors = false; foreach (DataRow row in Table.Rows) { - // first we check if all values in _childColumns place are nulls. + if (row.RowState == DataRowState.Deleted) + continue; + + // we check if all values in _childColumns place are nulls. // if yes we return. if (row.IsNullColumns(_childColumns)) continue; diff --git a/mcs/class/System.Data/System.Data/InRowChangingEventException.cs b/mcs/class/System.Data/System.Data/InRowChangingEventException.cs index fd9308e81a3..3fa4e70b858 100644 --- a/mcs/class/System.Data/System.Data/InRowChangingEventException.cs +++ b/mcs/class/System.Data/System.Data/InRowChangingEventException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public InRowChangingEventException (string message, Exception inner) - : base (message, inner) + public InRowChangingEventException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/InvalidConstraintException.cs b/mcs/class/System.Data/System.Data/InvalidConstraintException.cs index 40d96516fe5..f7030523dc7 100644 --- a/mcs/class/System.Data/System.Data/InvalidConstraintException.cs +++ b/mcs/class/System.Data/System.Data/InvalidConstraintException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public InvalidConstraintException (string message, Exception inner) - : base (message, inner) + public InvalidConstraintException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/InvalidExpressionException.cs b/mcs/class/System.Data/System.Data/InvalidExpressionException.cs index a5694be08be..9da5f2ae1a0 100644 --- a/mcs/class/System.Data/System.Data/InvalidExpressionException.cs +++ b/mcs/class/System.Data/System.Data/InvalidExpressionException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public InvalidExpressionException (string message, Exception inner) - : base (message, inner) + public InvalidExpressionException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs b/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs index 6578794314b..c4ce9c3dc08 100644 --- a/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs +++ b/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public MissingPrimaryKeyException (string message, Exception inner) - : base (message, inner) + public MissingPrimaryKeyException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/NoNullAllowedException.cs b/mcs/class/System.Data/System.Data/NoNullAllowedException.cs index d61be7ba5c3..91bd5920688 100644 --- a/mcs/class/System.Data/System.Data/NoNullAllowedException.cs +++ b/mcs/class/System.Data/System.Data/NoNullAllowedException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public NoNullAllowedException (string message, Exception inner) - : base (message, inner) + public NoNullAllowedException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/ReadOnlyException.cs b/mcs/class/System.Data/System.Data/ReadOnlyException.cs index 1599a41d240..3851f1bb4fb 100644 --- a/mcs/class/System.Data/System.Data/ReadOnlyException.cs +++ b/mcs/class/System.Data/System.Data/ReadOnlyException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public ReadOnlyException (string message, Exception inner) - : base (message, inner) + public ReadOnlyException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/RowNotInTableException.cs b/mcs/class/System.Data/System.Data/RowNotInTableException.cs index 7b005b2e0d1..022fa051a77 100644 --- a/mcs/class/System.Data/System.Data/RowNotInTableException.cs +++ b/mcs/class/System.Data/System.Data/RowNotInTableException.cs @@ -48,8 +48,8 @@ namespace System.Data } #if NET_2_0 - public RowNotInTableException (string message, Exception inner) - : base (message, inner) + public RowNotInTableException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/SyntaxErrorException.cs b/mcs/class/System.Data/System.Data/SyntaxErrorException.cs index 16dc730c60d..4f41dd5c5c0 100644 --- a/mcs/class/System.Data/System.Data/SyntaxErrorException.cs +++ b/mcs/class/System.Data/System.Data/SyntaxErrorException.cs @@ -53,8 +53,8 @@ namespace System.Data } #if NET_2_0 - public SyntaxErrorException (String message, Exception inner) - : base (message, inner) + public SyntaxErrorException (String message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs b/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs index 0c08617a385..39a9ab828c6 100644 --- a/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs +++ b/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs @@ -64,12 +64,12 @@ namespace System.Data } #if NET_2_0 - public TypedDataSetGeneratorException (String error) : base (error) + public TypedDataSetGeneratorException (String message) : base (message) { } - public TypedDataSetGeneratorException (String error, Exception inner) - : base (error, inner) + public TypedDataSetGeneratorException (String message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data/VersionNotFoundException.cs b/mcs/class/System.Data/System.Data/VersionNotFoundException.cs index 3d2b447f236..9253a24d371 100644 --- a/mcs/class/System.Data/System.Data/VersionNotFoundException.cs +++ b/mcs/class/System.Data/System.Data/VersionNotFoundException.cs @@ -53,8 +53,8 @@ namespace System.Data } #if NET_2_0 - public VersionNotFoundException (string message, Exception inner) - : base (message, inner) + public VersionNotFoundException (string message, Exception innerException) + : base (message, innerException) { } #endif diff --git a/mcs/class/System.Data/System.Data20.csproj b/mcs/class/System.Data/System.Data20.csproj deleted file mode 100755 index 4583b2b07be..00000000000 --- a/mcs/class/System.Data/System.Data20.csproj +++ /dev/null @@ -1,503 +0,0 @@ - - - Debug_Java - AnyCPU - 8.0.50727 - 2.0 - {BD83C476-AEC7-4535-8158-977B04887AF0} - Library - Properties - System.Data - System.Data - 1.4.2 - 1 - framework - 2.0 - {F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ipa - - - - - bin\Release_Java20\ - TRACE;NET_1_1;DOTNET;TARGET_JVM;NET_2_0 - 285212672 - true - pdbonly - AnyCPU - prompt - False - False - 1 - false - - - - - 2.0 - 1.4.2 - 0 - - - true - full - false - bin\Debug_Java\ - TRACE;DEBUG;NET_1_1;ONLY_1_1;DOTNET;TARGET_JVM - prompt - 4 - 285212672 - false - True - False - 0 - - - - - pdbonly - true - bin\Release_Java\ - TRACE;NET_1_1;ONLY_1_1;DOTNET;TARGET_JVM - prompt - 4 - 285212672 - false - True - False - 0 - - - - - true - bin\Debug_Java20\ - TRACE;DEBUG;NET_1_1;DOTNET;TARGET_JVM;NET_2_0 - 285212672 - full - AnyCPU - prompt - True - False - 1 - false - - - - - 2.0 - 1.4.2 - 0 - - - - ..\lib\J2SE.Helpers.dll - False - - - - - - - - - Assembly\Locale.cs - - - Assembly\MonoTODOAttribute.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - - - - - Component - - - Component - - - - Component - - - - - Component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - Component - - - Component - - - - Component - - - - - - - - - - - - - - - - - - - - - - - Component - - - Component - - - Component - - - - - - - - - - - - - - - - - - - Component - - - Component - - - Component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - - - - - - - - - - - - - - - Component - - - - - Component - - - - - - - - - - - Component - - - Component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Assembly\Consts.cs.in - - - Code - - - - - - - - - Component - - - - - - - - - - - - - - - SqlCommand.cs - Designer - - - SqlConnection.cs - Designer - - - - - - - - - - - - - - - $(ProjectDir)\jay.bat $(ProjectDir) - - diff --git a/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs index 652160d14bc..9c2842619f4 100644 --- a/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs +++ b/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs @@ -97,44 +97,6 @@ namespace MonoTests.System.Data.Common { Assert.AreEqual (count, dbdp.ToXml ().Children.Count, msg + ".Count"); } -#if !NET_2_0 - [Test] - public void Constructor_Empty () - { - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (); - Check ("Empty", dbdp, false, false, 0); - } -#elif !NET_1_1 - [Test] - [ExpectedException (typeof (ArgumentOutOfRangeException))] - public void Constructor_PermissionStateBoolean_Invalid () - { - PermissionState ps = (PermissionState) Int32.MinValue; - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (ps, false); - } - - [Test] - public void Constructor_PermissionStateBoolean_None () - { - PermissionState ps = PermissionState.None; - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (ps, false); - Check ("None,False", dbdp, false, false, 0); - - dbdp = new NonAbstractDBDataPermission (ps, true); - Check ("None,True", dbdp, true, false, 0); - } - - [Test] - public void Constructor_PermissionStateBoolean_Unrestricted () - { - PermissionState ps = PermissionState.Unrestricted; - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (ps, false); - Check ("Unrestricted,False", dbdp, false, true, 0); - - dbdp = new NonAbstractDBDataPermission (ps, true); - Check ("Unrestricted,True", dbdp, true, true, 0); - } -#endif [Test] [ExpectedException (typeof (ArgumentNullException))] public void Constructor_DBDataPermission_Null () diff --git a/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs index b96de09c8f9..96dd9b84aaa 100644 --- a/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs +++ b/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs @@ -31,6 +31,10 @@ using System.Data; using System.Data.Common; using System.Data.SqlClient; +/*--For Bug 853 Test Begin--*/ +using Mono.Data.Sqlite; +/*--For Bug 853 Test End--*/ + using NUnit.Framework; namespace MonoTests.System.Data.Common @@ -180,6 +184,44 @@ namespace MonoTests.System.Data.Common Assert.IsNotNull (ex.Message, "#4"); } } + + [Test] + [Category ("NotWorking")] // Requires newer sqlite than is on wrench + public void XimarinBugzillaBug853Test() + { + const string connectionString = "URI = file:./SqliteTest.db; Version = 3";//will be in System.Data directory + SqliteConnection dbConnection = new SqliteConnection(connectionString); + dbConnection.Open(); + SqliteCommand ClearTableEntry=new SqliteCommand("DELETE FROM Primus;",dbConnection); + ClearTableEntry.ExecuteNonQuery(); + + SqliteDataAdapter sqliteDataAdapter = new SqliteDataAdapter("SELECT * FROM primus", dbConnection); + SqliteCommandBuilder builder = new SqliteCommandBuilder(sqliteDataAdapter); + sqliteDataAdapter.InsertCommand = builder.GetInsertCommand(); + sqliteDataAdapter.DeleteCommand = builder.GetDeleteCommand(); + + DataSet dataSet = new DataSet(); + + sqliteDataAdapter.Fill(dataSet, "Primus");//reset + + DataRow rowToBeAdded = dataSet.Tables["Primus"].NewRow(); + rowToBeAdded["id"] = 123; + rowToBeAdded["name"] = "Name";//not null primary key + rowToBeAdded["value"] = 777; + + dataSet.Tables["Primus"].Rows.Add(rowToBeAdded); +sqliteDataAdapter.Update (dataSet, "Primus"); + + //This would fail with NULL constraint violation in bug + //report. Because before the patch, it would create + //a new record with all fields being null-- if the + //exception rises, test fails + sqliteDataAdapter.Update (dataSet, "Primus"); + + dbConnection.Close(); + dbConnection = null; + } + #endif class MyAdapter : DbDataAdapter diff --git a/mcs/class/System.Data/Test/System.Data.SqlClient/SqlConnectionTest.cs b/mcs/class/System.Data/Test/System.Data.SqlClient/SqlConnectionTest.cs index d04eff16652..7899b27f663 100644 --- a/mcs/class/System.Data/Test/System.Data.SqlClient/SqlConnectionTest.cs +++ b/mcs/class/System.Data/Test/System.Data.SqlClient/SqlConnectionTest.cs @@ -804,7 +804,7 @@ namespace MonoTests.System.Data.SqlClient [Test] public void ConnectionString_MinPoolSize_Invalid () { - SqlConnection cn = cn = new SqlConnection (); + SqlConnection cn = new SqlConnection (); // negative number try { diff --git a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs index 10af5ada60f..26e1301417c 100644 --- a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs +++ b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs @@ -101,17 +101,9 @@ namespace MonoTests.System.Data _constraint2.ConstraintName = "dog"; //case insensitive col.Add (_constraint1); col.Add (_constraint2); -#if NET_1_1 -#else - Assert.Fail ("Failed to throw Duplicate name exception."); -#endif col.Remove (_constraint2); // only for !1.0 col.Remove (_constraint1); } -#if ! NET_1_1 - catch (DuplicateNameException) { - } -#endif catch (AssertionException exc) { throw exc; } @@ -124,16 +116,8 @@ namespace MonoTests.System.Data //Constraint Already exists try { col.Add (_constraint1); -#if NET_1_1 -#else - Assert.Fail ("B2: Failed to throw ArgumentException."); -#endif col.Remove (_constraint1); } catch (ArgumentException) { -#if NET_1_1 -#else - throw; -#endif } catch (AssertionException exc) { throw exc; } catch { diff --git a/mcs/class/System.Data/Test/System.Data/DataRowTest2.cs b/mcs/class/System.Data/Test/System.Data/DataRowTest2.cs index fe1147ac699..14333e2201a 100644 --- a/mcs/class/System.Data/Test/System.Data/DataRowTest2.cs +++ b/mcs/class/System.Data/Test/System.Data/DataRowTest2.cs @@ -2079,7 +2079,8 @@ namespace MonoTests.System.Data Assert.AreEqual(true , dr.IsNull(1) , "DRW95"); } - [Test] public void IsNull_ByName() + [Test] + public void IsNull_ByName() { DataTable dt = new DataTable(); DataColumn dc0 = new DataColumn("Col0",typeof(int)); @@ -2114,7 +2115,7 @@ namespace MonoTests.System.Data foreach( DataRow row in ds.Tables[0].Rows ) { - // Console.WriteLine(row["ValueListValueMember"].ToString() + " " ); + Console.WriteLine(row["ValueListValueMember"].ToString() + " " ); if( row.IsNull("ValueListValueMember") == true ) Assert.AreEqual("Failed", "SubTest", "DRW98"); else @@ -2799,7 +2800,6 @@ namespace MonoTests.System.Data } #if NET_2_0 - string SetAddedModified_ErrMsg = "SetAdded and SetModified can only be called on DataRows with Unchanged DataRowState."; [Test] public void SetAdded_test() { @@ -2810,8 +2810,6 @@ namespace MonoTests.System.Data row.SetAdded(); Assert.Fail ("#1"); } catch (InvalidOperationException e) { - // Never premise English. - //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2"); } table.Columns.Add("col1", typeof(int)); @@ -2824,8 +2822,6 @@ namespace MonoTests.System.Data row.SetAdded(); Assert.Fail ("#2"); } catch (InvalidOperationException e) { - // Never premise English. - //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2"); } Assert.AreEqual(DataRowState.Added, row.RowState, "#2"); @@ -2836,8 +2832,6 @@ namespace MonoTests.System.Data row.SetAdded(); Assert.Fail ("#3"); } catch (InvalidOperationException e) { - // Never premise English. - //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2"); } row.AcceptChanges(); diff --git a/mcs/class/System.Data/Test/System.Data/DataSetReadXmlSchemaTest.cs b/mcs/class/System.Data/Test/System.Data/DataSetReadXmlSchemaTest.cs index 147f8f06f96..ec198bf5b65 100644 --- a/mcs/class/System.Data/Test/System.Data/DataSetReadXmlSchemaTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataSetReadXmlSchemaTest.cs @@ -602,6 +602,7 @@ namespace MonoTests.System.Data } [Test] + [Category ("NotWorking")] public void TestSampleFileImportSimple () { DataSet ds = new DataSet (); diff --git a/mcs/class/System.Data/Test/System.Data/DataSetTest.cs b/mcs/class/System.Data/Test/System.Data/DataSetTest.cs index ca609338b83..abb52fd7907 100644 --- a/mcs/class/System.Data/Test/System.Data/DataSetTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataSetTest.cs @@ -283,11 +283,12 @@ namespace MonoTests.System.Data substring = TextString.Substring (0, TextString.IndexOf(EOL)); TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); // This is original DataSet.WriteXmlSchema() output -// Assert.AreEqual (" ", substring, "test#16"); -#if NET_2_0 +#if NET_4_0 + Assert.AreEqual (" ", substring, "test#16"); +#elif NET_2_0 Assert.AreEqual (" ", substring, "test#16"); #else - Assert.AreEqual (" ", substring, "test#16"); + #error "Unknown profile" #endif if (substring.IndexOf ("", substring, "test#32"); Assert.AreEqual ("", TextString, "test#33"); } -#endif [Test] public void Serialize () @@ -2032,7 +2005,6 @@ namespace MonoTests.System.Data Assert.AreEqual (1, dt.Rows.Count); } -#if NET_2_0 private bool tableInitialized; [Test] public void TableInitializedEventTest1 () @@ -2093,7 +2065,6 @@ namespace MonoTests.System.Data { tableInitialized = true; } -#endif public void OnRowChanging (object src, DataRowChangeEventArgs args) { @@ -2105,7 +2076,6 @@ namespace MonoTests.System.Data rowActionChanged = args.Action; } -#if NET_2_0 private DataTable dt; private void localSetup () { dt = new DataTable ("test"); @@ -3266,6 +3236,7 @@ namespace MonoTests.System.Data string TextString = GetNormalizedSchema (writer.ToString ()); //string TextString = writer.ToString (); + EOL = "\n"; string substring = TextString.Substring (0, TextString.IndexOf (EOL)); TextString = TextString.Substring (TextString.IndexOf (EOL) + EOL.Length); Assert.AreEqual ("", substring, "test#01"); @@ -4160,7 +4131,6 @@ namespace MonoTests.System.Data #endregion // Read/Write XML Tests -#endif // NET_2_0 } public class MyDataTable : DataTable diff --git a/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs b/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs index fadef8e9d08..331875ac888 100644 --- a/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs +++ b/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs @@ -30,6 +30,7 @@ using System; using System.Collections; using System.Data; using System.Globalization; +using System.Collections.Generic; using MonoTests.System.Data.Utils; @@ -2170,14 +2171,14 @@ namespace MonoTests_System.Data DataTable dt = DataProvider.CreateChildDataTable (); DataRow [] drSelect; - ArrayList al; + List al; //add some rows dt.Rows.Add (new object[] {99,88, "bla", "wowww"}); dt.Rows.Add (new object[] {999,888, string.Empty, "woowww"}); //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if ((int) dr["ChildId"] == 1) al.Add (dr); @@ -2189,7 +2190,7 @@ namespace MonoTests_System.Data Assert.AreEqual (al.ToArray (), drSelect, "DT193"); //get excepted resault - al = new ArrayList(); + al = new List(); foreach (DataRow dr in dt.Rows) { if (dr ["String1"].ToString () == "1-String1") al.Add (dr); @@ -2201,7 +2202,7 @@ namespace MonoTests_System.Data Assert.AreEqual (al.ToArray(),drSelect, "DT194"); //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if ((int) dr["ChildId"] == 1 && dr["String1"].ToString() == "1-String1") al.Add (dr); @@ -2214,7 +2215,7 @@ namespace MonoTests_System.Data //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if (dr ["String1"].ToString ().Length < 4) al.Add (dr); @@ -2224,9 +2225,23 @@ namespace MonoTests_System.Data drSelect = dt.Select("Len(String1) < 4 ", "ParentId Desc"); Assert.AreEqual(al.ToArray(),drSelect, "DT196"); + } + + [Test] + [Category ("NotWorking")] + public void Select_StringString_1 () + { + DataTable dt = DataProvider.CreateChildDataTable (); + DataRow [] drSelect; + List al; + + //add some rows + dt.Rows.Add (new object[] {99,88, "bla", "wowww"}); + dt.Rows.Add (new object[] {999,888, string.Empty, "woowww"}); + //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if (dr ["String1"].ToString ().IndexOf ("String") > 0) al.Add (dr); @@ -2238,7 +2253,7 @@ namespace MonoTests_System.Data Assert.AreEqual (al.ToArray (), drSelect, "DT197"); //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if (((int) dr ["ChildId"] == 2) || ((int) dr ["ChildId"] == 3)) al.Add (dr); @@ -2250,7 +2265,7 @@ namespace MonoTests_System.Data Assert.AreEqual (al.ToArray (), drSelect, "DT198"); //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if ((((int) dr ["ChildId"] * (int) dr ["ParentId"]) > 5)) al.Add (dr); @@ -2269,7 +2284,7 @@ namespace MonoTests_System.Data } //get excepted resault - al = new ArrayList (); + al = new List (); foreach (DataRow dr in dt.Rows) { if (dr ["String2"].ToString ().Substring (2, 3) == "Str") al.Add (dr); @@ -2508,7 +2523,7 @@ namespace MonoTests_System.Data } #endif - internal class DataRowsComparer : IComparer + internal class DataRowsComparer : IComparer { private string _columnName; private string _direction; @@ -2521,11 +2536,8 @@ namespace MonoTests_System.Data _direction = direction; } - public int Compare(object x, object y) + public int Compare(DataRow drX, DataRow drY) { - DataRow drX = (DataRow)x; - DataRow drY = (DataRow)y; - object objX = drX[_columnName]; object objY = drY[_columnName]; diff --git a/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs b/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs index b425842c71a..8328f7ebbb2 100644 --- a/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs +++ b/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs @@ -209,15 +209,11 @@ namespace MonoTests.System.Data // Create a ForeingKeyConstraint Object using the constructor // ForeignKeyConstraint (string, string, string[], string[], AcceptRejectRule, Rule, Rule); ForeignKeyConstraint fkc = new ForeignKeyConstraint ("hello world", parentTableName, parentColumnNames, childColumnNames, AcceptRejectRule.Cascade, Rule.Cascade, Rule.Cascade); // Assert that the Constraint object does not belong to any table yet -#if NET_1_1 try { DataTable tmp = fkc.Table; Fail ("When table is null, get_Table causes an InvalidOperationException."); } catch (InvalidOperationException) { } -#else - Assertion.AssertEquals ("#A01 Table should not be set", fkc.Table, null); -#endif Constraint []constraints = new Constraint[3]; constraints [0] = new UniqueConstraint (column1); @@ -302,11 +298,7 @@ namespace MonoTests.System.Data fkc = new ForeignKeyConstraint((DataColumn)null,(DataColumn)null); Fail("Failed to throw ArgumentNullException."); } -#if NET_1_1 catch (NullReferenceException) {} -#else - catch (ArgumentNullException) {} -#endif catch (AssertionException exc) {throw exc;} catch (Exception exc) { @@ -344,13 +336,8 @@ namespace MonoTests.System.Data fkc = new ForeignKeyConstraint(_ds.Tables[0].Columns[0], localTable.Columns[1]); Fail("Failed to throw InvalidConstraintException."); } -#if NET_1_1 // tables in different datasets catch (InvalidOperationException) {} -#else - //different dataTypes - catch (InvalidConstraintException) {} -#endif // Cannot create a Key from Columns that belong to // different tables. @@ -526,5 +513,29 @@ namespace MonoTests.System.Data t1.Rows [0][0]=20; Assert("#1", (int)t2.Rows [0][0] == 20); } + + [Test] + // https://bugzilla.novell.com/show_bug.cgi?id=650402 + public void ForeignKey_650402 () + { + DataSet data = new DataSet (); + DataTable parent = new DataTable ("parent"); + DataColumn pk = parent.Columns.Add ("PK"); + DataTable child = new DataTable ("child"); + DataColumn fk = child.Columns.Add ("FK"); + + data.Tables.Add (parent); + data.Tables.Add (child); + data.Relations.Add (pk, fk); + + parent.Rows.Add ("value"); + child.Rows.Add ("value"); + data.AcceptChanges (); + child.Rows[0].Delete (); + parent.Rows[0][0] = "value2"; + + data.EnforceConstraints = false; + data.EnforceConstraints = true; + } } } diff --git a/mcs/class/System.Data/Test/System.Xml/XmlDataDocumentTest.cs b/mcs/class/System.Data/Test/System.Xml/XmlDataDocumentTest.cs index db7eff141cc..78fc522caec 100644 --- a/mcs/class/System.Data/Test/System.Xml/XmlDataDocumentTest.cs +++ b/mcs/class/System.Data/Test/System.Xml/XmlDataDocumentTest.cs @@ -166,7 +166,7 @@ namespace MonoTests.System.Data.Xml [Test] public void EditingDataSet () { - string xml = "1Eastern\r\n 2Western\r\n 3Northern\r\n 4Southern\r\n 12Hi There12Hi There"; + string xml = "1Eastern" + Environment.NewLine + " 2Western" + Environment.NewLine + " 3Northern" + Environment.NewLine + " 4Southern" + Environment.NewLine + " 12Hi There12Hi There"; XmlReader Reader = new XmlTextReader ("Test/System.Xml/region.xml"); XmlDataDocument Doc = new XmlDataDocument (); @@ -540,7 +540,7 @@ namespace MonoTests.System.Data.Xml TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); // Regardless of NewLine value, original xml contains CR // (but in the context of XML spec, it should be normalized) - Assert.AreEqual (" Western\r", substring, "#C05"); + Assert.AreEqual (" Western", substring, "#C05"); substring = TextString.Substring (0, TextString.IndexOf(EOL)); TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); @@ -562,7 +562,7 @@ namespace MonoTests.System.Data.Xml TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); // Regardless of NewLine value, original xml contains CR // (but in the context of XML spec, it should be normalized) - Assert.AreEqual (" Northern\r", substring, "#C10"); + Assert.AreEqual (" Northern", substring, "#C10"); substring = TextString.Substring (0, TextString.IndexOf(EOL)); TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); @@ -635,7 +635,7 @@ namespace MonoTests.System.Data.Xml TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); // Regardless of NewLine value, original xml contains CR // (but in the context of XML spec, it should be normalized) - Assert.AreEqual (" Eastern\r", substring, "#F05"); + Assert.AreEqual (" Eastern", substring, "#F05"); substring = TextString.Substring (0, TextString.IndexOf(EOL)); TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); @@ -697,7 +697,7 @@ namespace MonoTests.System.Data.Xml TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); // Regardless of NewLine value, original xml contains CR // (but in the context of XML spec, it should be normalized) - Assert.AreEqual (" Southern\r", substring, "#F20"); + Assert.AreEqual (" Southern", substring, "#F20"); substring = TextString.Substring (0, TextString.IndexOf(EOL)); TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length); diff --git a/mcs/class/System.Data/app_test_2.0.config b/mcs/class/System.Data/app_test_2.0.config deleted file mode 100644 index a1e07076bbf..00000000000 --- a/mcs/class/System.Data/app_test_2.0.config +++ /dev/null @@ -1,48 +0,0 @@ - - - -
-
- - - - - - - - - - - - - - - - - - - - diff --git a/mcs/class/System.Data/app_test_net_2_0.config b/mcs/class/System.Data/app_test_net_2_0.config new file mode 100644 index 00000000000..a1e07076bbf --- /dev/null +++ b/mcs/class/System.Data/app_test_net_2_0.config @@ -0,0 +1,48 @@ + + + +
+
+ + + + + + + + + + + + + + + + + + + + diff --git a/mcs/class/System.Data/app_test_net_4_5.config b/mcs/class/System.Data/app_test_net_4_5.config new file mode 100644 index 00000000000..4f315973f1e --- /dev/null +++ b/mcs/class/System.Data/app_test_net_4_5.config @@ -0,0 +1,48 @@ + + + +
+
+ + + + + + + + + + + + + + + + + + + + diff --git a/mcs/class/System.Data/net_1_1_java_System.Data.dll.exclude.sources b/mcs/class/System.Data/net_1_1_java_System.Data.dll.exclude.sources deleted file mode 100644 index 8c88d287817..00000000000 --- a/mcs/class/System.Data/net_1_1_java_System.Data.dll.exclude.sources +++ /dev/null @@ -1,141 +0,0 @@ -System.Data.OleDb/libgda.cs -System.Data.OleDb/OleDbParameterConverter.cs -System.Data.OleDb/OleDbCommand.cs -System.Data.OleDb/OleDbCommandBuilder.cs -System.Data.OleDb/OleDbConnection.cs -System.Data.OleDb/OleDbDataAdapter.cs -System.Data.OleDb/OleDbDataReader.cs -System.Data.OleDb/OleDbError.cs -System.Data.OleDb/OleDbErrorCollection.cs -System.Data.OleDb/OleDbException.cs -System.Data.OleDb/OleDbInfoMessageEventArgs.cs -System.Data.OleDb/OleDbInfoMessageEventHandler.cs -System.Data.OleDb/OleDbLiteral.cs -System.Data.OleDb/OleDbParameter.cs -System.Data.OleDb/OleDbParameterCollection.cs -System.Data.OleDb/OleDbPermission.cs -System.Data.OleDb/OleDbPermissionAttribute.cs -System.Data.OleDb/OleDbRowUpdatedEventArgs.cs -System.Data.OleDb/OleDbRowUpdatedEventHandler.cs -System.Data.OleDb/OleDbRowUpdatingEventArgs.cs -System.Data.OleDb/OleDbRowUpdatingEventHandler.cs -System.Data.OleDb/OleDbSchemaGuid.cs -System.Data.OleDb/OleDbTransaction.cs -System.Data.OleDb/OleDbType.cs -System.Data.SqlTypes/INullable.cs -System.Data.SqlTypes/SqlBinary.cs -System.Data.SqlTypes/SqlBoolean.cs -System.Data.SqlTypes/SqlByte.cs -System.Data.SqlTypes/SqlBytes.cs -System.Data.SqlTypes/SqlChars.cs -System.Data.SqlTypes/SqlCompareOptions.cs -System.Data.SqlTypes/SqlDate.cs -System.Data.SqlTypes/SqlDateTime.cs -System.Data.SqlTypes/SqlDecimal.cs -System.Data.SqlTypes/SqlDouble.cs -System.Data.SqlTypes/SqlGuid.cs -System.Data.SqlTypes/SqlInt16.cs -System.Data.SqlTypes/SqlInt32.cs -System.Data.SqlTypes/SqlInt64.cs -System.Data.SqlTypes/SqlMoney.cs -System.Data.SqlTypes/SqlNullValueException.cs -System.Data.SqlTypes/SqlSingle.cs -System.Data.SqlTypes/SqlStreamChars.cs -System.Data.SqlTypes/SqlString.cs -System.Data.SqlTypes/SqlTime.cs -System.Data.SqlTypes/SqlTruncateException.cs -System.Data.SqlTypes/SqlTypeException.cs -System.Data.SqlTypes/SqlUtcDateTime.cs -System.Data.SqlTypes/SqlXmlReader.cs -System.Data.SqlTypes/StorageState.cs -System.Data.SqlTypes/SqlAlreadyFilledException.cs -System.Data.SqlTypes/SqlNotFilledException.cs -System.Data.SqlTypes/SqlXml.cs -System.Data.Odbc/NativeBuffer.cs -System.Data.Odbc/OdbcFactory.cs -System.Data.Odbc/OdbcParameterConverter.cs -System.Data.Odbc/OdbcCategoryAttribute.cs -System.Data.Odbc/OdbcDescriptionAttribute.cs -System.Data.Odbc/OdbcColumn.cs -System.Data.Odbc/OdbcCommand.cs -System.Data.Odbc/OdbcConnection.cs -System.Data.Odbc/OdbcDataReader.cs -System.Data.Odbc/OdbcError.cs -System.Data.Odbc/OdbcErrorCollection.cs -System.Data.Odbc/OdbcException.cs -System.Data.Odbc/OdbcParameter.cs -System.Data.Odbc/OdbcParameterCollection.cs -System.Data.Odbc/OdbcTransaction.cs -System.Data.Odbc/OdbcType.cs -System.Data.Odbc/OdbcTypeMap.cs -System.Data.Odbc/OdbcTypeConverter.cs -System.Data.Odbc/libodbc.cs -System.Data.Odbc/OdbcDataAdapter.cs -System.Data.Odbc/OdbcRowUpdatedEventArgs.cs -System.Data.Odbc/OdbcRowUpdatedEventHandler.cs -System.Data.Odbc/OdbcRowUpdatingEventArgs.cs -System.Data.Odbc/OdbcRowUpdatingEventHandler.cs -System.Data.Odbc/OdbcPermissionAttribute.cs -System.Data.Odbc/OdbcPermission.cs -System.Data.Odbc/OdbcInfoMessageEventArgs.cs -System.Data.Odbc/OdbcInfoMessageEventHandler.cs -System.Data.Odbc/OdbcCommandBuilder.cs -System.Data.Sql/SqlDataSourceEnumerator.cs -System.Data.Sql/SqlNotificationRequest.cs -Microsoft.SqlServer.Server/Format.cs -Microsoft.SqlServer.Server/DataAccessKind.cs -Microsoft.SqlServer.Server/IBinarySerialize.cs -Microsoft.SqlServer.Server/InvalidUdtException.cs -Microsoft.SqlServer.Server/SqlFunctionAttribute.cs -Microsoft.SqlServer.Server/SqlMetaData.cs -Microsoft.SqlServer.Server/SqlMethodAttribute.cs -Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs -Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs -Microsoft.SqlServer.Server/SystemDataAccessKind.cs -Microsoft.SqlServer.Server/SqlFacetAttribute.cs -Microsoft.SqlServer.Server/TriggerAction.cs -Microsoft.SqlServer.Server/SqlTriggerContext.cs -Microsoft.SqlServer.Server/SqlProcedureAttribute.cs -Microsoft.SqlServer.Server/SqlTriggerAttribute.cs -System.Data.SqlClient/SqlNotificationType.cs -System.Data.SqlClient/SqlNotificationInfo.cs -System.Data.SqlClient/SqlNotificationSource.cs -System.Data.SqlClient/ISqlNotificationReceiver.cs -System.Data.SqlClient/SqlAsyncState.cs -System.Data.SqlClient/SqlAsyncResult.cs -System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs -System.Data.SqlClient/SqlClientPermission.cs -System.Data.SqlClient/SqlClientPermissionAttribute.cs -System.Data.SqlClient/SqlCommand.cs -System.Data.SqlClient/SqlCommandBuilder.cs -System.Data.SqlClient/SqlConnection.cs -System.Data.SqlClient/SqlConnectionStringBuilder.cs -System.Data.SqlClient/SqlDataAdapter.cs -System.Data.SqlClient/SqlDataReader.cs -System.Data.SqlClient/SqlError.cs -System.Data.SqlClient/SqlErrorCollection.cs -System.Data.SqlClient/SqlException.cs -System.Data.SqlClient/SqlInfoMessageEventArgs.cs -System.Data.SqlClient/SqlInfoMessageEventHandler.cs -System.Data.SqlClient/SqlParameter.cs -System.Data.SqlClient/SqlParameterCollection.cs -System.Data.SqlClient/SqlParameterConverter.cs -System.Data.SqlClient/SqlRowUpdatedEventArgs.cs -System.Data.SqlClient/SqlRowUpdatedEventHandler.cs -System.Data.SqlClient/SqlRowUpdatingEventArgs.cs -System.Data.SqlClient/SqlRowUpdatingEventHandler.cs -System.Data.SqlClient/SqlTransaction.cs -System.Data.SqlClient/SqlXmlTextReader.cs -System.Data.SqlClient/SQLDebugging.cs -System.Data.SqlClient/SqlClientFactory.cs -System.Data.SqlClient/SqlDataSourceEnumerator.cs -System.Data.SqlClient/SqlBulkCopyOptions.cs -System.Data.SqlClient/SqlBulkCopyColumnMapping.cs -System.Data.SqlClient/SqlNotificationAuthType.cs -System.Data.SqlClient/SqlNotificationTransports.cs -System.Data.SqlClient/SqlRowsCopiedEventHandler.cs -System.Data.SqlClient/SqlRowsCopiedEventArgs.cs -System.Data.SqlClient/SqlNotificationEventArgs.cs -System.Data.SqlClient/OnChangeEventHandler.cs -System.Data/CustomDataClassGenerator.cs -System.Data/TypedDataSetGenerator.cs diff --git a/mcs/class/System.Data/net_1_1_java_System.Data.dll.sources b/mcs/class/System.Data/net_1_1_java_System.Data.dll.sources deleted file mode 100644 index 531715dd60d..00000000000 --- a/mcs/class/System.Data/net_1_1_java_System.Data.dll.sources +++ /dev/null @@ -1,105 +0,0 @@ -#include System.Data.dll.sources -Mainsoft.Data.Configuration.jvm/IKeyMapper.cs -Mainsoft.Data.Configuration.jvm/KeyMapperBase.cs -Mainsoft.Data.Configuration.jvm/ProvidersSectionHandler.cs -Mainsoft.Data.Jdbc.Providers.jvm/GenericProvider.cs -Mainsoft.Data.Jdbc.Providers.jvm/IProvider.cs -Mainsoft.Data.Jdbc.Providers.jvm/OleDbDB2Provider.cs -Mainsoft.Data.Jdbc.Providers.jvm/OleDbOracleProvider.cs -Mainsoft.Data.Jdbc.Providers.jvm/OleDbSqlServerProvider.cs -Mainsoft.Data.Jdbc.Providers.jvm/wrappers.cs -System.Data.Common/DbMetaDataCache.cs -System.Data.Configuration.jvm/GlobalConfig.cs -System.Data.Configuration.jvm/ObjectNameResolutionSectionHandler.cs -System.Data.Configuration.jvm/ObjectNameResolver.cs -System.Data.Configuration.jvm/ObjectNameResolversCollection.cs -System.Data.OleDb.jvm/OleDbCommand.cs -System.Data.OleDb.jvm/OleDbCommandBuilder.cs -System.Data.OleDb.jvm/OleDbConnection.cs -System.Data.OleDb.jvm/OleDbConvert.cs -System.Data.OleDb.jvm/OleDbDataAdapter.cs -System.Data.OleDb.jvm/OleDbDataReader.cs -System.Data.OleDb.jvm/OleDbError.cs -System.Data.OleDb.jvm/OleDbErrorCollection.cs -System.Data.OleDb.jvm/OleDbException.cs -System.Data.OleDb.jvm/OleDbInfoMessageEventArgs.cs -System.Data.OleDb.jvm/OleDbInfoMessageEventHandler.cs -System.Data.OleDb.jvm/OleDbLiteral.cs -System.Data.OleDb.jvm/OleDbParameter.cs -System.Data.OleDb.jvm/OleDbParameterCollection.cs -System.Data.OleDb.jvm/OleDbPermission.cs -System.Data.OleDb.jvm/OleDbPermissionAttribute.cs -System.Data.OleDb.jvm/OleDbRowUpdatedEventArgs.cs -System.Data.OleDb.jvm/OleDbRowUpdatedEventHandler.cs -System.Data.OleDb.jvm/OleDbRowUpdatingEventArgs.cs -System.Data.OleDb.jvm/OleDbRowUpdatingEventHandler.cs -System.Data.OleDb.jvm/OleDbSchemaGuid.cs -System.Data.OleDb.jvm/OleDbTransaction.cs -System.Data.OleDb.jvm/OleDbType.cs -System.Data.ProviderBase/DbDataReaderBase.cs -System.Data.ProviderBase.jvm/AbstractDataReader.cs -System.Data.ProviderBase.jvm/AbstractDBCommand.cs -System.Data.ProviderBase.jvm/AbstractDbCommandBuilder.cs -System.Data.ProviderBase.jvm/AbstractDBConnection.cs -System.Data.ProviderBase.jvm/AbstractDbError.cs -System.Data.ProviderBase.jvm/AbstractDbErrorCollection.cs -System.Data.ProviderBase.jvm/AbstractDbException.cs -System.Data.ProviderBase.jvm/AbstractDBParameter.cs -System.Data.ProviderBase.jvm/AbstractDbParameterCollection.cs -System.Data.ProviderBase.jvm/AbstractTransaction.cs -System.Data.ProviderBase.jvm/DbConvert.cs -System.Data.ProviderBase.jvm/ParameterMetadataWrapper.cs -System.Data.ProviderBase.jvm/ReaderCache.cs -System.Data.ProviderBase.jvm/regex.cs -System.Data.SqlClient.jvm/ISqlNotificationReceiver.cs -System.Data.SqlClient.jvm/MetaType.cs -System.Data.SqlClient.jvm/SqlClientPermission.cs -System.Data.SqlClient.jvm/SqlClientPermissionAttribute.cs -System.Data.SqlClient.jvm/SqlCollation.cs -System.Data.SqlClient.jvm/SqlCommand.cs -System.Data.SqlClient.jvm/SqlCommandBuilder.cs -System.Data.SqlClient.jvm/SqlConnection.cs -System.Data.SqlClient.jvm/SqlConnectionPool.cs -System.Data.SqlClient.jvm/SqlConvert.cs -System.Data.SqlClient.jvm/SqlDataAdapter.cs -System.Data.SqlClient.jvm/SqlDataReader.cs -System.Data.SqlClient.jvm/SqlError.cs -System.Data.SqlClient.jvm/SqlErrorCollection.cs -System.Data.SqlClient.jvm/SqlException.cs -System.Data.SqlClient.jvm/SqlInfoMessageEventArgs.cs -System.Data.SqlClient.jvm/SqlInfoMessageEventHandler.cs -System.Data.SqlClient.jvm/SqlParameter.cs -System.Data.SqlClient.jvm/SqlParameterCollection.cs -System.Data.SqlClient.jvm/SqlParameterConverter.cs -System.Data.SqlClient.jvm/SqlResultSet.cs -System.Data.SqlClient.jvm/SqlRowUpdatedEventArgs.cs -System.Data.SqlClient.jvm/SqlRowUpdatedEventHandler.cs -System.Data.SqlClient.jvm/SqlRowUpdatingEventArgs.cs -System.Data.SqlClient.jvm/SqlRowUpdatingEventHandler.cs -System.Data.SqlClient.jvm/SqlTransaction.cs -System.Data.SqlClient.jvm/SqlXmlTextReader.cs -System.Data.SqlTypes.jvm/INullable.cs -System.Data.SqlTypes.jvm/SqlBinary.cs -System.Data.SqlTypes.jvm/SqlBoolean.cs -System.Data.SqlTypes.jvm/SqlByte.cs -System.Data.SqlTypes.jvm/SqlBytes.cs -System.Data.SqlTypes.jvm/SqlChars.cs -System.Data.SqlTypes.jvm/SqlCompareOptions.cs -System.Data.SqlTypes.jvm/SqlDate.cs -System.Data.SqlTypes.jvm/SqlDateTime.cs -System.Data.SqlTypes.jvm/SqlDecimal.cs -System.Data.SqlTypes.jvm/SqlDouble.cs -System.Data.SqlTypes.jvm/SqlGuid.cs -System.Data.SqlTypes.jvm/SqlInt16.cs -System.Data.SqlTypes.jvm/SqlInt32.cs -System.Data.SqlTypes.jvm/SqlInt64.cs -System.Data.SqlTypes.jvm/SqlMoney.cs -System.Data.SqlTypes.jvm/SqlNullValueException.cs -System.Data.SqlTypes.jvm/SqlSingle.cs -System.Data.SqlTypes.jvm/SqlStreamChars.cs -System.Data.SqlTypes.jvm/SqlString.cs -System.Data.SqlTypes.jvm/SqlTime.cs -System.Data.SqlTypes.jvm/SqlTruncateException.cs -System.Data.SqlTypes.jvm/SqlTypeException.cs -System.Data.SqlTypes.jvm/SqlUtcDateTime.cs -System.Data.SqlTypes.jvm/SqlXmlReader.cs diff --git a/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs b/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs index 0746e9b617c..dc61855ee01 100644 --- a/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs @@ -47,16 +47,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyKeyFile ("../msfinal.pub")] #endif -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: AllowPartiallyTrustedCallers] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AllowPartiallyTrustedCallers] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Drawing.Design/Assembly/AssemblyInfo.cs b/mcs/class/System.Drawing.Design/Assembly/AssemblyInfo.cs index a4a6cfb7542..adfcac1097b 100644 --- a/mcs/class/System.Drawing.Design/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Drawing.Design/Assembly/AssemblyInfo.cs @@ -56,14 +56,5 @@ using System.Diagnostics; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs b/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs index 5f9b12e7aad..8cddd927e9f 100644 --- a/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs @@ -60,17 +60,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyKeyFile("../msfinal.pub")] #endif -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Dependency ("System,", LoadHint.Always)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] - [assembly: TypeLibVersion (1, 10)] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] - [assembly: TypeLibVersion (1, 10)] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] +[assembly: Dependency ("System,", LoadHint.Always)] diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintDocument.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintDocument.cs index e3bbb7e7a7c..ef4965ad8c4 100644 --- a/mcs/class/System.Drawing/System.Drawing.Printing/PrintDocument.cs +++ b/mcs/class/System.Drawing/System.Drawing.Printing/PrintDocument.cs @@ -45,9 +45,7 @@ namespace System.Drawing.Printing private PrinterSettings printersettings; private PrintController printcontroller; private string documentname; -#if !(NET_1_0) private bool originAtMargins = false; // .NET V1.1 Beta -#endif public PrintDocument() { documentname = "document"; //offical default. @@ -105,7 +103,6 @@ namespace System.Drawing.Printing } } -#if !(NET_1_0) [DefaultValue (false)] [SRDescription ("Determines if the origin is set at the specified margins.")] public bool OriginAtMargins{ @@ -116,7 +113,6 @@ namespace System.Drawing.Printing originAtMargins = value; } } -#endif // methods public void Print(){ diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs index b600c04b99b..827bdee0881 100644 --- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs +++ b/mcs/class/System.Drawing/System.Drawing/Graphics.cs @@ -1029,8 +1029,11 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2); - GDIPlus.CheckStatus (status); + if (!float.IsNaN(x1) && !float.IsNaN(y1) && + !float.IsNaN(x2) && !float.IsNaN(y2)) { + Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2); + GDIPlus.CheckStatus (status); + } } public void DrawLines (Pen pen, PointF [] points) diff --git a/mcs/class/System.Drawing/Test/System.Drawing/SolidBrushTest.cs b/mcs/class/System.Drawing/Test/System.Drawing/SolidBrushTest.cs index 65ffd8aaf19..fda32858ec6 100644 --- a/mcs/class/System.Drawing/Test/System.Drawing/SolidBrushTest.cs +++ b/mcs/class/System.Drawing/Test/System.Drawing/SolidBrushTest.cs @@ -105,6 +105,14 @@ namespace MonoTests.System.Drawing { Assert.AreEqual (Color.Red.ToArgb (), bmp.GetPixel (8, 8).ToArgb (), "8,8"); Assert.AreEqual (Color.Red.ToArgb (), bmp.GetPixel (9, 9).ToArgb (), "9,9"); // include end point } + using (Bitmap bmp = new Bitmap (10, 10)) { + using (Graphics g = Graphics.FromImage (bmp)) { + SolidBrush sb = new SolidBrush (Color.Red); + Pen p = new Pen (sb); + g.DrawLine (p, float.NaN, float.NaN, 9, 9); + } + Assert.AreNotEqual (Color.Red.ToArgb (), bmp.GetPixel (0, 0).ToArgb (), "#DrawLine: Drew Line with NaN value when shouldn't have"); + } } [Test] diff --git a/mcs/class/System.EnterpriseServices/Assembly/AssemblyInfo.cs b/mcs/class/System.EnterpriseServices/Assembly/AssemblyInfo.cs index 67fdee54eb7..b871444b21a 100644 --- a/mcs/class/System.EnterpriseServices/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.EnterpriseServices/Assembly/AssemblyInfo.cs @@ -62,14 +62,7 @@ using System.EnterpriseServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: ComVisible (true)] -#elif NET_1_1 - [assembly: TypeLibVersion (1, 10)] -#elif NET_1_0 - [assembly: TypeLibVersion (1, 10)] -#endif +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] +[assembly: ComVisible (true)] diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AppDomainHelper.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AppDomainHelper.cs index 66a64e15e2f..0a5bc3d86fc 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AppDomainHelper.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AppDomainHelper.cs @@ -30,7 +30,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("ef24f689-14f8-4d92-b4af-d7b1f0e70fd4")] public class AppDomainHelper { @@ -48,5 +47,4 @@ namespace System.EnterpriseServices.Internal } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AssemblyLocator.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AssemblyLocator.cs index 416c4ecc3f7..6a49a8495a7 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AssemblyLocator.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/AssemblyLocator.cs @@ -30,7 +30,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("458aa3b5-265a-4b75-bc05-9bea4630cf18")] public class AssemblyLocator : MarshalByRefObject { @@ -41,5 +40,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClientRemotingConfig.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClientRemotingConfig.cs index c5f858b5191..1499726678f 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClientRemotingConfig.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClientRemotingConfig.cs @@ -29,7 +29,6 @@ using System; namespace System.EnterpriseServices.Internal { -#if NET_1_1 public class ClientRemotingConfig { [MonoTODO] @@ -45,5 +44,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClrObjectFactory.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClrObjectFactory.cs index 800a29e05e5..48c2bf9437d 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClrObjectFactory.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ClrObjectFactory.cs @@ -30,7 +30,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("ecabafd1-7f19-11d2-978e-0000f8757e2a")] public class ClrObjectFactory : IClrObjectFactory { @@ -68,5 +67,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComManagedImportUtil.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComManagedImportUtil.cs index 4b2f07141cb..45befdd77f5 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComManagedImportUtil.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComManagedImportUtil.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("3b0398c9-7812-4007-85cb-18c771f2206f")] public class ComManagedImportUtil : IComManagedImportUtil { @@ -53,5 +52,4 @@ namespace System.EnterpriseServices.Internal throw new NotImplementedException (); } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComSoapPublishError.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComSoapPublishError.cs index af093859b41..1b54e64fb1e 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComSoapPublishError.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ComSoapPublishError.cs @@ -30,7 +30,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 public class ComSoapPublishError { [MonoTODO] @@ -46,5 +45,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/GenerateMetadata.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/GenerateMetadata.cs index 495de64f637..1928b8b8e6c 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/GenerateMetadata.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/GenerateMetadata.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("d8013ff1-730b-45e2-ba24-874b7242c425")] public class GenerateMetadata : IComSoapMetadata { @@ -66,5 +65,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IClrObjectFactory.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IClrObjectFactory.cs index e6f925232f5..6035ea4adfb 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IClrObjectFactory.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IClrObjectFactory.cs @@ -31,30 +31,20 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("ecabafd2-7f19-11d2-978e-0000f8757e2a")] public interface IClrObjectFactory { [DispId(1)] -#if NET_2_0 [return:MarshalAs (UnmanagedType.IDispatch)] -#endif object CreateFromAssembly (string assembly, string type, string mode); [DispId(4)] -#if NET_2_0 [return:MarshalAs (UnmanagedType.IDispatch)] -#endif object CreateFromMailbox (string Mailbox, string Mode); [DispId(2)] -#if NET_2_0 [return:MarshalAs (UnmanagedType.IDispatch)] -#endif object CreateFromVroot (string VrootUrl, string Mode); [DispId(3)] -#if NET_2_0 [return:MarshalAs (UnmanagedType.IDispatch)] -#endif object CreateFromWsdl (string WsdlUrl, string Mode); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComManagedImportUtil.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComManagedImportUtil.cs index 87ad358865e..4385073a107 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComManagedImportUtil.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComManagedImportUtil.cs @@ -32,7 +32,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("c3f8f66b-91be-4c99-a94f-ce3b0a951039")] public interface IComManagedImportUtil { @@ -41,5 +40,4 @@ namespace System.EnterpriseServices.Internal [DispId(5)] void InstallAssembly ([MarshalAs(UnmanagedType.BStr)] string filename, [MarshalAs(UnmanagedType.BStr)] string parname, [MarshalAs(UnmanagedType.BStr)] string appname); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapIISVRoot.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapIISVRoot.cs index 11b2aa5b674..f44a526f68c 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapIISVRoot.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapIISVRoot.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("d8013ef0-730b-45e2-ba24-874b7242c425")] public interface IComSoapIISVRoot { [DispId(1)] @@ -39,5 +38,4 @@ namespace System.EnterpriseServices.Internal { [DispId(2)] void Delete ([MarshalAs(UnmanagedType.BStr)] string RootWeb, [MarshalAs(UnmanagedType.BStr)] string PhysicalDirectory, [MarshalAs(UnmanagedType.BStr)] string VirtualDirectory, [MarshalAs(UnmanagedType.BStr)] out string Error); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapMetadata.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapMetadata.cs index 068fbc7fb51..4f80008d8ad 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapMetadata.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapMetadata.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("d8013ff0-730b-45e2-ba24-874b7242c425")] public interface IComSoapMetadata { [return: MarshalAs(UnmanagedType.BStr)] @@ -41,5 +40,4 @@ namespace System.EnterpriseServices.Internal { [DispId(2)] string GenerateSigned ([MarshalAs(UnmanagedType.BStr)] string SrcTypeLibFileName, [MarshalAs(UnmanagedType.BStr)] string OutPath, [MarshalAs(UnmanagedType.Bool)] bool InstallGac, [MarshalAs(UnmanagedType.BStr)] out string Error); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapPublisher.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapPublisher.cs index c3c30f06337..4527906deae 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapPublisher.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IComSoapPublisher.cs @@ -32,7 +32,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("d8013eee-730b-45e2-ba24-874b7242c425")] public interface IComSoapPublisher { @@ -112,5 +111,4 @@ namespace System.EnterpriseServices.Internal [DispId(12)] void UnRegisterAssembly ([MarshalAs(UnmanagedType.BStr)] string AssemblyPath); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IISVirtualRoot.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IISVirtualRoot.cs index 61da318bba6..311d6944b92 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IISVirtualRoot.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IISVirtualRoot.cs @@ -30,7 +30,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("d8013ef1-730b-45e2-ba24-874b7242c425")] public class IISVirtualRoot : IComSoapIISVRoot { @@ -53,5 +52,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IServerWebConfig.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IServerWebConfig.cs index c88ab0e7076..fbd75e1e703 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IServerWebConfig.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/IServerWebConfig.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("6261e4b5-572a-4142-a2f9-1fe1a0c97097")] public interface IServerWebConfig { [DispId(1)] @@ -49,5 +48,4 @@ namespace System.EnterpriseServices.Internal { [MarshalAs(UnmanagedType.BStr)] string FileRootName, [MarshalAs(UnmanagedType.BStr)] out string Error); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapClientImport.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapClientImport.cs index 62c55831a8f..ca7f96f2d6c 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapClientImport.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapClientImport.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("E7F0F021-9201-47e4-94DA-1D1416DEC27A")] public interface ISoapClientImport { [DispId(1)] @@ -43,5 +42,4 @@ namespace System.EnterpriseServices.Internal { [MarshalAs(UnmanagedType.BStr)] string assemblyName, [MarshalAs(UnmanagedType.BStr)] string typeName); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerTlb.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerTlb.cs index 0b457af5336..adcc8b4a75a 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerTlb.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerTlb.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("1E7BA9F7-21DB-4482-929E-21BDE2DFE51C")] public interface ISoapServerTlb { [DispId(1)] @@ -63,5 +62,4 @@ namespace System.EnterpriseServices.Internal { [MarshalAs(UnmanagedType.BStr)] string assemblyName, [MarshalAs(UnmanagedType.BStr)] string typeName); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerVRoot.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerVRoot.cs index 1e3ed0cb6bf..300f6f595cb 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerVRoot.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapServerVRoot.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("A31B6577-71D2-4344-AEDF-ADC1B0DC5347")] public interface ISoapServerVRoot { [DispId(1)] @@ -69,5 +68,4 @@ namespace System.EnterpriseServices.Internal { [MarshalAs(UnmanagedType.BStr)] out string baseUrl, [MarshalAs(UnmanagedType.BStr)] out string virtualRoot); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapUtility.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapUtility.cs index 7c10f881c3f..64f1e76e7c8 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapUtility.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ISoapUtility.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("5AC4CB7E-F89F-429b-926B-C7F940936BF4")] public interface ISoapUtility { [DispId(2)] @@ -51,5 +50,4 @@ namespace System.EnterpriseServices.Internal { [DispId(3)] void Present (); } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/Publish.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/Publish.cs index d6920fa6701..73d41c10aed 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/Publish.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/Publish.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("d8013eef-730b-45e2-ba24-874b7242c425")] public class Publish : IComSoapPublisher { @@ -125,5 +124,4 @@ namespace System.EnterpriseServices.Internal throw new NotImplementedException (); } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ServerWebConfig.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ServerWebConfig.cs index 9745e3094d7..7292bc2d2b7 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ServerWebConfig.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/ServerWebConfig.cs @@ -30,7 +30,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 public class ServerWebConfig : IServerWebConfig { [MonoTODO] @@ -52,5 +51,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapClientImport.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapClientImport.cs index 456dcf07ccc..5aa1050520b 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapClientImport.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapClientImport.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("346D5B9F-45E1-45c0-AADF-1B7D221E9063")] public sealed class SoapClientImport : ISoapClientImport { @@ -49,5 +48,4 @@ namespace System.EnterpriseServices.Internal } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerTlb.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerTlb.cs index c3677ce7ee3..75bf6db77ef 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerTlb.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerTlb.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("F6B6768F-F99E-4152-8ED2-0412F78517FB")] public sealed class SoapServerTlb : ISoapServerTlb { @@ -54,5 +53,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerVRoot.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerVRoot.cs index 5018df3acea..a8c215f0d01 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerVRoot.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapServerVRoot.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("CAA817CC-0C04-4d22-A05C-2B7E162F4E8F")] public sealed class SoapServerVRoot : ISoapServerVRoot { @@ -61,5 +60,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapUtility.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapUtility.cs index ba6eea9802a..e3923889fa5 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapUtility.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices.Internal/SoapUtility.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices.Internal { -#if NET_1_1 [Guid("5F9A955F-AA55-4127-A32B-33496AA8A44E")] public sealed class SoapUtility : ISoapUtility { @@ -60,5 +59,4 @@ namespace System.EnterpriseServices.Internal } } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/Activity.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/Activity.cs index e51b3fba474..66d4c6f2d24 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/Activity.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/Activity.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [ComVisible(false)] public sealed class Activity { @@ -73,5 +72,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/BindingOption.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/BindingOption.cs index 93dc6818611..709da2323df 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/BindingOption.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/BindingOption.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [ComVisible(false)] public enum BindingOption { @@ -39,5 +38,4 @@ namespace System.EnterpriseServices { NoBinding, BindingToPoolThread } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IAsyncErrorNotify.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IAsyncErrorNotify.cs index 11bd5e2cbdd..46d8797f961 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IAsyncErrorNotify.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IAsyncErrorNotify.cs @@ -32,12 +32,9 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Guid("FE6777FB-A674-4177-8F32-6D707E113484")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -#if NET_2_0 [ComImport] -#endif public interface IAsyncErrorNotify { #region Methods @@ -46,5 +43,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IPlaybackControl.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IPlaybackControl.cs index 37ffcebfa87..dc536bcd7bf 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IPlaybackControl.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IPlaybackControl.cs @@ -32,12 +32,9 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Guid("51372AFD-CAE7-11CF-BE81-00AA00A2FA25")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -#if NET_2_0 [ComImport] -#endif public interface IPlaybackControl { #region Methods @@ -47,5 +44,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitControl.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitControl.cs index 221aaf14135..d0bdc5df1b6 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitControl.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitControl.cs @@ -32,12 +32,9 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Guid("72380d55-8d2b-43a3-8513-2b6ef31434e9")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -#if NET_2_0 [ComImport] -#endif public interface IProcessInitControl { #region Methods @@ -46,5 +43,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitializer.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitializer.cs index fe32de0feff..3491b64336f 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitializer.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IProcessInitializer.cs @@ -32,12 +32,9 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Guid("1113f52d-dc7f-4943-aed6-88d04027e32a")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -#if NET_2_0 [ComImport] -#endif public interface IProcessInitializer { #region Methods @@ -47,5 +44,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IServiceCall.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IServiceCall.cs index b3895406f50..447588a1c92 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IServiceCall.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/IServiceCall.cs @@ -32,12 +32,9 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Guid("BD3E2E12-42DD-40f4-A09A-95A50C58304B")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -#if NET_2_0 [ComImport] -#endif public interface IServiceCall { #region Methods @@ -46,5 +43,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/InheritanceOption.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/InheritanceOption.cs index 478554c8235..7cadf861662 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/InheritanceOption.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/InheritanceOption.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [ComVisible(false)] public enum InheritanceOption { @@ -39,5 +38,4 @@ namespace System.EnterpriseServices { Inherit, Ignore } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/PartitionOption.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/PartitionOption.cs index f3ac104e39f..8ea16469cf2 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/PartitionOption.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/PartitionOption.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [ComVisible(false)] public enum PartitionOption { @@ -40,5 +39,4 @@ namespace System.EnterpriseServices { Inherit, New } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationConfig.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationConfig.cs index e35406207e4..8a1d1c1bf00 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationConfig.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationConfig.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [Guid("36dcda30-dc3b-4d93-be42-90b2d74c64e7")] public class RegistrationConfig { @@ -110,5 +109,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelper.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelper.cs index 0750fe0ce36..860ffa48834 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelper.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelper.cs @@ -59,13 +59,11 @@ namespace System.EnterpriseServices { throw new NotImplementedException (); } -#if NET_1_1 [MonoTODO] public void InstallAssemblyFromConfig ([MarshalAs(UnmanagedType.IUnknown)] ref RegistrationConfig regConfig) { throw new NotImplementedException (); } -#endif public void UninstallAssembly (string assembly, string application) { @@ -78,13 +76,11 @@ namespace System.EnterpriseServices { throw new NotImplementedException (); } -#if NET_1_1 [MonoTODO] public void UninstallAssemblyFromConfig ([MarshalAs(UnmanagedType.IUnknown)] ref RegistrationConfig regConfig) { throw new NotImplementedException (); } -#endif #endregion // Methods } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelperTx.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelperTx.cs index a1fe576b1a6..70fd1cdb808 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelperTx.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/RegistrationHelperTx.cs @@ -70,13 +70,11 @@ namespace System.EnterpriseServices { throw new NotImplementedException (); } -#if NET_1_1 [MonoTODO] public void InstallAssemblyFromConfig ([MarshalAs(UnmanagedType.IUnknown)] ref RegistrationConfig regConfig, object sync) { throw new NotImplementedException (); } -#endif [MonoTODO] public bool IsInTransaction () @@ -95,13 +93,11 @@ namespace System.EnterpriseServices { throw new NotImplementedException (); } -#if NET_1_1 [MonoTODO] public void UninstallAssemblyFromConfig ([MarshalAs(UnmanagedType.IUnknown)] ref RegistrationConfig regConfig, object sync) { throw new NotImplementedException (); } -#endif #endregion // Methods } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceConfig.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceConfig.cs index 02a440252b3..1dc83a10a32 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceConfig.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceConfig.cs @@ -34,7 +34,6 @@ using System.Transactions; namespace System.EnterpriseServices { -#if NET_1_1 [MonoTODO] [ComVisible(false)] public sealed class ServiceConfig { @@ -265,5 +264,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceDomain.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceDomain.cs index a8c5cf11378..c7e1e8bc007 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceDomain.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ServiceDomain.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [ComVisible(false)] public sealed class ServiceDomain { #region Constructors @@ -58,5 +57,4 @@ namespace System.EnterpriseServices { #endregion } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/SxsOption.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/SxsOption.cs index 7330cb65a50..6cd57c7a9e9 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/SxsOption.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/SxsOption.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [ComVisible(false)] public enum SxsOption { @@ -40,5 +39,4 @@ namespace System.EnterpriseServices { Inherit, New } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ThreadPoolOption.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ThreadPoolOption.cs index 065150db648..f7d430b3600 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ThreadPoolOption.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/ThreadPoolOption.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [ComVisible(false)] public enum ThreadPoolOption { @@ -41,5 +40,4 @@ namespace System.EnterpriseServices { STA, MTA } -#endif } diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/TransactionStatus.cs b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/TransactionStatus.cs index 2f403ec55f3..ea80895d96f 100644 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices/TransactionStatus.cs +++ b/mcs/class/System.EnterpriseServices/System.EnterpriseServices/TransactionStatus.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; namespace System.EnterpriseServices { -#if NET_1_1 [Serializable] [ComVisible(false)] public enum TransactionStatus { @@ -42,5 +41,4 @@ namespace System.EnterpriseServices { Aborting, Aborted } -#endif } diff --git a/mcs/class/System.Management/Assembly/AssemblyInfo.cs b/mcs/class/System.Management/Assembly/AssemblyInfo.cs index ee74384c1fe..7f5675a5b1e 100644 --- a/mcs/class/System.Management/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Management/Assembly/AssemblyInfo.cs @@ -37,38 +37,23 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about the System.Management assembly -// This one is very different for version < 2.0 -#if NET_2_0 - [assembly: AssemblyTitle ("System.Management.dll")] - [assembly: AssemblyDescription ("System.Management.dll")] - [assembly: AssemblyDefaultAlias ("System.Management.dll")] -#endif +[assembly: AssemblyTitle ("System.Management.dll")] +[assembly: AssemblyDescription ("System.Management.dll")] +[assembly: AssemblyDefaultAlias ("System.Management.dll")] [assembly: AssemblyCompany (Consts.MonoCompany)] [assembly: AssemblyProduct (Consts.MonoProduct)] [assembly: AssemblyCopyright (Consts.MonoCopyright)] [assembly: AssemblyVersion (Consts.FxVersion)] -#if NET_2_0 - [assembly: SatelliteContractVersion (Consts.FxVersion)] - [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: SatelliteContractVersion (Consts.FxVersion)] +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] - [assembly: NeutralResourcesLanguage ("en-US")] -#endif +[assembly: NeutralResourcesLanguage ("en-US")] [assembly: ComVisible (false)] [assembly: CLSCompliant (true)] [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -#elif NET_1_1 || NET_1_0 - [assembly: AssemblyTitle ("System.Management")] - [assembly: AssemblyDescription ("This assembly contains the classes necessary to access management information from managed code")] - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] - [assembly: AssemblyKeyName ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Messaging/Assembly/AssemblyInfo.cs b/mcs/class/System.Messaging/Assembly/AssemblyInfo.cs index 89e69f75f76..7c1947b9950 100644 --- a/mcs/class/System.Messaging/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Messaging/Assembly/AssemblyInfo.cs @@ -57,15 +57,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Net.Http.Formatting/Extensions.cs b/mcs/class/System.Net.Http.Formatting/Extensions.cs deleted file mode 100644 index 0f92f977e3a..00000000000 --- a/mcs/class/System.Net.Http.Formatting/Extensions.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// Extension.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 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.Collections.Generic; -using System.Net.Http.Headers; - -// -// Workaround for not up-to-date aspnetwebstack, once it support .net 4.5 this could be deleted -// -static class Extensions -{ - public static void TryAddWithoutValidation (this HttpHeaders headers, string key, string value) - { - headers.AddWithoutValidation (key, value); - } - - public static bool TryAddWithoutValidation (this HttpHeaders headers, string key, IEnumerable values) - { - headers.AddWithoutValidation (key, values); - return true; - } -} \ No newline at end of file diff --git a/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting.dll.sources b/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting.dll.sources index 424472b82fc..17693de1d10 100644 --- a/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting.dll.sources +++ b/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting.dll.sources @@ -83,8 +83,6 @@ ../../../external/aspnetwebstack/src/System.Net.Http.Formatting/UriExtensions.cs -Extensions.cs - ../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryType.cs ../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs ../../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonReader.cs diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs index 5f32c034c71..55ef3c7fa8b 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs @@ -221,18 +221,29 @@ namespace System.Net.Http.Headers return ok; } - public void AddWithoutValidation (string name, string value) + public bool TryAddWithoutValidation (string name, string value) { - AddWithoutValidation (name, new[] { value }); + return TryAddWithoutValidation (name, new[] { value }); } - public void AddWithoutValidation (string name, IEnumerable values) + public bool TryAddWithoutValidation (string name, IEnumerable values) { if (values == null) throw new ArgumentNullException ("values"); - CheckName (name); + if (string.IsNullOrEmpty (name)) + return false; + + Parser.Token.Check (name); + + HeaderInfo headerInfo; + if (known_headers.TryGetValue (name, out headerInfo) && (headerInfo.HeaderKind & HeaderKind) == 0) { + if (HeaderKind != HttpHeaderKind.None && ((HeaderKind | headerInfo.HeaderKind) & HttpHeaderKind.Content) != 0) + return false; + } + AddInternal (name, values, null, true); + return true; } HeaderInfo CheckName (string name) diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpRequestHeaders.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpRequestHeaders.cs index 8f512c6cd33..4f6ceeef8e9 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpRequestHeaders.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpRequestHeaders.cs @@ -315,7 +315,7 @@ namespace System.Net.Http.Headers internal void AddHeaders (HttpRequestHeaders headers) { foreach (var header in headers) { - AddWithoutValidation (header.Key, header.Value); + TryAddWithoutValidation (header.Key, header.Value); } } } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs index 840ffbe3567..cdf73d3a78e 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/Parser.cs @@ -59,6 +59,21 @@ namespace System.Net.Http.Headers } } + public static bool TryCheck (string s) + { + if (s == null) + return false; + + if (!Lexer.IsValidToken (s)) { + if (s.Length == 0) + return false; + + return false; + } + + return true; + } + public static void CheckQuotedString (string s) { if (s == null) diff --git a/mcs/class/System.Net.Http/System.Net.Http.dll.sources b/mcs/class/System.Net.Http/System.Net.Http.dll.sources index 01f340fe096..ccca104fd9d 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/System.Net.Http.dll.sources @@ -9,6 +9,7 @@ System.Net.Http/HttpClientHandler.cs System.Net.Http/HttpCompletionOption.cs System.Net.Http/HttpContent.cs System.Net.Http/HttpMessageHandler.cs +System.Net.Http/HttpMessageInvoker.cs System.Net.Http/HttpMethod.cs System.Net.Http/HttpRequestException.cs System.Net.Http/HttpRequestMessage.cs diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs index 9a4ac95f9e3..5ed67893fff 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs @@ -33,27 +33,31 @@ using System.IO; namespace System.Net.Http { - public class HttpClient : IDisposable + public class HttpClient : HttpMessageInvoker { static readonly TimeSpan TimeoutDefault = TimeSpan.FromSeconds (100); Uri base_address; CancellationTokenSource cancellation_token; bool disposed; - readonly HttpMessageHandler handler; HttpRequestHeaders headers; - int buffer_size; + long buffer_size; TimeSpan timeout; public HttpClient () - : this (null) + : this (new HttpClientHandler (), true) { } - + public HttpClient (HttpMessageHandler handler) + : this (handler, true) + { + } + + public HttpClient (HttpMessageHandler handler, bool disposeHandler) + : base (handler, disposeHandler) { - this.handler = handler ?? new HttpClientHandler (); - buffer_size = 0x10000; + buffer_size = int.MaxValue; timeout = TimeoutDefault; } @@ -72,7 +76,7 @@ namespace System.Net.Http } } - public int MaxResponseContentBufferSize { + public long MaxResponseContentBufferSize { get { return buffer_size; } @@ -103,13 +107,8 @@ namespace System.Net.Http cancellation_token = new CancellationTokenSource (); } - - public void Dispose () - { - Dispose (true); - } - - protected virtual void Dispose (bool disposing) + + protected override void Dispose (bool disposing) { if (disposing && !disposed) { disposed = true; @@ -117,6 +116,8 @@ namespace System.Net.Http if (cancellation_token != null) cancellation_token.Dispose (); } + + base.Dispose (disposing); } public Task DeleteAsync (string requestUri) @@ -229,7 +230,7 @@ namespace System.Net.Http return SendAsync (request, completionOption, CancellationToken.None); } - public Task SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) + public override Task SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) { return SendAsync (request, HttpCompletionOption.ResponseContentRead, cancellationToken); } @@ -265,7 +266,7 @@ namespace System.Net.Http using (var cts = CancellationTokenSource.CreateLinkedTokenSource (cancellation_token.Token, cancellationToken)) { cts.CancelAfter (timeout); - var task = handler.SendAsync (request, cts.Token); + var task = base.SendAsync (request, cts.Token); if (task == null) throw new InvalidOperationException ("Handler failed to return a value"); diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs index 6ba92066f16..3e23d15f9ed 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs @@ -40,7 +40,7 @@ namespace System.Net.Http CookieContainer cookieContainer; ICredentials credentials; int maxAutomaticRedirections; - int maxRequestContentBufferSize; + long maxRequestContentBufferSize; bool preAuthenticate; IWebProxy proxy; bool useCookies; @@ -52,7 +52,7 @@ namespace System.Net.Http { allowAutoRedirect = true; maxAutomaticRedirections = 50; - maxRequestContentBufferSize = 0x10000; + maxRequestContentBufferSize = int.MaxValue; useCookies = true; useProxy = true; } @@ -114,7 +114,7 @@ namespace System.Net.Http } } - public int MaxRequestContentBufferSize { + public long MaxRequestContentBufferSize { get { return maxRequestContentBufferSize; } @@ -241,11 +241,10 @@ namespace System.Net.Http var headers = wr.Headers; foreach (var header in request.Headers) { foreach (var value in header.Value) { - // TODO: Have to call simpler Add - headers.Add (header.Key, value); + headers.AddValue (header.Key, value); } } - + return wr; } @@ -261,10 +260,13 @@ namespace System.Net.Http var key = headers.GetKey(i); var value = headers.GetValues (i); + HttpHeaders item_headers; if (HttpHeaders.GetKnownHeaderKind (key) == Headers.HttpHeaderKind.Content) - response.Content.Headers.AddWithoutValidation (key, value); + item_headers = response.Content.Headers; else - response.Headers.AddWithoutValidation (key, value); + item_headers = response.Headers; + + item_headers.TryAddWithoutValidation (key, value); } return response; @@ -275,12 +277,18 @@ namespace System.Net.Http var wrequest = CreateWebRequest (request); if (request.Content != null) { - throw new NotImplementedException (); - //var stream = await wrequest.GetRequestStreamAsync (); - //await request.Content.CopyToAsync (stream); + var headers = wrequest.Headers; + foreach (var header in request.Content.Headers) { + foreach (var value in header.Value) { + headers.AddValue (header.Key, value); + } + } + + var stream = wrequest.GetRequestStream (); + await request.Content.CopyToAsync (stream); } - // FIXME: Why GetResponseAsync does not accept cancellationToken + // FIXME: GetResponseAsync does not accept cancellationToken var wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false); return CreateResponseMessage (wresponse, request); } diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs index 84d65a637e0..6bb8249dd38 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs @@ -37,9 +37,9 @@ namespace System.Net.Http { sealed class FixedMemoryStream : MemoryStream { - readonly int maxSize; + readonly long maxSize; - public FixedMemoryStream (int maxSize) + public FixedMemoryStream (long maxSize) : base () { this.maxSize = maxSize; @@ -94,7 +94,7 @@ namespace System.Net.Http return buffer; } - static FixedMemoryStream CreateFixedMemoryStream (int maxBufferSize) + static FixedMemoryStream CreateFixedMemoryStream (long maxBufferSize) { return new FixedMemoryStream (maxBufferSize); } @@ -119,7 +119,7 @@ namespace System.Net.Http return LoadIntoBufferAsync (0x2000); } - public async Task LoadIntoBufferAsync (int maxBufferSize) + public async Task LoadIntoBufferAsync (long maxBufferSize) { if (disposed) throw new ObjectDisposedException (GetType ().ToString ()); diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpMessageInvoker.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpMessageInvoker.cs new file mode 100644 index 00000000000..3843bf42787 --- /dev/null +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpMessageInvoker.cs @@ -0,0 +1,71 @@ +// +// HttpMessageInvoker.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2012 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.Threading; +using System.Threading.Tasks; + +namespace System.Net.Http +{ + public class HttpMessageInvoker : IDisposable + { + HttpMessageHandler handler; + readonly bool disposeHandler; + + public HttpMessageInvoker (HttpMessageHandler handler) + : this (handler, true) + { + } + + public HttpMessageInvoker (HttpMessageHandler handler, bool disposeHandler) + { + if (handler == null) + throw new ArgumentNullException ("handler"); + + this.handler = handler; + this.disposeHandler = disposeHandler; + } + + public void Dispose () + { + Dispose (true); + } + + protected virtual void Dispose (bool disposing) + { + if (disposing && disposeHandler && handler != null) { + handler.Dispose (); + handler = null; + } + } + + public virtual Task SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) + { + return handler.SendAsync (request, cancellationToken); + } + } +} diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientHandlerTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientHandlerTest.cs index fc778fabf5a..202fb747b6c 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientHandlerTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientHandlerTest.cs @@ -70,7 +70,7 @@ namespace MonoTests.System.Net.Http Assert.AreEqual (4096, h.CookieContainer.MaxCookieSize, "#3b"); Assert.AreEqual (null, h.Credentials, "#4"); Assert.AreEqual (50, h.MaxAutomaticRedirections, "#5"); - Assert.AreEqual (0x10000, h.MaxRequestContentBufferSize, "#6"); + Assert.AreEqual (int.MaxValue, h.MaxRequestContentBufferSize, "#6"); Assert.IsFalse (h.PreAuthenticate, "#7"); Assert.IsNull (h.Proxy, "#8"); Assert.IsTrue (h.SupportsAutomaticDecompression, "#9"); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index 90c8a2d54f9..dfbe926b9c8 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -86,7 +86,7 @@ namespace MonoTests.System.Net.Http var client = new HttpClient (); Assert.IsNull (client.BaseAddress, "#1"); Assert.IsNotNull (client.DefaultRequestHeaders, "#2"); // TODO: full check - Assert.AreEqual (0x10000, client.MaxResponseContentBufferSize, "#3"); + Assert.AreEqual (int.MaxValue, client.MaxResponseContentBufferSize, "#3"); Assert.AreEqual (TimeSpan.FromSeconds (100), client.Timeout, "#4"); } @@ -404,7 +404,7 @@ namespace MonoTests.System.Net.Http try { var client = new HttpClient (); var request = new HttpRequestMessage (HttpMethod.Get, LocalServer); - request.Headers.AddWithoutValidation ("aa", "vv"); + Assert.IsTrue (request.Headers.TryAddWithoutValidation ("aa", "vv"), "#0"); var response = client.SendAsync (request, HttpCompletionOption.ResponseHeadersRead).Result; Assert.AreEqual ("", response.Content.ReadAsStringAsync ().Result, "#100"); @@ -450,7 +450,7 @@ namespace MonoTests.System.Net.Http try { var client = new HttpClient (); var request = new HttpRequestMessage (HttpMethod.Get, LocalServer); - request.Headers.AddWithoutValidation ("aa", "vv"); + Assert.IsTrue (request.Headers.TryAddWithoutValidation ("aa", "vv"), "#0"); var response = client.SendAsync (request, HttpCompletionOption.ResponseHeadersRead).Result; Assert.AreEqual ("7K", response.Content.ReadAsStringAsync ().Result, "#100"); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs index 8dacdefb9aa..38c376adec3 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs @@ -336,7 +336,7 @@ namespace MonoTests.System.Net.Http headers.Add ("c", null as string); headers.Add ("d", new string[0]); - headers.AddWithoutValidation ("accept", "audio"); + Assert.IsTrue (headers.TryAddWithoutValidation ("accept", "audio"), "#0"); Assert.IsFalse (headers.Contains ("nn"), "#1a"); Assert.IsTrue (headers.Contains ("b"), "#1b"); @@ -364,7 +364,7 @@ namespace MonoTests.System.Net.Http headers.Clear (); headers.Accept.Add (new MediaTypeWithQualityHeaderValue ("audio/x")); - headers.AddWithoutValidation ("accept", "audio"); + Assert.IsTrue (headers.TryAddWithoutValidation ("accept", "audio"), "#55"); values = headers.GetValues ("accept").ToList (); Assert.AreEqual (2, values.Count, "#6"); @@ -374,7 +374,7 @@ namespace MonoTests.System.Net.Http headers.Clear (); - headers.AddWithoutValidation ("from", new[] { "a@a.com", "ssss@oo.com" }); + Assert.IsTrue (headers.TryAddWithoutValidation ("from", new[] { "a@a.com", "ssss@oo.com" }), "#70"); values = headers.GetValues ("from").ToList (); Assert.AreEqual (2, values.Count, "#7"); @@ -384,7 +384,7 @@ namespace MonoTests.System.Net.Http headers.Clear (); - headers.AddWithoutValidation ("Date", "wrong date"); + Assert.IsTrue (headers.TryAddWithoutValidation ("Date", "wrong date"), "#8-0"); var value = headers.Date; Assert.IsNull (headers.Date, "#8"); } @@ -419,17 +419,9 @@ namespace MonoTests.System.Net.Http } catch (FormatException) { } - try { - headers.AddWithoutValidation ("Allow", ""); - Assert.Fail ("#3"); - } catch (InvalidOperationException) { - } + Assert.IsFalse (headers.TryAddWithoutValidation ("Allow", ""), "#3"); ; - try { - headers.AddWithoutValidation (null, ""); - Assert.Fail ("#4"); - } catch (ArgumentException) { - } + Assert.IsFalse (headers.TryAddWithoutValidation (null, ""), "#4"); try { headers.Contains (null); @@ -455,7 +447,7 @@ namespace MonoTests.System.Net.Http } catch (FormatException) { } - headers.AddWithoutValidation ("from", "a@a.com"); + Assert.IsTrue (headers.TryAddWithoutValidation ("from", "a@a.com"), "#7-0"); try { headers.Add ("from", "valid@w3.org"); Assert.Fail ("#7b"); @@ -473,7 +465,7 @@ namespace MonoTests.System.Net.Http Assert.AreEqual ("vv", headers.GetValues ("Age").First (), "#1"); headers.Clear (); - headers.AddWithoutValidation ("Age", "vv"); + headers.TryAddWithoutValidation ("Age", "vv"); Assert.AreEqual ("vv", headers.GetValues ("Age").First (), "#2"); Assert.AreEqual ("Method: GET, RequestUri: '', Version: 1.1, Content: , Headers:\r\n{\r\nAge: vv\r\n}", message.ToString (), "#3"); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs index a0643930864..feb94158b81 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs @@ -304,7 +304,7 @@ namespace MonoTests.System.Net.Http headers.Add ("c", null as string); headers.Add ("d", new string[0]); - headers.AddWithoutValidation ("cache-control", "audio"); + headers.TryAddWithoutValidation ("cache-control", "audio"); Assert.IsFalse (headers.Contains ("nn"), "#1a"); Assert.IsTrue (headers.Contains ("b"), "#1b"); @@ -362,17 +362,9 @@ namespace MonoTests.System.Net.Http } catch (InvalidOperationException) { } - try { - headers.AddWithoutValidation ("Allow", ""); - Assert.Fail ("#3"); - } catch (InvalidOperationException) { - } + Assert.IsFalse (headers.TryAddWithoutValidation ("Allow", ""), "#3"); - try { - headers.AddWithoutValidation (null, ""); - Assert.Fail ("#4"); - } catch (ArgumentException) { - } + Assert.IsFalse (headers.TryAddWithoutValidation (null, ""), "#4"); try { headers.Contains (null); @@ -398,7 +390,7 @@ namespace MonoTests.System.Net.Http } catch (FormatException) { } - headers.AddWithoutValidation ("location", "a@a.com"); + headers.TryAddWithoutValidation ("location", "a@a.com"); try { headers.Add ("location", "w3.org"); Assert.Fail ("#7b"); @@ -416,7 +408,7 @@ namespace MonoTests.System.Net.Http Assert.AreEqual ("audio", headers.GetValues ("Accept").First (), "#1"); headers.Clear (); - headers.AddWithoutValidation ("accept", "audio"); + Assert.IsTrue (headers.TryAddWithoutValidation ("accept", "audio"), "#2a"); Assert.AreEqual ("audio", headers.GetValues ("Accept").First (), "#2"); } @@ -447,7 +439,7 @@ namespace MonoTests.System.Net.Http { HttpResponseMessage message = new HttpResponseMessage (); HttpResponseHeaders headers = message.Headers; - headers.AddWithoutValidation ("location", "http://w3.org"); + headers.TryAddWithoutValidation ("location", "http://w3.org"); Assert.AreEqual (new Uri ("http://w3.org"), headers.Location); } @@ -456,9 +448,9 @@ namespace MonoTests.System.Net.Http { HttpResponseMessage message = new HttpResponseMessage (); HttpResponseHeaders headers = message.Headers; - headers.AddWithoutValidation ("Transfer-Encoding", "mmm"); - headers.AddWithoutValidation ("Transfer-Encoding", "▀"); - headers.AddWithoutValidation ("Transfer-Encoding", "zz"); + headers.TryAddWithoutValidation ("Transfer-Encoding", "mmm"); + headers.TryAddWithoutValidation ("Transfer-Encoding", "▀"); + headers.TryAddWithoutValidation ("Transfer-Encoding", "zz"); var a = headers.TransferEncoding; Assert.AreEqual (2, a.Count, "#1"); @@ -483,16 +475,16 @@ namespace MonoTests.System.Net.Http Assert.AreEqual (1, headers.TransferEncoding.Count, "#3b"); headers.Clear (); - headers.AddWithoutValidation ("Transfer-Encoding", "value"); + Assert.IsTrue (headers.TryAddWithoutValidation ("Transfer-Encoding", "value"), "#4-0"); // Assert.AreEqual (false, headers.TransferEncodingChunked, "#4"); headers.Clear (); - headers.AddWithoutValidation ("Transfer-Encoding", "chunked"); + Assert.IsTrue (headers.TryAddWithoutValidation ("Transfer-Encoding", "chunked"), "#5-0"); Assert.AreEqual (true, headers.TransferEncodingChunked, "#5"); message = new HttpResponseMessage (); headers = message.Headers; - headers.AddWithoutValidation ("Transfer-Encoding", "ß"); + Assert.IsTrue (headers.TryAddWithoutValidation ("Transfer-Encoding", "ß"), "#6-0"); Assert.IsNull (headers.TransferEncodingChunked, "#6"); } diff --git a/mcs/class/System.Net/Assembly/AssemblyInfo.cs b/mcs/class/System.Net/Assembly/AssemblyInfo.cs index 4ce53b39296..1aeda8cd3f8 100644 --- a/mcs/class/System.Net/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Net/Assembly/AssemblyInfo.cs @@ -59,16 +59,10 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo ("System.Windows, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")] [assembly: InternalsVisibleTo ("System.Windows.Browser, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")] [assembly: InternalsVisibleTo ("System.Xml, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")] -#if MOONLIGHT - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -#endif #else [assembly: AssemblyKeyFile ("../ecma.pub")] [assembly: AllowPartiallyTrustedCallers] [assembly: SecurityCritical] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.DisableOptimizations | - DebuggableAttribute.DebuggingModes.EnableEditAndContinue | - DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] #endif [assembly: ComVisible (false)] diff --git a/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs index 04c6aa84930..bd93a4debbb 100644 --- a/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs @@ -61,16 +61,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyKeyFile("../ecma.pub")] #endif -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CLSCompliant (false)] - [assembly: ComVisible (false)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] - [assembly: TypeLibVersion (2, 0)] -#elif NET_1_1 - [assembly: TypeLibVersion (1, 10)] -#elif NET_1_0 - [assembly: TypeLibVersion (1, 10)] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CLSCompliant (false)] +[assembly: ComVisible (false)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] +[assembly: TypeLibVersion (2, 0)] diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryClientFormatterSinkProvider.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryClientFormatterSinkProvider.cs index 64482b84f2e..cb232dc6e32 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryClientFormatterSinkProvider.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryClientFormatterSinkProvider.cs @@ -38,11 +38,7 @@ namespace System.Runtime.Remoting.Channels IClientChannelSinkProvider next = null; BinaryCore _binaryCore; -#if NET_1_1 static string[] allowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" }; -#else - static string[] allowedProperties = new string [] { "includeVersions", "strictBinding" }; -#endif public BinaryClientFormatterSinkProvider () { diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs index 8cc9a39b14f..7da3a54c3ce 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs @@ -43,9 +43,7 @@ namespace System.Runtime.Remoting.Channels bool _strictBinding = false; IDictionary _properties; -#if NET_1_1 TypeFilterLevel _filterLevel = TypeFilterLevel.Low; -#endif public static BinaryCore DefaultInstance = new BinaryCore (); @@ -74,7 +72,6 @@ namespace System.Runtime.Remoting.Channels _strictBinding = Convert.ToBoolean (property.Value); break; -#if NET_1_1 case "typeFilterLevel": if (property.Value is TypeFilterLevel) _filterLevel = (TypeFilterLevel) property.Value; @@ -83,7 +80,6 @@ namespace System.Runtime.Remoting.Channels _filterLevel = (TypeFilterLevel) Enum.Parse (typeof(TypeFilterLevel), s); } break; -#endif } } @@ -110,10 +106,8 @@ namespace System.Runtime.Remoting.Channels _deserializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (null, context, false); #endif -#if NET_1_1 _serializationFormatter.FilterLevel = _filterLevel; _deserializationFormatter.FilterLevel = _filterLevel; -#endif if (!_includeVersions) { @@ -143,12 +137,10 @@ namespace System.Runtime.Remoting.Channels get { return _properties; } } -#if NET_1_1 public TypeFilterLevel TypeFilterLevel { get { return _filterLevel; } } -#endif } } diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSink.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSink.cs index 09c2b7f8eac..f9031a7dd8f 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSink.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSink.cs @@ -80,7 +80,6 @@ namespace System.Runtime.Remoting.Channels { } } -#if NET_1_1 [ComVisible(false)] public TypeFilterLevel TypeFilterLevel { @@ -92,7 +91,6 @@ namespace System.Runtime.Remoting.Channels { _binaryCore = new BinaryCore (this, props, BinaryServerFormatterSinkProvider.AllowedProperties); } } -#endif public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream) diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSinkProvider.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSinkProvider.cs index 3f77fd3aa27..8d5c85efd1e 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSinkProvider.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSinkProvider.cs @@ -40,11 +40,7 @@ namespace System.Runtime.Remoting.Channels IServerChannelSinkProvider next = null; BinaryCore _binaryCore; -#if NET_1_0 - internal static string[] AllowedProperties = new string [] { "includeVersions", "strictBinding" }; -#else internal static string[] AllowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" }; -#endif public BinaryServerFormatterSinkProvider () { @@ -68,7 +64,6 @@ namespace System.Runtime.Remoting.Channels } } -#if NET_1_1 [ComVisible(false)] public TypeFilterLevel TypeFilterLevel { @@ -80,7 +75,6 @@ namespace System.Runtime.Remoting.Channels _binaryCore = new BinaryCore (this, props, AllowedProperties); } } -#endif public IServerChannelSink CreateSink (IChannelReceiver channel) { diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs index 7fcbf261dfe..3480f3dfa40 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs @@ -43,9 +43,7 @@ namespace System.Runtime.Remoting.Channels bool _strictBinding = false; IDictionary _properties; -#if NET_1_1 TypeFilterLevel _filterLevel = TypeFilterLevel.Low; -#endif public static SoapCore DefaultInstance = new SoapCore (); @@ -73,7 +71,6 @@ namespace System.Runtime.Remoting.Channels case "strictBinding": _strictBinding = Convert.ToBoolean (property.Value); break; -#if NET_1_1 case "typeFilterLevel": if (property.Value is TypeFilterLevel) _filterLevel = (TypeFilterLevel) property.Value; @@ -82,7 +79,6 @@ namespace System.Runtime.Remoting.Channels _filterLevel = (TypeFilterLevel) Enum.Parse (typeof(TypeFilterLevel), s); } break; -#endif } } @@ -103,10 +99,8 @@ namespace System.Runtime.Remoting.Channels _serializationFormatter = CreateFormatter (surrogateSelector, context); _deserializationFormatter = CreateFormatter (null, context); -#if NET_1_1 _serializationFormatter.FilterLevel = _filterLevel; _deserializationFormatter.FilterLevel = _filterLevel; -#endif } SoapFormatter CreateFormatter (ISurrogateSelector selector, StreamingContext context) @@ -143,12 +137,10 @@ namespace System.Runtime.Remoting.Channels get { return _properties; } } -#if NET_1_1 public TypeFilterLevel TypeFilterLevel { get { return _filterLevel; } } -#endif } } diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs index 841bcea566d..d818bca48c7 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs @@ -86,7 +86,6 @@ namespace System.Runtime.Remoting.Channels { } } -#if NET_1_1 [ComVisible(false)] public TypeFilterLevel TypeFilterLevel { @@ -98,7 +97,6 @@ namespace System.Runtime.Remoting.Channels { _soapCore = new SoapCore (this, props, SoapServerFormatterSinkProvider.AllowedProperties); } } -#endif public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream) diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSinkProvider.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSinkProvider.cs index b0b164d98c0..4429caccc80 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSinkProvider.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSinkProvider.cs @@ -40,11 +40,7 @@ namespace System.Runtime.Remoting.Channels private IServerChannelSinkProvider _next; SoapCore _soapCore; -#if NET_1_0 - internal static string[] AllowedProperties = new string [] { "includeVersions", "strictBinding" }; -#else internal static string[] AllowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" }; -#endif public SoapServerFormatterSinkProvider () { @@ -64,7 +60,6 @@ namespace System.Runtime.Remoting.Channels set { _next = value; } } -#if NET_1_1 [ComVisible(false)] public TypeFilterLevel TypeFilterLevel { @@ -76,7 +71,6 @@ namespace System.Runtime.Remoting.Channels _soapCore = new SoapCore (this, props, AllowedProperties); } } -#endif public IServerChannelSink CreateSink (IChannelReceiver channel) { diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs index 449a7a2e439..cf07f16e8c5 100644 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs @@ -38,17 +38,15 @@ using System.Runtime.InteropServices; // General Information about the System.Runtime.Serialization.Formatters.Soap assembly -#if NET_2_0 - [assembly: AssemblyTitle ("System.Runtime.Serialization.Formatters.Soap.dll")] - [assembly: AssemblyDescription ("System.Runtime.Serialization.Formatters.Soap.dll")] - [assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Formatters.Soap.dll")] +[assembly: AssemblyTitle ("System.Runtime.Serialization.Formatters.Soap.dll")] +[assembly: AssemblyDescription ("System.Runtime.Serialization.Formatters.Soap.dll")] +[assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Formatters.Soap.dll")] - [assembly: AssemblyCompany (Consts.MonoCompany)] - [assembly: AssemblyProduct (Consts.MonoProduct)] - [assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] - [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] -#endif +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] [assembly: AssemblyVersion (Consts.FxVersion)] [assembly: SatelliteContractVersion (Consts.FxVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -61,14 +59,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyKeyFile ("../msfinal.pub")] #endif -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: ComVisible (true)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -#elif NET_1_1 - [assembly: TypeLibVersion (1, 10)] -#elif NET_1_0 - [assembly: TypeLibVersion (1, 10)] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: ComVisible (true)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs index d6f66de4daf..8fd2335c792 100644 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs +++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs @@ -52,9 +52,7 @@ namespace System.Runtime.Serialization.Formatters.Soap { private FormatterTypeStyle _typeFormat = FormatterTypeStyle.TypesWhenNeeded; private ISoapMessage _topObject = null; -#if NET_1_1 TypeFilterLevel _filterLevel = TypeFilterLevel.Low; -#endif public SoapFormatter() { _selector = null; @@ -146,11 +144,7 @@ namespace System.Runtime.Serialization.Formatters.Soap { } } -#if NET_1_1 [MonoTODO ("Interpret this")] -#if ONLY_1_1 - [ComVisible(false)] -#endif public TypeFilterLevel FilterLevel { get { return _filterLevel; @@ -159,7 +153,6 @@ namespace System.Runtime.Serialization.Formatters.Soap { _filterLevel = value; } } -#endif public FormatterAssemblyStyle AssemblyFormat { diff --git a/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs index f0920140104..9ef66efc6d8 100644 --- a/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs @@ -64,6 +64,3 @@ using System.Runtime.InteropServices; [assembly: AllowPartiallyTrustedCallers] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -// Extension attribute should be added by compiler diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs index e7866df1623..45fd1f70913 100755 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs @@ -13,10 +13,10 @@ // 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 @@ -51,6 +51,7 @@ namespace System.Runtime.Serialization StreamingContext context; ReadOnlyCollection returned_known_types; KnownTypeCollection known_types; + List specified_known_types; IDataContractSurrogate surrogate; DataContractResolver resolver, default_resolver; @@ -76,7 +77,7 @@ namespace System.Runtime.Serialization QName qname = known_types.GetQName (type); FillDictionaryString (qname.Name, qname.Namespace); - + } public DataContractSerializer (Type type, string rootName, @@ -216,11 +217,16 @@ namespace System.Runtime.Serialization void PopulateTypes (IEnumerable knownTypes) { if (known_types == null) - known_types= new KnownTypeCollection (); + known_types = new KnownTypeCollection (); + + if (specified_known_types == null) + specified_known_types = new List (); if (knownTypes != null) { - foreach (Type t in knownTypes) + foreach (Type t in knownTypes) { known_types.Add (t); + specified_known_types.Add (t); + } } RegisterTypeAsKnown (type); @@ -288,7 +294,7 @@ namespace System.Runtime.Serialization public ReadOnlyCollection KnownTypes { get { if (returned_known_types == null) - returned_known_types = new ReadOnlyCollection (known_types); + returned_known_types = new ReadOnlyCollection (specified_known_types); return returned_known_types; } } @@ -365,18 +371,6 @@ namespace System.Runtime.Serialization } #endif - private void ReadRootStartElement (XmlReader reader, Type type) - { - SerializationMap map = - known_types.FindUserMap (type); - QName name = map != null ? map.XmlName : - KnownTypeCollection.GetPredefinedTypeName (type); - reader.MoveToContent (); - reader.ReadStartElement (name.Name, name.Namespace); - // FIXME: could there be any attributes to handle here? - reader.Read (); - } - // SP1 public override void WriteObject (XmlWriter writer, object graph) { @@ -444,7 +438,7 @@ namespace System.Runtime.Serialization XmlDictionaryWriter writer, object graph) { Type rootType = type; - + if (root_name.Value == "") throw new InvalidDataContractException ("Type '" + type.ToString () + "' cannot have a DataContract attribute Name set to null or empty string."); @@ -496,7 +490,7 @@ namespace System.Runtime.Serialization /* Different names */ known_types.Add (rootType); - + instName = instName ?? KnownTypeCollection.GetPredefinedTypeName (graph.GetType ()); if (instName == QName.Empty) /* Not a primitive type */ @@ -512,7 +506,7 @@ namespace System.Runtime.Serialization writer.WriteEndAttribute (); */ } - + bool IsUnknownType (Type type) { if (known_types.Contains (type) || diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs index 8713ef37fbd..946e5aa5af5 100755 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs @@ -13,10 +13,10 @@ // 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 @@ -213,8 +213,6 @@ namespace System.Runtime.Serialization return name; if (type == typeof (DBNull)) return dbnull_type; - if (type == typeof (DateTimeOffset)) - return date_time_offset_type; return QName.Empty; } @@ -241,6 +239,8 @@ namespace System.Runtime.Serialization return base64_type; if (type == typeof (Uri)) return any_uri_type; + if (type == typeof (DateTimeOffset)) + return date_time_offset_type; return QName.Empty; case TypeCode.Boolean: return bool_type; @@ -504,12 +504,28 @@ namespace System.Runtime.Serialization base.InsertItem (index - 1, type); } + internal SerializationMap FindUserMap (Type type) + { + lock (this) { + for (int i = 0; i < contracts.Count; i++) + if (type == contracts [i].RuntimeType) + return contracts [i]; + return null; + } + } + internal SerializationMap FindUserMap (QName qname) { lock (this) return contracts.FirstOrDefault (c => c.XmlName == qname); } + internal SerializationMap FindUserMap (QName qname, Type type) + { + lock (this) + return contracts.FirstOrDefault (c => c.XmlName == qname && c.RuntimeType == type); + } + internal Type GetSerializedType (Type type) { if (IsPrimitiveNotEnum (type)) @@ -518,28 +534,18 @@ namespace System.Runtime.Serialization if (element == null) return type; QName name = GetQName (type); - var map = FindUserMap (name); + var map = FindUserMap (name, type); if (map != null) return map.RuntimeType; return type; } - internal SerializationMap FindUserMap (Type type) - { - lock (this) { - for (int i = 0; i < contracts.Count; i++) - if (type == contracts [i].RuntimeType) - return contracts [i]; - return null; - } - } - internal QName GetQName (Type type) { SerializationMap map = FindUserMap (type); if (map != null) // already mapped. - return map.XmlName; + return map.XmlName; return GetStaticQName (type); } @@ -556,7 +562,7 @@ namespace System.Runtime.Serialization return qname; if (type.GetInterface ("System.Xml.Serialization.IXmlSerializable") != null) - //FIXME: Reusing GetSerializableQName here, since we just + //FIXME: Reusing GetSerializableQName here, since we just //need name of the type.. return GetSerializableQName (type); @@ -596,7 +602,7 @@ namespace System.Runtime.Serialization for (int i = 0; i < args.Length; i++) name = name.Replace ("{" + i + "}", GetStaticQName (args [i]).Name); } - + if (ns == null) ns = GetDefaultNamespace (type); return new QName (name, ns); @@ -627,7 +633,7 @@ namespace System.Runtime.Serialization internal static string GetDefaultName (Type type) { - // FIXME: there could be decent ways to get + // FIXME: there could be decent ways to get // the same result... string name = type.Namespace == null || type.Namespace.Length == 0 ? type.Name : type.FullName.Substring (type.Namespace.Length + 1).Replace ('+', '.'); if (type.IsGenericType) { @@ -649,7 +655,7 @@ namespace System.Runtime.Serialization static QName GetCollectionQName (Type element) { QName eqname = GetStaticQName (element); - + string ns = eqname.Namespace; if (eqname.Namespace == MSSimpleNamespace) //Arrays of Primitive types @@ -699,7 +705,7 @@ namespace System.Runtime.Serialization return false; if (Type.GetTypeCode (type) != TypeCode.Object) // explicitly primitive return true; - if (type == typeof (Guid) || type == typeof (object) || type == typeof(TimeSpan) || type == typeof(byte[]) || type==typeof(Uri)) // special primitives + if (type == typeof (Guid) || type == typeof (object) || type == typeof(TimeSpan) || type == typeof(byte[]) || type == typeof(Uri) || type == typeof(DateTimeOffset)) // special primitives return true; #if !MOONLIGHT // DOM nodes @@ -794,7 +800,7 @@ namespace System.Runtime.Serialization QName qname = GetCollectionContractQName (type); CheckStandardQName (qname); - var map = FindUserMap (qname); + var map = FindUserMap (qname, type); if (map != null) { var cmap = map as CollectionContractTypeMap; if (cmap == null) // The runtime type may still differ (between array and other IList; see bug #670560) @@ -816,7 +822,7 @@ namespace System.Runtime.Serialization QName qname = GetCollectionQName (element); - var map = FindUserMap (qname); + var map = FindUserMap (qname, element); if (map != null) { var cmap = map as CollectionTypeMap; if (cmap == null) // The runtime type may still differ (between array and other IList; see bug #670560) @@ -853,7 +859,7 @@ namespace System.Runtime.Serialization TryRegister (ret.KeyType); TryRegister (ret.ValueType); - var map = FindUserMap (ret.XmlName); + var map = FindUserMap (ret.XmlName, type); if (map != null) { var dmap = map as DictionaryTypeMap; if (dmap == null) // The runtime type may still differ (between array and other IList; see bug #670560) @@ -868,7 +874,7 @@ namespace System.Runtime.Serialization { QName qname = GetSerializableQName (type); - if (FindUserMap (qname) != null) + if (FindUserMap (qname, type) != null) throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname)); SharedTypeMap ret = new SharedTypeMap (type, qname, this); @@ -884,7 +890,7 @@ namespace System.Runtime.Serialization QName qname = GetSerializableQName (type); - if (FindUserMap (qname) != null) + if (FindUserMap (qname, type) != null) throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname)); XmlSerializableMap ret = new XmlSerializableMap (type, qname, this); @@ -911,7 +917,7 @@ namespace System.Runtime.Serialization if (qname == null) return null; CheckStandardQName (qname); - if (FindUserMap (qname) != null) + if (FindUserMap (qname, type) != null) throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname)); SharedContractMap ret = new SharedContractMap (type, qname, this); @@ -948,7 +954,7 @@ namespace System.Runtime.Serialization if (qname == null) return null; - if (FindUserMap (qname) != null) + if (FindUserMap (qname, type) != null) throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname)); EnumMap ret = diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs index 88dcd1c063c..252613a87ff 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs @@ -200,8 +200,14 @@ namespace System.Runtime.Serialization object DeserializePrimitive (Type type, XmlReader reader, QName qname) { + bool isDateTimeOffset = false; + // Handle DateTimeOffset type and DateTimeOffset?. + if (type == typeof (DateTimeOffset)) + isDateTimeOffset = true; + else if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) + isDateTimeOffset = type.GetGenericArguments () [0] == typeof (DateTimeOffset); // It is the only exceptional type that does not serialize to string but serializes into complex element. - if (type == typeof (DateTimeOffset)) { + if (isDateTimeOffset) { if (reader.IsEmptyElement) { reader.Read (); return default (DateTimeOffset); @@ -231,7 +237,12 @@ namespace System.Runtime.Serialization object DeserializeByMap (QName name, Type type, XmlReader reader) { - SerializationMap map = resolved_qnames.ContainsKey (name) ? types.FindUserMap (type) : types.FindUserMap (name); // use type when the name is "resolved" one. Otherwise use name (there are cases that type cannot be resolved by type). + SerializationMap map = null; + // List and T[] have the same QName, use type to find map work better. + if(name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) || resolved_qnames.ContainsKey (name)) + map = types.FindUserMap (type); + else + map = types.FindUserMap (name); // use type when the name is "resolved" one. Otherwise use name (there are cases that type cannot be resolved by type). if (map == null && (name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) || name.Namespace == KnownTypeCollection.MSArraysNamespace || name.Namespace.StartsWith (KnownTypeCollection.DefaultClrNamespaceBase, StringComparison.Ordinal))) { diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs index a816839b87c..f90ab47e221 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs @@ -119,8 +119,18 @@ namespace System.Runtime.Serialization types.Add (actualType); map = types.FindUserMap (actualType); } + + bool explicityType = false; + if(type != actualType) + { + // Check if underlying type of Nullable, mismatch the current type. + if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) + explicityType = (type.GetGenericArguments () [0] != actualType); + else + explicityType = true; + } - if (actualType != type && (map == null || map.OutputXsiType)) { + if (explicityType && (map == null || map.OutputXsiType)) { QName qname = resolvedQName ?? types.GetXmlName (actualType); string name = qname.Name; string ns = qname.Namespace; @@ -151,12 +161,14 @@ namespace System.Runtime.Serialization if (label != null) Writer.WriteAttributeString ("z", "Id", KnownTypeCollection.MSSimpleNamespace, label); -// writer.WriteStartAttribute ("type", XmlSchema.InstanceNamespace); -// writer.WriteQualifiedName (qname.Name, qname.Namespace); -// writer.WriteEndAttribute (); - + bool isDateTimeOffset = false; + // Handle DateTimeOffset type and DateTimeOffset? + if (type == typeof (DateTimeOffset)) + isDateTimeOffset = true; + else if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) + isDateTimeOffset = type.GetGenericArguments () [0] == typeof (DateTimeOffset); // It is the only exceptional type that does not serialize to string but serializes into complex element. - if (type == typeof (DateTimeOffset)) { + if (isDateTimeOffset) { var v = (DateTimeOffset) graph; writer.WriteStartElement ("DateTime", KnownTypeCollection.DefaultClrNamespaceSystem); SerializePrimitive (typeof (DateTime), DateTime.SpecifyKind (v.DateTime.Subtract (v.Offset), DateTimeKind.Utc), KnownTypeCollection.GetPredefinedTypeName (typeof (DateTime))); diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources index 355102e937a..6d3f3746026 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources @@ -1,9 +1,12 @@ System.Runtime.Serialization/Bug666333Test.cs System.Runtime.Serialization/Bug675144Test.cs System.Runtime.Serialization/Bug2843Test.cs -System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs +System.Runtime.Serialization/Bug3258Test.cs +System.Runtime.Serialization/Bug242Test.cs System.Runtime.Serialization/Bug695203Test.cs System.Runtime.Serialization/DataContractResolverTest.cs +System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs +System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs System.Runtime.Serialization/KnownTypeAttributeTest.cs System.Runtime.Serialization/XmlObjectSerializerTest.cs System.Runtime.Serialization/XsdDataContractExporterTest.cs diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug242Test.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug242Test.cs new file mode 100644 index 00000000000..df12bf788b0 --- /dev/null +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug242Test.cs @@ -0,0 +1,76 @@ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.ServiceModel.Channels; +using System.ServiceModel.Description; +using System.Xml; +using System.Linq; +using System.Text; +using System.ServiceModel.Dispatcher; + +using NUnit.Framework; + +namespace MonoTests.System.Runtime.Serialization +{ + public class DataItemTest242 + { + public string Name { get; set; } + } + + public class DataTest242 + { + public DataItemTest242[] DataArray { get; set; } + public IList DataIList { get; set; } + public List DataList { get; set; } + public ICollection DataICollection { get; set; } + public IEnumerable DataIEnumerable { get; set; } + } + + [TestFixture] + public class Bug242Test + { + [Test] + public void TestMixListArraySerialize() + { + var dataItems = new[] { new DataItemTest242 () { Name = "aaaaa" }, + new DataItemTest242 () { Name = "bbbbb" } }; + + var data = new DataTest242 () + { + DataArray = dataItems, + DataIList = dataItems.ToList (), + DataList = dataItems.ToList (), + DataICollection = dataItems.ToList (), + DataIEnumerable = dataItems.ToList () + }; + + // Serialize + string xml; + + using (var stream = new MemoryStream ()) + { + var serializer = new DataContractSerializer (typeof (DataTest242)); + serializer.WriteObject (stream, data); + xml = Encoding.UTF8.GetString (stream.ToArray ()); + } + + // Deserialize + DataTest242 clonedData; + using (var reader = XmlDictionaryReader.CreateTextReader (Encoding.UTF8.GetBytes (xml), new XmlDictionaryReaderQuotas ())) + { + var serializer = new DataContractSerializer (typeof (DataTest242)); + clonedData = (DataTest242)serializer.ReadObject (reader); + } + + // ensure resulting object is populated + Assert.AreEqual (clonedData.DataArray.Length , data.DataArray.Length,"#1 clonedData.DataArray.Length" ); + Assert.AreEqual (clonedData.DataList.Count, data.DataList.Count,"#2 clonedData.DataList.Count" ); + Assert.AreEqual (clonedData.DataIList.Count, data.DataIList.Count,"#3 clonedData.DataIList.Count" ); + Assert.AreEqual (clonedData.DataICollection.Count, data.DataICollection.Count,"#4 clonedData.DataICollection.Count" ); + Assert.AreEqual (clonedData.DataIEnumerable.Count (), data.DataIEnumerable.Count (),"#5 clonedData.DataIEnumerable.Count()" ); + } + } +} diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug2843Test.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug2843Test.cs index 9176fc922c8..41370633b8b 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug2843Test.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug2843Test.cs @@ -224,7 +224,7 @@ namespace Client2843.EvalServiceReference { namespace MonoTests.System.Runtime.Serialization { [TestFixture] - class Bug2843Test + public class Bug2843Test { [Test] public void TestNullableEnum() diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug3258Test.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug3258Test.cs new file mode 100644 index 00000000000..1d9e12334a1 --- /dev/null +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug3258Test.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.Serialization; +using System.Xml; + +using System.Text; + +using NUnit.Framework; + +namespace MonoTests.System.Runtime.Serialization +{ + [TestFixture] + public class Bug3258Test + { + [Test] + public void TestSerializeNullDateTimeOffsetNullable () + { + // Create the writer object. + StringBuilder stringBuilder = new StringBuilder (); + + DateTimeOffset? dto = null; + + DataContractSerializer ser = new DataContractSerializer (typeof (DateTimeOffset?)); + + using (var xw = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (new StringWriter (stringBuilder)))) + { + ser.WriteObject (xw, dto); + } + + string actualXml = stringBuilder.ToString (); + string expectedXml = ""; + + Assert.AreEqual (expectedXml, actualXml, "#1 Null DateTimeOffset? serialization error"); + + using (var xr = XmlDictionaryReader.CreateDictionaryReader (XmlReader.Create (new StringReader (actualXml)))) + { + DateTimeOffset? actualDto = (DateTimeOffset?)ser.ReadObject (xr, true); + + Assert.AreEqual (dto, actualDto, "#2 Null DateTimeOffset? deserialization error"); + Assert.IsNull (actualDto, "#3 Null DateTimeOffset? deserialization error"); + } + } + + [Test] + public void TestSerializeDateTimeOffsetNullable () + { + // Create the writer object. + StringBuilder stringBuilder = new StringBuilder (); + + DateTimeOffset? dto = new DateTimeOffset (2012, 05, 04, 02, 34, 00, new TimeSpan (-2, 0, 0));; + + DataContractSerializer ser = new DataContractSerializer (typeof (DateTimeOffset?)); + + using (var xw = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (new StringWriter (stringBuilder)))) + { + ser.WriteObject (xw, dto); + } + + string actualXml = stringBuilder.ToString (); + string expectedXml = "2012-05-04T04:34:00Z-120"; + + Assert.AreEqual (expectedXml, actualXml, "#1 Nullable DateTimeOffset serialization error"); + + using (var xr = XmlDictionaryReader.CreateDictionaryReader(XmlReader.Create (new StringReader (actualXml)))) + { + DateTimeOffset? actualDto = (DateTimeOffset?)ser.ReadObject (xr, true); + + Assert.AreEqual (dto, actualDto, "#2 Nullable DateTimeOffset deserialization error"); + } + } + } +} diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs new file mode 100644 index 00000000000..a753003e774 --- /dev/null +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs @@ -0,0 +1,170 @@ +// +// DataContractSerializerTest_DuplicateQName.cs +// +// Author: +// David Ferguson +// +// Copyright (C) 2012 Dell AppAssure http://www.appassure.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. +// +// +// This test code contains tests for the DataContractSerializer +// concerning duplicate Qualified Names for the object graph and known types +// +using System; +using System.IO; +using System.Runtime.Serialization; + +using NUnit.Framework; + +namespace MonoTests.System.Runtime.Serialization +{ + [TestFixture] + public class DataContractSerializerTest_DuplicateQName + { + [DataContract (Name="name", Namespace="http://somecompany.com/function/api/2010/05")] + [Serializable] + public class DataContractBase + { + public DataContractBase () + { + } + + public DataContractBase (string val) + { + BaseValue1 = val; + } + + [DataMember(Name="baseValue1", Order=1)] + public string BaseValue1 { get; set; } + + } + + [DataContract (Name="name", Namespace="http://somecompany.com/function/api/2010/05")] + [Serializable] + public class DataContract1 : DataContractBase + { + public DataContract1 () + { + } + + public DataContract1 (string val) : base (val) + { + } + } + + [DataContract(Name = "name", Namespace = "http://somecompany.com/function/api/2010/05")] + [Serializable] + public class DataContract2 + { + [DataMember] + public DataContract3 DataContract3 { get; set; } + } + + [DataContract(Name = "name", Namespace = "http://somecompany.com/function/api/2010/05")] + [Serializable] + public class DataContract3 + { + + } + + [DataContract(Name = "name", Namespace = "http://somecompany.com/function/api/2010/05")] + [Serializable] + public class DataContract4 + { + [DataMember(Name = "name")] + public double + Test1; + } + + [Test] + public void TestMultipleDataContractSameDataContractNameAndNamespace () + { + // DataContract1 derives from DataContractBase and they both have + // the same QName specified in their respective DataContractAttribute. + var serializer = new DataContractSerializer (typeof(DataContract1)); + var serializerBase = new DataContractSerializer (typeof(DataContractBase)); + + Assert.IsNotNull (serializer); + Assert.IsNotNull (serializerBase); + } + + [Test] + public void TestDataContractWithPropertyHavingSameQName () + { + // DataContract2 has a property of DataContract3. DataContract2 and + // DataContract3 both have the same QName specified in their + // respective DataContractAttribute. This was causing a failure due + // to the QName being saved in the SerializationMap twice. Bug 4794. + var serializer2 = new DataContractSerializer (typeof(DataContract2)); + var d = new DataContract2 (); + var ms = new MemoryStream (2048); + + Assert.IsNotNull (serializer2, "Failed to create the serializer for DataContract2"); + + serializer2.WriteObject (ms, d); + ms.Position = 0; + + var d2 = serializer2.ReadObject (ms) as DataContract2; + + Assert.IsNotNull (d2, "Failed to deserialize the data buffer into a DataContract2"); + } + + [Test] + public void TestDataContractWithPrimitiveHavingSameQName () + { + // This test verifies that a primitive with the same qname as the + // DataContract succeeds in serializing and deserializing + var serializer4 = new DataContractSerializer (typeof(DataContract4)); + + var d = new DataContract4 (); + var ms = new MemoryStream (2048); + + Assert.IsNotNull (serializer4, "Failed to create the serializer for DataContract4"); + + d.Test1 = 3.1416; + serializer4.WriteObject (ms, d); + ms.Position = 0; + + var d2 = serializer4.ReadObject (ms) as DataContract4; + + Assert.IsNotNull (d2, "Failed to deserialize the data buffer into a DataContract4"); + Assert.AreEqual (d2.Test1, 3.1416, "Rehydrated Test1 property did not match original"); + Assert.AreNotSame (d2, d, "The instances are the same and should not be"); + } + + [Test] + public void TestKnownTypes () + { + // The .NET behavior is that the KnownTypes collection is not populated unless you + // do so through the constructor. It even ignores attributes on the type indicating + // a known type. + var serializer = new DataContractSerializer (typeof(DataContract1)); + var serializerWithKnownType = new DataContractSerializer ( + typeof(DataContract2), + new [] { typeof(DataContract3) } + ); + + Assert.AreEqual (serializer.KnownTypes.Count, 0, "Expected an empty known type collection"); + Assert.AreEqual (serializerWithKnownType.KnownTypes.Count, 1, "Known count type did not match"); + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs index e8f27d46d14..86b435c7fe4 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs @@ -253,7 +253,7 @@ namespace Client.EvalServiceReference { namespace MonoTests.System.Runtime.Serialization { [TestFixture] - class SerializeNullableWithDictionaryTest + public class SerializeNullableWithDictionaryTest { [Test] diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XmlObjectSerializerTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XmlObjectSerializerTest.cs index 705233649cb..b494ff6512b 100755 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XmlObjectSerializerTest.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XmlObjectSerializerTest.cs @@ -1539,6 +1539,7 @@ namespace MonoTests.System.Runtime.Serialization var ds = new DataContractSerializer (typeof (DateTimeOffset)); var sw = new StringWriter (); string xml = "2011-03-01T02:05:06.078Z120".Replace ('\'', '"'); + var v = new DateTimeOffset (new DateTime (2011, 3, 1, 4, 5, 6, 78), TimeSpan.FromMinutes (120)); using (var xw = XmlWriter.Create (sw, settings)) { ds.WriteObject (xw, v); @@ -1546,6 +1547,21 @@ namespace MonoTests.System.Runtime.Serialization Assert.AreEqual (xml, sw.ToString (), "#1"); Assert.AreEqual (v, ds.ReadObject (XmlReader.Create (new StringReader (sw.ToString ()))), "#2"); } + + [Test] + public void DateTimeOffsetNullableSerialization () + { + var ds = new DataContractSerializer (typeof (DateTimeOffset?)); + var sw = new StringWriter (); + string xml = "2012-05-04T00:34:00Z120"; + + var v = new DateTimeOffset (new DateTime (2012, 05, 04, 02, 34, 0), TimeSpan.FromMinutes (120)); + using (var xw = XmlWriter.Create (sw, settings)) { + ds.WriteObject (xw, v); + } + Assert.AreEqual (xml, sw.ToString (), "#1"); + Assert.AreEqual (v, ds.ReadObject (XmlReader.Create (new StringReader (sw.ToString ()))), "#2"); + } [Test] public void XmlDocumentSupport () diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlMtomDictionaryWriterTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlMtomDictionaryWriterTest.cs index 6f32f69e631..3cee19a44e8 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlMtomDictionaryWriterTest.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlMtomDictionaryWriterTest.cs @@ -80,7 +80,7 @@ Content-Type: application/xop+xml;charset=utf-8;type=""sTaRt"" 666 --myboundary-- -".Replace ("\n", "\r\n").Replace (" \r\n", " \n"); +".Replace ("\n", "\r\n"); } class MyStreamProvider : IStreamProvider diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs index c0aaaa2e76f..8293e1d4f99 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs @@ -38,10 +38,7 @@ using System.Security.Policy; using System.Net; using System.Text; using System.Xml; - -#if NET_2_0 using System.Security.Cryptography.X509Certificates; -#endif namespace System.Security.Cryptography.Xml { @@ -56,7 +53,6 @@ namespace System.Security.Cryptography.Xml { public const string XmlDsigRSASHA1Url = XmlDsigNamespaceUrl + "rsa-sha1"; public const string XmlDsigSHA1Url = XmlDsigNamespaceUrl + "sha1"; -#if NET_2_0 public const string XmlDecryptionTransformUrl = "http://www.w3.org/2002/07/decrypt#XML"; public const string XmlDsigBase64TransformUrl = XmlDsigNamespaceUrl + "base64"; public const string XmlDsigC14NTransformUrl = XmlDsigCanonicalizationUrl; @@ -69,7 +65,6 @@ namespace System.Security.Cryptography.Xml { public const string XmlLicenseTransformUrl = "urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform"; private EncryptedXml encryptedXml; -#endif protected Signature m_signature; private AsymmetricAlgorithm key; @@ -79,15 +74,9 @@ namespace System.Security.Cryptography.Xml { private XmlElement signatureElement; private Hashtable hashes; // FIXME: enable it after CAS implementation -#if false //NET_1_1 - private XmlResolver xmlResolver = new XmlSecureResolver (new XmlUrlResolver (), new Evidence ()); -#else private XmlResolver xmlResolver = new XmlUrlResolver (); -#endif private ArrayList manifests; -#if NET_2_0 private IEnumerator _x509Enumerator; -#endif private static readonly char [] whitespaceChars = new char [] {' ', '\r', '\n', '\t'}; @@ -113,20 +102,16 @@ namespace System.Security.Cryptography.Xml { envdoc.LoadXml (elem.OuterXml); } -#if NET_2_0 [ComVisible (false)] public EncryptedXml EncryptedXml { get { return encryptedXml; } set { encryptedXml = value; } } -#endif public KeyInfo KeyInfo { get { -#if NET_2_0 if (m_signature.KeyInfo == null) m_signature.KeyInfo = new KeyInfo (); -#endif return m_signature.KeyInfo; } set { m_signature.KeyInfo = value; } @@ -170,10 +155,8 @@ namespace System.Security.Cryptography.Xml { public void AddReference (Reference reference) { -#if NET_2_0 if (reference == null) throw new ArgumentNullException ("reference"); -#endif m_signature.SignedInfo.AddReference (reference); } @@ -183,9 +166,7 @@ namespace System.Security.Cryptography.Xml { // not affect to the input itself. if (t is XmlDsigXPathTransform || t is XmlDsigEnvelopedSignatureTransform -#if NET_2_0 || t is XmlDecryptionTransform -#endif ) input = (XmlDocument) input.Clone (); @@ -503,13 +484,8 @@ namespace System.Security.Cryptography.Xml { if (!CheckSignatureWithKey (key)) return null; } else { -#if NET_2_0 if (Signature.KeyInfo == null) return null; -#else - if (Signature.KeyInfo == null) - throw new CryptographicException ("At least one KeyInfo is required."); -#endif // no supplied key, iterates all KeyInfo while ((key = GetPublicKey ()) != null) { if (CheckSignatureWithKey (key)) { @@ -633,14 +609,12 @@ namespace System.Security.Cryptography.Xml { return false; } -#if NET_2_0 [MonoTODO] [ComVisible (false)] public bool CheckSignature (X509Certificate2 certificate, bool verifySignatureOnly) { throw new NotImplementedException (); } -#endif public bool CheckSignatureReturningKey (out AsymmetricAlgorithm signingKey) { @@ -689,7 +663,6 @@ namespace System.Security.Cryptography.Xml { if (macAlg is HMACSHA1) { method = XmlDsigHMACSHA1Url; -#if NET_2_0 } else if (macAlg is HMACSHA256) { method = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256"; } else if (macAlg is HMACSHA384) { @@ -698,7 +671,6 @@ namespace System.Security.Cryptography.Xml { method = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha512"; } else if (macAlg is HMACRIPEMD160) { method = "http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160"; -#endif } if (method == null) @@ -734,7 +706,7 @@ namespace System.Security.Cryptography.Xml { pkEnumerator = m_signature.KeyInfo.GetEnumerator (); } -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP if (_x509Enumerator != null) { if (_x509Enumerator.MoveNext ()) { X509Certificate cert = (X509Certificate) _x509Enumerator.Current; @@ -758,7 +730,7 @@ namespace System.Security.Cryptography.Xml { return key; } -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP if (kic is KeyInfoX509Data) { _x509Enumerator = ((KeyInfoX509Data) kic).Certificates.GetEnumerator (); if (_x509Enumerator.MoveNext ()) { @@ -783,7 +755,6 @@ namespace System.Security.Cryptography.Xml { signatureElement = value; m_signature.LoadXml (value); -#if NET_2_0 // Need to give the EncryptedXml object to the // XmlDecryptionTransform to give it a fighting // chance at decrypting the document. @@ -793,14 +764,11 @@ namespace System.Security.Cryptography.Xml { ((XmlDecryptionTransform) t).EncryptedXml = EncryptedXml; } } -#endif } -#if NET_1_1 [ComVisible (false)] public XmlResolver Resolver { set { xmlResolver = value; } } -#endif } } diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs index bfa9b6b7630..80c8923e99d 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs @@ -45,11 +45,7 @@ namespace System.Security.Cryptography.Xml { private XmlResolver xmlResolver; private Hashtable propagated_namespaces = new Hashtable (); -#if NET_2_0 protected Transform () -#else - public Transform () -#endif { if (SecurityManager.SecurityEnabled) { xmlResolver = new XmlSecureResolver (new XmlUrlResolver (), (Evidence) new Evidence ()); @@ -73,43 +69,32 @@ namespace System.Security.Cryptography.Xml { get; } -#if NET_1_1 [ComVisible(false)] public XmlResolver Resolver { set { xmlResolver = value; } } -#endif -#if NET_2_0 [MonoTODO] [ComVisible (false)] public XmlElement Context { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } -#endif [ComVisible (false)] -#if NET_2_0 - public -#else - internal -#endif - Hashtable PropagatedNamespaces { + public Hashtable PropagatedNamespaces { get { return propagated_namespaces; } } #endregion // Properties #region Methods -#if NET_2_0 [ComVisible (false)] public virtual byte[] GetDigestedOutput (HashAlgorithm hash) { // no null check, MS throws a NullReferenceException here return hash.ComputeHash ((Stream) GetOutput (typeof (Stream))); } -#endif protected abstract XmlNodeList GetInnerXml (); diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs index 935980a7557..1a78700c57b 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs @@ -121,9 +121,7 @@ namespace System.Security.Cryptography.Xml { if (stream != null) { XmlDocument doc = new XmlDocument (); doc.PreserveWhitespace = true; // REALLY IMPORTANT -#if NET_1_1 doc.XmlResolver = GetResolver (); -#endif doc.Load (new XmlSignatureStreamReader (new StreamReader (stream))); // doc.Load ((Stream) obj); s = canonicalizer.Canonicalize (doc); diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs index 137d5c269b7..80f3c0db0c3 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs @@ -95,9 +95,7 @@ namespace System.Security.Cryptography.Xml { if (inputObj is Stream) { doc = new XmlDocument (); doc.PreserveWhitespace = true; -#if NET_1_1 doc.XmlResolver = GetResolver (); -#endif doc.Load (new XmlSignatureStreamReader ( new StreamReader (inputObj as Stream))); return GetOutputFromNode (doc, GetNamespaceManager (doc), true); diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs index c8c777df804..b8a432c58d6 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs @@ -140,9 +140,7 @@ namespace System.Security.Cryptography.Xml { if (stream != null) { XmlDocument doc = new XmlDocument (); doc.PreserveWhitespace = true; // REALLY IMPORTANT -#if NET_1_1 doc.XmlResolver = GetResolver (); -#endif doc.Load (new XmlSignatureStreamReader (new StreamReader (stream))); // doc.Load ((Stream) obj); s = canonicalizer.Canonicalize (doc); diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs index 185e8b3dcd4..654385ae142 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs @@ -190,9 +190,7 @@ namespace System.Security.Cryptography.Xml if (obj is Stream) { doc = new XmlDocument (); doc.PreserveWhitespace = true; -#if NET_1_1 doc.XmlResolver = GetResolver (); -#endif doc.Load (new XmlSignatureStreamReader ( new StreamReader ((Stream) obj))); } @@ -201,9 +199,7 @@ namespace System.Security.Cryptography.Xml } else if (obj is XmlNodeList) { doc = new XmlDocument (); -#if NET_1_1 doc.XmlResolver = GetResolver (); -#endif foreach (XmlNode xn in (obj as XmlNodeList)) { XmlNode importedNode = doc.ImportNode (xn, true); doc.AppendChild (importedNode); diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs index 2bf7e416dde..d039bf16730 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs @@ -87,37 +87,24 @@ namespace System.Security.Cryptography.Xml public override object GetOutput () { -#if NET_2_0 if (xnl == null) throw new ArgumentNullException ("LoadInnerXml before transformation."); -#endif + XmlResolver resolver = GetResolver (); XslTransform xsl = new XslTransform (); XmlDocument doc = new XmlDocument (); -#if NET_1_1 doc.XmlResolver = resolver; -#endif foreach (XmlNode n in xnl) doc.AppendChild (doc.ImportNode (n, true)); -#if NET_1_1 xsl.Load (doc, resolver); -#else - xsl.Load (doc); -#endif if (inputDoc == null) -#if NET_2_0 throw new ArgumentNullException ("LoadInput before transformation."); -#else - throw new NullReferenceException ("LoadInput before transformation."); -#endif MemoryStream stream = new MemoryStream (); // only possible output: Stream -#if NET_1_1 xsl.XmlResolver = resolver; -#endif xsl.Transform (inputDoc, null, stream); stream.Seek (0, SeekOrigin.Begin); @@ -144,9 +131,7 @@ namespace System.Security.Cryptography.Xml Stream s = (obj as Stream); if (s != null) { inputDoc = new XmlDocument (); -#if NET_1_1 inputDoc.XmlResolver = GetResolver (); -#endif // inputDoc.Load (obj as Stream); inputDoc.Load (new XmlSignatureStreamReader (new StreamReader (s))); return; @@ -161,9 +146,7 @@ namespace System.Security.Cryptography.Xml XmlNodeList nl = (obj as XmlNodeList); if (nl != null) { inputDoc = new XmlDocument (); -#if NET_1_1 inputDoc.XmlResolver = GetResolver (); -#endif for (int i = 0; i < nl.Count; i++) inputDoc.AppendChild (inputDoc.ImportNode (nl [i], true)); } diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs index 702e566220f..4cc6e172925 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Xml; namespace System.Security.Cryptography.Xml { @@ -93,8 +91,6 @@ namespace System.Security.Cryptography.Xml { [MonoTODO] public override void LoadInput (object obj) { - if (obj != typeof (XmlDocument)) - throw new ArgumentException ("obj"); if (_decryptor == null) throw new CryptographicException (Locale.GetText ("missing decryptor")); // TODO: check for element @@ -102,5 +98,3 @@ namespace System.Security.Cryptography.Xml { } } } - -#endif diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignature.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignature.cs index aba127bdf82..6e48d2b6f48 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignature.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignature.cs @@ -47,9 +47,7 @@ namespace System.Security.Cryptography.Xml { public const string DigestMethod = "DigestMethod"; public const string DigestValue = "DigestValue"; public const string DSAKeyValue = "DSAKeyValue"; -#if NET_2_0 public const string EncryptedKey = "EncryptedKey"; -#endif public const string HMACOutputLength = "HMACOutputLength"; public const string KeyInfo = "KeyInfo"; public const string KeyName = "KeyName"; @@ -57,12 +55,7 @@ namespace System.Security.Cryptography.Xml { public const string Manifest = "Manifest"; public const string Object = "Object"; public const string Reference = "Reference"; -#if NET_1_0 - // RetrievalMethod vs RetrievalElement -> BUG in MS Framework 1.0 - public const string RetrievalMethod = "RetrievalElement"; -#else public const string RetrievalMethod = "RetrievalMethod"; -#endif public const string RSAKeyValue = "RSAKeyValue"; public const string Signature = "Signature"; public const string SignatureMethod = "SignatureMethod"; diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/KeyInfoRetrievalMethodTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/KeyInfoRetrievalMethodTest.cs index 589cdbc5204..140bdc7b589 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/KeyInfoRetrievalMethodTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/KeyInfoRetrievalMethodTest.cs @@ -86,15 +86,7 @@ namespace MonoTests.System.Security.Cryptography.Xml { KeyInfoRetrievalMethod uri1 = new KeyInfoRetrievalMethod (); // no exception is thrown uri1.LoadXml (doc.DocumentElement); -#if NET_2_0 AssertCrypto.AssertXmlEquals ("invalid", "", (uri1.GetXml ().OuterXml)); -#elif NET_1_1 - // note that URI="" is present (unlike a empty Uri) - Assert.AreEqual ("", (uri1.GetXml ().OuterXml), "invalid"); -#else - // Fx 1.0 misnamed the tag name - Assert.AreEqual ("", (uri1.GetXml ().OuterXml), "invalid"); -#endif } } } diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs index 8ddba56c7e1..816df3e9809 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs @@ -153,19 +153,12 @@ namespace MonoTests.System.Security.Cryptography.Xml { transform.LoadInput (doc); Stream s = (Stream) transform.GetOutput (); string output = Stream2String (s); -#if NET_1_1 Assert.AreEqual (c14xml3, output, "XmlDocument"); -#else - // .NET 1.0 keeps the \r\n (0x0D, 0x0A) - bug - Assert.AreEqual (c14xml1, output, "XmlDocument"); -#endif } [Test] -#if NET_2_0 [Category ("NotDotNet")] // see LoadInputAsXmlNodeList2 description -#endif public void LoadInputAsXmlNodeList () { XmlDocument doc = GetDoc (); @@ -205,11 +198,7 @@ namespace MonoTests.System.Security.Cryptography.Xml { } [Test] -#if NET_2_0 [ExpectedException (typeof (ArgumentException))] -#else - // LAMESPEC: input MUST be one of InputType - but no exception is thrown (not documented) -#endif public void LoadInputWithUnsupportedType () { byte[] bad = { 0xBA, 0xD }; diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigExcC14NTransformTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigExcC14NTransformTest.cs index bd70d9b2b60..50fb9ba480f 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigExcC14NTransformTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigExcC14NTransformTest.cs @@ -248,19 +248,12 @@ namespace MonoTests.System.Security.Cryptography.Xml { transform.LoadInput (doc); Stream s = (Stream) transform.GetOutput (); string output = Stream2String (s); -#if NET_1_1 Assert.AreEqual (c14xml3, output, "XmlDocument"); -#else - // .NET 1.0 keeps the \r\n (0x0D, 0x0A) - bug - Assert.AreEqual (c14xml1, output, "XmlDocument"); -#endif } [Test] -#if NET_2_0 [Category ("NotDotNet")] // see LoadInputAsXmlNodeList2 description -#endif public void LoadInputAsXmlNodeList () { XmlDocument doc = GetDoc (); diff --git a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/AnnouncementClientTest.cs b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/AnnouncementClientTest.cs index c1aeaf70f0e..4b2c4b1f25f 100644 --- a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/AnnouncementClientTest.cs +++ b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/AnnouncementClientTest.cs @@ -54,6 +54,7 @@ namespace MonoTests.System.ServiceModel.Discovery [Test] [ExpectedException (typeof (InvalidOperationException))] + [Category ("NotWorking")] public void AnnonceOnlineOfflineNoEndpointAddress () { var ac = new AnnouncementClient (new AnnouncementEndpoint () { Binding = new BasicHttpBinding () }); @@ -67,6 +68,7 @@ namespace MonoTests.System.ServiceModel.Discovery [Test] [ExpectedException (typeof (InvalidOperationException))] + [Category ("NotWorking")] public void AnnonceOnlineOfflineNoBinding () { var ac = new AnnouncementClient (new AnnouncementEndpoint () { Address = new EndpointAddress ("http://localhost:37564")}); @@ -91,6 +93,7 @@ namespace MonoTests.System.ServiceModel.Discovery [Test] [ExpectedException (typeof (ArgumentException))] + [Category ("NotWorking")] public void AnnonceOnlineOfflineAddressSchemeMismatch2 () { var ac = new AnnouncementClient (new AnnouncementEndpoint () { Binding = new BasicHttpBinding (), Address = new EndpointAddress ("soap.udp://localhost:37564")}); @@ -104,6 +107,7 @@ namespace MonoTests.System.ServiceModel.Discovery [Test] [ExpectedException (typeof (InvalidOperationException))] + [Category ("NotWorking")] public void AnnonceOnlineOfflineHttpMessageVersionMismatch () { var ac = new AnnouncementClient (new AnnouncementEndpoint () { Binding = new BasicHttpBinding () { SendTimeout = TimeSpan.FromSeconds (10), ReceiveTimeout = TimeSpan.FromSeconds (10) }, Address = http_address }); @@ -119,6 +123,7 @@ namespace MonoTests.System.ServiceModel.Discovery [Test] [ExpectedException (typeof (EndpointNotFoundException))] + [Category ("NotWorking")] public void AnnonceOnlineOfflineHttpWSA10 () { var binding = new CustomBinding (new HttpTransportBindingElement ()) { SendTimeout = TimeSpan.FromSeconds (10), ReceiveTimeout = TimeSpan.FromSeconds (10) }; diff --git a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/EndpointDiscoveryBehaviorTest.cs b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/EndpointDiscoveryBehaviorTest.cs index 3327e99b6c0..82edf8f1787 100644 --- a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/EndpointDiscoveryBehaviorTest.cs +++ b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/EndpointDiscoveryBehaviorTest.cs @@ -58,6 +58,7 @@ namespace MonoTests.System.ServiceModel.Discovery } [Test] + [Category ("NotWorking")] public void Use2 () { // This time with ServiceDiscoveryBehavior. diff --git a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/IntegratedDiscoveryTest.cs b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/IntegratedDiscoveryTest.cs index a7f6a87df48..dd5a5121c6a 100644 --- a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/IntegratedDiscoveryTest.cs +++ b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/IntegratedDiscoveryTest.cs @@ -52,6 +52,7 @@ namespace MonoTests.System.ServiceModel.Discovery } [Test] + [Category ("NotWorking")] public void UseCase1 () { RunCodeUnderDiscoveryHost1 (new Uri ("http://localhost:37564"), new Uri ("http://localhost:4949"), new Uri ("http://localhost:4989"), UseCase1Core); @@ -113,6 +114,7 @@ namespace MonoTests.System.ServiceModel.Discovery } [Test] // Announcement: UDP, Discovery: HTTP + [Category ("NotWorking")] public void UseCase2 () { RunCodeUnderDiscoveryHost2 (new Uri ("http://localhost:37564"), new Uri ("http://localhost:4949"), UseCase2Core); @@ -170,6 +172,7 @@ namespace MonoTests.System.ServiceModel.Discovery } [Test] + [Category ("NotWorking")] public void UseCase3 () { RunCodeUnderDiscoveryHost3 (new Uri ("http://localhost:37564"), new Uri ("http://localhost:4989"), UseCase3Core); diff --git a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/ServiceDiscoveryBehaviorTest.cs b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/ServiceDiscoveryBehaviorTest.cs index 0707aa054b4..e554da7822d 100644 --- a/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/ServiceDiscoveryBehaviorTest.cs +++ b/mcs/class/System.ServiceModel.Discovery/Test/System.ServiceModel.Discovery/ServiceDiscoveryBehaviorTest.cs @@ -75,6 +75,7 @@ namespace MonoTests.System.ServiceModel.Discovery } [Test] + [Category ("NotWorking")] public void Use2 () { var b = new ServiceDiscoveryBehavior (); @@ -119,6 +120,7 @@ namespace MonoTests.System.ServiceModel.Discovery } [Test] + [Category ("NotWorking")] public void UseHttpBinding () { var ahost = new ServiceHost (typeof (AnnouncementService)); diff --git a/mcs/class/System.ServiceModel.Syndication/Assembly/AssemblyInfo.cs b/mcs/class/System.ServiceModel.Syndication/Assembly/AssemblyInfo.cs index ab065ca76e8..c7c676fb7bf 100644 --- a/mcs/class/System.ServiceModel.Syndication/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.ServiceModel.Syndication/Assembly/AssemblyInfo.cs @@ -64,6 +64,3 @@ using System.Runtime.InteropServices; [assembly: AllowPartiallyTrustedCallers] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -// Extension attribute should be added by compiler diff --git a/mcs/class/System.ServiceModel.Web.Extensions/Assembly/AssemblyInfo.cs b/mcs/class/System.ServiceModel.Web.Extensions/Assembly/AssemblyInfo.cs index ee63d16b193..0bd1bd0e04f 100644 --- a/mcs/class/System.ServiceModel.Web.Extensions/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.ServiceModel.Web.Extensions/Assembly/AssemblyInfo.cs @@ -64,6 +64,3 @@ using System.Runtime.InteropServices; [assembly: AllowPartiallyTrustedCallers] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -// Extension attribute should be added by compiler diff --git a/mcs/class/System.ServiceModel.Web/Assembly/AssemblyInfo.cs b/mcs/class/System.ServiceModel.Web/Assembly/AssemblyInfo.cs index 332713273ce..a974b19de94 100644 --- a/mcs/class/System.ServiceModel.Web/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.ServiceModel.Web/Assembly/AssemblyInfo.cs @@ -69,5 +69,4 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo ("dummy-System.Json, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")] #endif -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.ServiceModel.Web/System/UriTemplate.cs b/mcs/class/System.ServiceModel.Web/System/UriTemplate.cs index c1c0018ceae..9a1d2c5e502 100644 --- a/mcs/class/System.ServiceModel.Web/System/UriTemplate.cs +++ b/mcs/class/System.ServiceModel.Web/System/UriTemplate.cs @@ -250,11 +250,17 @@ namespace System var us = baseAddress.LocalPath; if (us [us.Length - 1] != '/') - baseAddress = new Uri (baseAddress.GetComponents (UriComponents.SchemeAndServer | UriComponents.Path, UriFormat.Unescaped) + '/' + baseAddress.Query, baseAddress.IsAbsoluteUri ? UriKind.Absolute : UriKind.RelativeOrAbsolute); + baseAddress = new Uri ( + baseAddress.GetComponents (UriComponents.SchemeAndServer | UriComponents.Path, UriFormat.UriEscaped) + '/' + baseAddress.Query, + baseAddress.IsAbsoluteUri ? UriKind.Absolute : UriKind.RelativeOrAbsolute + ); if (IgnoreTrailingSlash) { us = candidate.LocalPath; if (us.Length > 0 && us [us.Length - 1] != '/') - candidate = new Uri(candidate.GetComponents (UriComponents.SchemeAndServer | UriComponents.Path, UriFormat.Unescaped) + '/' + candidate.Query, candidate.IsAbsoluteUri ? UriKind.Absolute : UriKind.RelativeOrAbsolute); + candidate = new Uri ( + candidate.GetComponents (UriComponents.SchemeAndServer | UriComponents.Path, UriFormat.UriEscaped) + '/' + candidate.Query, + candidate.IsAbsoluteUri ? UriKind.Absolute : UriKind.RelativeOrAbsolute + ); } int i = 0, c = 0; @@ -264,7 +270,11 @@ namespace System m.RequestUri = candidate; var vc = m.BoundVariables; - string cp = Uri.UnescapeDataString (baseAddress.MakeRelativeUri (new Uri (baseAddress, candidate.GetComponents (UriComponents.PathAndQuery, UriFormat.Unescaped))).ToString ()); + string cp = baseAddress.MakeRelativeUri (new Uri ( + baseAddress, + candidate.GetComponents (UriComponents.PathAndQuery, UriFormat.UriEscaped) + )) + .ToString (); if (IgnoreTrailingSlash && cp [cp.Length - 1] == '/') cp = cp.Substring (0, cp.Length - 1); @@ -279,7 +289,7 @@ namespace System foreach (string name in path) { if (name == wild_path_name) { - vc [name] = cp.Substring (c); // all remaining paths. + vc [name] = Uri.UnescapeDataString (cp.Substring (c)); // all remaining paths. continue; } int n = StringIndexOf (template, '{' + name + '}', i); @@ -291,10 +301,11 @@ namespace System if (ce < 0) ce = cp.Length; string value = cp.Substring (c, ce - c); + string unescapedVaule = Uri.UnescapeDataString (value); if (value.Length == 0) return null; // empty => mismatch - vc [name] = value; - m.RelativePathSegments.Add (value); + vc [name] = unescapedVaule; + m.RelativePathSegments.Add (unescapedVaule); c += value.Length; } int tEnd = template.IndexOf ('?'); diff --git a/mcs/class/System.ServiceModel.Web/Test/System/UriTemplateTest.cs b/mcs/class/System.ServiceModel.Web/Test/System/UriTemplateTest.cs index 8455ce59340..de260c1b1af 100644 --- a/mcs/class/System.ServiceModel.Web/Test/System/UriTemplateTest.cs +++ b/mcs/class/System.ServiceModel.Web/Test/System/UriTemplateTest.cs @@ -502,5 +502,19 @@ namespace MonoTests.System Assert.IsNotNull (match, "#1"); Assert.AreEqual ("something", match.BoundVariables ["path"], "#2"); } + + [Test] + public void EscapedUriCandidate () + { + var candidateUri = new Uri (@"https://somehost:12345/path1/path2/path3/endprefix/tpath1/guid1/tpath2/~|~~|~%3F~|~Path{guid2}~|~/tpath3"); + var matchUri = new Uri (candidateUri.Scheme + "://" + candidateUri.Host + ":" + candidateUri.Port + @"/path1/path2/path3/endprefix"); + + var template = new UriTemplate (@"tpath1/{guid}/tpath2/{encodedGuidString}/tpath3"); + var match = template.Match (matchUri, candidateUri); + + Assert.IsNotNull (match); + Assert.That (match.BoundVariables ["GUID"] == "guid1"); + Assert.That (match.BoundVariables ["ENCODEDGUIDSTRING"] == "~|~~|~?~|~Path{guid2}~|~"); + } } } diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescription.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescription.cs index c2895900379..fbc6a39dd6b 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescription.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescription.cs @@ -40,6 +40,7 @@ using System.ServiceModel.Dispatcher; namespace System.ServiceModel.Description { +#if !NET_4_5 internal static class Extensions { public static T GetCustomAttribute (this MemberInfo mi, bool inherit) where T : Attribute @@ -56,6 +57,7 @@ namespace System.ServiceModel.Description return null; } } +#endif [DebuggerDisplay ("Name={name}, Namespace={ns}, ContractType={contractType}")] public class ContractDescription diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/Logger.cs b/mcs/class/System.ServiceModel/System.ServiceModel/Logger.cs index 3f055c77ed0..993541c3bc0 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel/Logger.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel/Logger.cs @@ -71,7 +71,7 @@ namespace System.ServiceModel const string xmlns = "http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace"; static MessageLoggingSettings settings = new MessageLoggingSettings (); static int event_id; - static TextWriter log_writer = TextWriter.Null; + static TextWriter log_writer; static XmlWriter xml_writer; #if !NET_2_1 static readonly TraceSource source = new TraceSource ("System.ServiceModel"); @@ -102,7 +102,9 @@ namespace System.ServiceModel break; #endif } - xml_writer = XmlWriter.Create (log_writer, new XmlWriterSettings () { OmitXmlDeclaration = true }); + + if (log_writer != null) + xml_writer = XmlWriter.Create (log_writer, new XmlWriterSettings () { OmitXmlDeclaration = true }); #if !NET_2_1 message_source.Switch.Level = SourceLevels.Information; @@ -140,19 +142,21 @@ namespace System.ServiceModel static void Log (TraceEventType eventType, string message, params object [] args) { - lock (log_writer){ - event_id++; + if (log_writer != null) { + lock (log_writer){ + event_id++; #if NET_2_1 - log_writer.Write ("[{0}] ", event_id); + log_writer.Write ("[{0}] ", event_id); #endif - TraceCore (TraceEventType.Information, event_id, - false, Guid.Empty, // FIXME - message, args); - log_writer.WriteLine (message, args); - log_writer.Flush (); + TraceCore (TraceEventType.Information, event_id, + false, Guid.Empty, // FIXME + message, args); + log_writer.WriteLine (message, args); + log_writer.Flush (); #if !NET_2_1 - source.TraceEvent (eventType, event_id, message, args); + source.TraceEvent (eventType, event_id, message, args); #endif + } } } @@ -164,46 +168,50 @@ namespace System.ServiceModel public static void LogMessage (MessageLogSourceKind sourceKind, ref Message msg, long maxMessageSize) { - if (maxMessageSize > int.MaxValue) - throw new ArgumentOutOfRangeException ("maxMessageSize"); - var mb = msg.CreateBufferedCopy ((int) maxMessageSize); - msg = mb.CreateMessage (); - LogMessage (new MessageLogTraceRecord (sourceKind, msg.GetType (), mb)); + if (log_writer != null) { + if (maxMessageSize > int.MaxValue) + throw new ArgumentOutOfRangeException ("maxMessageSize"); + var mb = msg.CreateBufferedCopy ((int) maxMessageSize); + msg = mb.CreateMessage (); + LogMessage (new MessageLogTraceRecord (sourceKind, msg.GetType (), mb)); + } } public static void LogMessage (MessageLogTraceRecord log) { - var sw = new StringWriter (); + if (log_writer != null) { + var sw = new StringWriter (); #if NET_2_1 - var xw = XmlWriter.Create (sw, xws); + var xw = XmlWriter.Create (sw, xws); #else - var doc = new XmlDocument (); - var xw = doc.CreateNavigator ().AppendChild (); + var doc = new XmlDocument (); + var xw = doc.CreateNavigator ().AppendChild (); #endif - xw.WriteStartElement ("MessageLogTraceRecord", xmlns); - xw.WriteStartAttribute ("Time"); - xw.WriteValue (log.Time); - xw.WriteEndAttribute (); - xw.WriteAttributeString ("Source", log.Source.ToString ()); - xw.WriteAttributeString ("Type", log.Type.FullName); - var msg = log.Message.CreateMessage (); - if (!msg.IsEmpty) - msg.WriteMessage (xw); - xw.WriteEndElement (); - xw.Close (); + xw.WriteStartElement ("MessageLogTraceRecord", xmlns); + xw.WriteStartAttribute ("Time"); + xw.WriteValue (log.Time); + xw.WriteEndAttribute (); + xw.WriteAttributeString ("Source", log.Source.ToString ()); + xw.WriteAttributeString ("Type", log.Type.FullName); + var msg = log.Message.CreateMessage (); + if (!msg.IsEmpty) + msg.WriteMessage (xw); + xw.WriteEndElement (); + xw.Close (); - event_id++; - lock (log_writer){ + event_id++; + lock (log_writer){ #if NET_2_1 - log_writer.Write ("[{0}] ", event_id); + log_writer.Write ("[{0}] ", event_id); - TraceCore (TraceEventType.Information, event_id, /*FIXME*/false, /*FIXME*/Guid.Empty, sw); + TraceCore (TraceEventType.Information, event_id, /*FIXME*/false, /*FIXME*/Guid.Empty, sw); #else - TraceCore (TraceEventType.Information, event_id, /*FIXME*/false, /*FIXME*/Guid.Empty, doc.CreateNavigator ()); + TraceCore (TraceEventType.Information, event_id, /*FIXME*/false, /*FIXME*/Guid.Empty, doc.CreateNavigator ()); - message_source.TraceData (TraceEventType.Information, event_id, doc.CreateNavigator ()); + message_source.TraceData (TraceEventType.Information, event_id, doc.CreateNavigator ()); #endif - log_writer.Flush (); + log_writer.Flush (); + } } } diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs index 712c65d8c24..3655b417777 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs @@ -43,6 +43,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher public class Bug652331_2Test { [Test] + [Category ("NotWorking")] public void Bug652331_3 () { // Init service diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostBaseTest.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostBaseTest.cs index ac8ec625618..a5684e24b5f 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostBaseTest.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostBaseTest.cs @@ -324,12 +324,14 @@ namespace MonoTests.System.ServiceModel } [Test] + [Category ("NotWorking")] // Timeouts randomly #5813 public void RunDestinationUnreachableTest () { RunDestinationUnreachableTest ("BasicHttp", new BasicHttpBinding ()); } [Test] + [Category ("NotWorking")] // Timeouts randomly #5813 public void RunDestinationUnreachableTest2 () { RunDestinationUnreachableTest ("CustomSoap12", new CustomBinding (new HttpTransportBindingElement ())); diff --git a/mcs/class/System.ServiceProcess/Assembly/AssemblyInfo.cs b/mcs/class/System.ServiceProcess/Assembly/AssemblyInfo.cs index a059752f8df..2e5c2d833e8 100644 --- a/mcs/class/System.ServiceProcess/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.ServiceProcess/Assembly/AssemblyInfo.cs @@ -56,11 +56,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -#elif (NET_1_1 || NET_1_0) - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow.dll.sources b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow.dll.sources index 7b6681155a0..71e9b7fc6d8 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow.dll.sources +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow.dll.sources @@ -2,7 +2,6 @@ ../../build/common/Locale.cs ../../build/common/MonoTODOAttribute.cs Assembly/AssemblyInfo.cs -System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs System.Threading.Tasks.Dataflow/ExecutingMessageBox.cs System.Threading.Tasks.Dataflow/DataflowBlockOptions.cs System.Threading.Tasks.Dataflow/DataflowMessageHeader.cs diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources index f3d2da7fc4e..522170cfcd0 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources @@ -1,4 +1,3 @@ -System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs System.Threading.Tasks.Dataflow/DataflowMessageHeaderTest.cs System.Threading.Tasks.Dataflow/CompletionHelperTest.cs ../System.Threading.Tasks.Dataflow/CompletionHelper.cs diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs deleted file mode 100644 index 5127796cafe..00000000000 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs +++ /dev/null @@ -1,218 +0,0 @@ -// ConcurrentExclusiveSchedulerPair.cs -// -// Copyright (c) 2011 Jérémie "garuma" Laval -// -// 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.Threading; -using System.Collections.Generic; -using System.Collections.Concurrent; - -namespace System.Threading.Tasks -{ - public class ConcurrentExclusiveSchedulerPair : IDisposable - { - readonly int maxConcurrencyLevel; - readonly int maxItemsPerTask; - - readonly TaskScheduler target; - readonly TaskFactory factory; - readonly Action taskHandler; - - readonly ConcurrentQueue concurrentTasks = new ConcurrentQueue (); - readonly ConcurrentQueue exclusiveTasks = new ConcurrentQueue (); - - readonly ReaderWriterLockSlim rwl = new ReaderWriterLockSlim (); - readonly TaskCompletionSource completion = new TaskCompletionSource (); - readonly InnerTaskScheduler concurrent; - readonly InnerTaskScheduler exclusive; - - int numTask; - - class InnerTaskScheduler : TaskScheduler - { - readonly ConcurrentExclusiveSchedulerPair scheduler; - readonly ConcurrentQueue queue; - - public InnerTaskScheduler (ConcurrentExclusiveSchedulerPair scheduler, - ConcurrentQueue queue) - { - this.scheduler = scheduler; - this.queue = queue; - } - - public override int MaximumConcurrencyLevel { - get { - return scheduler.maxConcurrencyLevel; - } - } - - protected override void QueueTask (Task t) - { - scheduler.DoQueue (t, queue); - } - - protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued) - { - if (task.Status != TaskStatus.Created) - return false; - - task.RunSynchronously (scheduler.target); - return true; - } - - public void Execute (Task t) - { - TryExecuteTask (t); - } - - [MonoTODO ("Only useful for debugger support")] - protected override IEnumerable GetScheduledTasks () - { - throw new NotImplementedException (); - } - } - - public ConcurrentExclusiveSchedulerPair () : this (TaskScheduler.Current) - { - } - - public ConcurrentExclusiveSchedulerPair (TaskScheduler taskScheduler) : this (taskScheduler, taskScheduler.MaximumConcurrencyLevel) - { - } - - public ConcurrentExclusiveSchedulerPair (TaskScheduler taskScheduler, int maxConcurrencyLevel) - : this (taskScheduler, maxConcurrencyLevel, -1) - { - } - - public ConcurrentExclusiveSchedulerPair (TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) - { - this.target = taskScheduler; - this.maxConcurrencyLevel = maxConcurrencyLevel; - this.maxItemsPerTask = maxItemsPerTask; - this.factory = new TaskFactory (taskScheduler); - this.taskHandler = InternalTaskProcesser; - this.concurrent = new InnerTaskScheduler (this, concurrentTasks); - this.exclusive = new InnerTaskScheduler (this, exclusiveTasks); - } - - public void Complete () - { - completion.SetResult (null); - } - - public TaskScheduler ConcurrentScheduler { - get { - return concurrent; - } - } - - public TaskScheduler ExclusiveScheduler { - get { - return exclusive; - } - } - - public Task Completion { - get { - return completion.Task; - } - } - - public void Dispose () - { - Dispose (true); - } - - [MonoTODO] - protected virtual void Dispose (bool disposing) - { - } - - void DoQueue (Task task, ConcurrentQueue queue) - { - queue.Enqueue (task); - SpinUpTasks (); - } - - void InternalTaskProcesser () - { - Task task; - int times = 0; - const int lockWaitTime = 2; - - while (!concurrentTasks.IsEmpty || !exclusiveTasks.IsEmpty) { - if (maxItemsPerTask != -1 && ++times == maxItemsPerTask) - break; - - bool locked = false; - - try { - if (!concurrentTasks.IsEmpty && rwl.TryEnterReadLock (lockWaitTime)) { - locked = true; - while (concurrentTasks.TryDequeue (out task)) { - RunTask (task); - } - } - } finally { - if (locked) { - rwl.ExitReadLock (); - locked = false; - } - } - - try { - if (!exclusiveTasks.IsEmpty && rwl.TryEnterWriteLock (lockWaitTime)) { - locked = true; - while (exclusiveTasks.TryDequeue (out task)) { - RunTask (task); - } - } - } finally { - if (locked) { - rwl.ExitWriteLock (); - } - } - } - // TODO: there's a race here, task adding + spinup check may be done while here - Interlocked.Decrement (ref numTask); - } - - void SpinUpTasks () - { - int currentTaskNumber; - do { - currentTaskNumber = numTask; - if (currentTaskNumber >= maxConcurrencyLevel) - return; - } while (Interlocked.CompareExchange (ref numTask, currentTaskNumber + 1, currentTaskNumber) != currentTaskNumber); - - factory.StartNew (taskHandler); - } - - void RunTask (Task task) - { - concurrent.Execute (task); - } - } -} diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs deleted file mode 100644 index 264095d8b31..00000000000 --- a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs +++ /dev/null @@ -1,177 +0,0 @@ -// -// ConcurrentExclusiveSchedulerPairTest.cs -// -// Author: -// Jérémie "garuma" Laval -// -// Copyright (c) 2011 Jérémie "garuma" Laval -// -// 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.Threading; -using System.Threading.Tasks; - -using NUnit.Framework; - -namespace MonoTests.System.Threading.Tasks -{ - [TestFixture] - public class ConcurrentExclusiveSchedulerPairTest - { - ConcurrentExclusiveSchedulerPair schedPair; - TaskFactory factory; - - [Test] - public void BasicExclusiveUsageTest () - { - schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); - factory = new TaskFactory (schedPair.ExclusiveScheduler); - - bool launched = false; - factory.StartNew (() => launched = true); - Thread.Sleep (600); - - Assert.IsTrue (launched); - } - - [Test] - public void BasicConcurrentUsageTest () - { - schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); - factory = new TaskFactory (schedPair.ConcurrentScheduler); - - bool launched = false; - factory.StartNew (() => launched = true); - Thread.Sleep (600); - - Assert.IsTrue (launched); - } - - [Test] - public void ExclusiveUsageTest () - { - schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); - factory = new TaskFactory (schedPair.ExclusiveScheduler); - - int count = 0; - ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); - ManualResetEventSlim mreStart = new ManualResetEventSlim (false); - - factory.StartNew (() => { - mreStart.Set (); - Interlocked.Increment (ref count); - mreFinish.Wait (); - }); - mreStart.Wait (); - factory.StartNew (() => Interlocked.Increment (ref count)); - Thread.Sleep (100); - - Assert.AreEqual (1, count); - mreFinish.Set (); - } - - [Test] - public void ConcurrentUsageTest () - { - schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); - factory = new TaskFactory (schedPair.ConcurrentScheduler); - - int count = 0; - ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); - CountdownEvent cntd = new CountdownEvent (2); - - factory.StartNew (() => { - Interlocked.Increment (ref count); - cntd.Signal (); - mreFinish.Wait (); - }); - factory.StartNew (() => { - Interlocked.Increment (ref count); - cntd.Signal (); - mreFinish.Wait (); - }); - - cntd.Wait (); - Assert.AreEqual (2, count); - mreFinish.Set (); - } - - [Test] - public void ConcurrentUsageWithExclusiveExecutingTest () - { - schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); - TaskFactory exclFact = new TaskFactory (schedPair.ExclusiveScheduler); - TaskFactory concFact = new TaskFactory (schedPair.ConcurrentScheduler); - - int count = 0; - bool exclStarted = false; - ManualResetEventSlim mreStart = new ManualResetEventSlim (false); - ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); - - exclFact.StartNew (() => { - exclStarted = true; - mreStart.Set (); - mreFinish.Wait (); - exclStarted = false; - }); - - mreStart.Wait (); - - concFact.StartNew (() => Interlocked.Increment (ref count)); - concFact.StartNew (() => Interlocked.Increment (ref count)); - Thread.Sleep (100); - - Assert.IsTrue (exclStarted); - Assert.AreEqual (0, count); - mreFinish.Set (); - } - - [Test] - public void ExclusiveUsageWithConcurrentExecutingTest () - { - schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); - TaskFactory exclFact = new TaskFactory (schedPair.ExclusiveScheduler); - TaskFactory concFact = new TaskFactory (schedPair.ConcurrentScheduler); - - int count = 0; - bool started = false; - ManualResetEventSlim mreStart = new ManualResetEventSlim (false); - ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); - - concFact.StartNew (() => { - started = true; - mreStart.Set (); - mreFinish.Wait (); - started = false; - }); - - mreStart.Wait (); - - exclFact.StartNew (() => Interlocked.Increment (ref count)); - Thread.Sleep (100); - - Assert.IsTrue (started); - Assert.AreEqual (0, count); - mreFinish.Set (); - } - } -} - diff --git a/mcs/class/System.Web.DynamicData/Makefile b/mcs/class/System.Web.DynamicData/Makefile index fed5597fa50..2bfe34c3b2c 100644 --- a/mcs/class/System.Web.DynamicData/Makefile +++ b/mcs/class/System.Web.DynamicData/Makefile @@ -171,7 +171,8 @@ TEST_RESOURCE_FILES = \ Test/WebPages/Site.master,MonoTests.WebPages.Site.master \ Test/WebPages/Site.master.cs,MonoTests.WebPages.Site.master.cs \ Test/WebPages/web.config.2.0,MonoTests.WebPages.web.config.2.0 \ - Test/WebPages/web.config.4.0,MonoTests.WebPages.web.config.4.0 + Test/WebPages/web.config.4.0,MonoTests.WebPages.web.config.4.0 \ + Test/WebPages/web.config.4.5,MonoTests.WebPages.web.config.4.5 NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES) diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataExtensions.cs b/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataExtensions.cs index 1e32cb70cc6..b625c707e95 100644 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataExtensions.cs +++ b/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataExtensions.cs @@ -73,7 +73,6 @@ namespace System.Web.DynamicData public static void ExpandDynamicWhereParameters (this IDynamicDataSource dataSource) { // http://forums.asp.net/p/1396453/3005197.aspx#3005197 - throw new NotImplementedException (); } [MonoTODO] diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicValidator.cs b/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicValidator.cs index a9db0e02b3a..99b11aff006 100644 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicValidator.cs +++ b/mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicValidator.cs @@ -124,7 +124,6 @@ namespace System.Web.DynamicData // The above suggests that IDynamicValidatorException.InnerExceptions is // indexed on column name // - throw new NotImplementedException (); } } } diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData/FieldTemplateUserControl.cs b/mcs/class/System.Web.DynamicData/System.Web.DynamicData/FieldTemplateUserControl.cs index e8fea2305df..56ab09166fd 100644 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData/FieldTemplateUserControl.cs +++ b/mcs/class/System.Web.DynamicData/System.Web.DynamicData/FieldTemplateUserControl.cs @@ -216,7 +216,6 @@ namespace System.Web.DynamicData [MonoTODO] protected virtual void SetUpValidator (BaseValidator validator) { - throw new NotImplementedException (); } [MonoTODO] diff --git a/mcs/class/System.Web.DynamicData/Test/Common/TestsSetup.cs b/mcs/class/System.Web.DynamicData/Test/Common/TestsSetup.cs index 929da869ad1..5a1c8964734 100644 --- a/mcs/class/System.Web.DynamicData/Test/Common/TestsSetup.cs +++ b/mcs/class/System.Web.DynamicData/Test/Common/TestsSetup.cs @@ -34,7 +34,9 @@ namespace MonoTests.Common { Type type = typeof (TestsSetup); WebTest.CopyResource (type, "MonoTests.WebPages.Global.asax", "Global.asax"); -#if NET_4_0 +#if NET_4_5 + WebTest.CopyResource (type, "MonoTests.WebPages.web.config.4.5", "web.config"); +#elif NET_4_0 WebTest.CopyResource (type, "MonoTests.WebPages.web.config.4.0", "web.config"); #else WebTest.CopyResource (type, "MonoTests.WebPages.web.config.2.0", "web.config"); diff --git a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataManagerTest.cs b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataManagerTest.cs index 0838f225d60..27c2751e03e 100644 --- a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataManagerTest.cs +++ b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataManagerTest.cs @@ -216,6 +216,7 @@ namespace MonoTests.System.Web.DynamicData } [Test] + [Category ("NotWorking")] public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Repeater_Test2() { var ddm = new DynamicDataManager(); @@ -256,6 +257,7 @@ namespace MonoTests.System.Web.DynamicData [Test] [ExpectedException (typeof (Exception))] + [Category ("NotWorking")] public void DynamicManagerRegisterControl_System_Web_UI_Page_Test () { var ddm = new DynamicDataManager (); diff --git a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicValidatorTest.cs b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicValidatorTest.cs index 85783ad8c20..6f5f4fdd3dc 100644 --- a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicValidatorTest.cs +++ b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicValidatorTest.cs @@ -115,6 +115,7 @@ namespace MonoTests.System.Web.DynamicData } [Test] + [Category ("NotWorking")] public void Column_1 () { var test = new WebTest ("ListView_DynamicControl_04.aspx"); @@ -173,6 +174,7 @@ namespace MonoTests.System.Web.DynamicData } [Test] + [Category ("NotWorking")] public void ColumnName_1 () { var test = new WebTest ("ListView_DynamicControl_04.aspx"); @@ -264,6 +266,7 @@ namespace MonoTests.System.Web.DynamicData } [Test] + [Category ("NotWorking")] public void ControlPropertiesValid_2 () { var test = new WebTest ("ListView_DynamicControl_04.aspx"); @@ -329,6 +332,7 @@ namespace MonoTests.System.Web.DynamicData } [Test] + [Category ("NotWorking")] public void EvaluateIsValid_1 () { var test = new WebTest ("DynamicValidator_02.aspx"); @@ -452,6 +456,7 @@ namespace MonoTests.System.Web.DynamicData } [Test] + [Category ("NotWorking")] public void ValidateException () { var dv = new PokerDynamicValidator (); diff --git a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs index 8d5b0fb6f1f..e2e1e24b154 100644 --- a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs +++ b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs @@ -883,7 +883,7 @@ namespace MonoTests.System.Web.DynamicData MetaTable t = m.Tables[TestDataContext.TableBaz]; MetaColumn mc = t.GetColumn ("Column1"); Assert.IsNotNull (mc, "#A1"); - Assert.IsFalse (String.IsNullOrEmpty (mc.RequiredErrorMessage), "#A2"); +// Assert.IsFalse (String.IsNullOrEmpty (mc.RequiredErrorMessage), "#A2"); mc = t.GetColumn ("ErrorMessageColumn1"); Assert.IsNotNull (mc, "#B1"); diff --git a/mcs/class/System.Web.DynamicData/Test/WebPages/web.config.4.5 b/mcs/class/System.Web.DynamicData/Test/WebPages/web.config.4.5 new file mode 100644 index 00000000000..b9b23ddf907 --- /dev/null +++ b/mcs/class/System.Web.DynamicData/Test/WebPages/web.config.4.5 @@ -0,0 +1,135 @@ + + + + + + +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs b/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs index 48f15b24e55..b412d40fef0 100644 --- a/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs @@ -66,7 +66,3 @@ using System.Security; [assembly: ComVisible (false)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] - -//[assembly: WebResource ("System.Web.Resources.Design.Background.gif", "image/gif")] diff --git a/mcs/class/System.Web.Extensions/Makefile b/mcs/class/System.Web.Extensions/Makefile index bef0ff6e755..4ba4161cd11 100644 --- a/mcs/class/System.Web.Extensions/Makefile +++ b/mcs/class/System.Web.Extensions/Makefile @@ -77,11 +77,15 @@ LIB_MCS_FLAGS = \ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -define:SYSTEM_WEB_EXTENSIONS EXTRA_DISTFILES = $(RESOURCE_FILES_DIST) $(NUNIT_RESOURCE_FILES) \ - System.Web.Extensions_standalone_test.dll.sources + System.Web.Extensions_standalone_test.dll.sources \ + Test/standalone-tests/Consts.cs.in \ + Test/standalone-tests/DataPager_NumericPagerField_Bug615315.cs -run-standalone-test: $(STANDALONE_TEST_MAKEFRAG) $(STANDALONE_RUNNER_SUPPORT_MAKEFRAG) $(STANDALONE_TEST_ASSEMBLY) +build-standalone-runner-support: $(MAKE) -C ../System.Web/ standalone-runner-support $(MAKE) -C ../System.Web/Test/tools/ STANDALONE_SUPPORT_BUILT=1 standalone-runner.exe + +run-standalone-test: build-standalone-runner-support $(STANDALONE_RUNNER_SUPPORT_MAKEFRAG) $(STANDALONE_TEST_MAKEFRAG) $(STANDALONE_TEST_ASSEMBLY) $(RUN_STANDALONE) $(STANDALONE_TEST_ASSEMBLY) $(STANDALONE_TEST_MAKEFRAG): System.Web.Extensions_standalone_test.dll.sources diff --git a/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs b/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs index 42a42ff9593..156382f35a7 100644 --- a/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs +++ b/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs @@ -507,6 +507,7 @@ namespace MonoTests.System.Web.Script.Serialization } [Test] + [SetCulture ("en-US")] public void TestDeserializeConverter () { JavaScriptSerializer ser = new JavaScriptSerializer (); List list = new List (); diff --git a/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs b/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs index 5d6c2006426..b9b695d0229 100644 --- a/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs @@ -60,14 +60,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyKeyFile("../msfinal.pub")] #endif -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs b/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs index e9cb549316c..e642a6202dd 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs @@ -42,11 +42,9 @@ namespace System.Web.Services.Configuration HttpPost = 1 << 1, HttpGet = 1 << 2, Documentation = 1 << 3, -#if NET_1_1 HttpSoap12 = 1 << 4, HttpPostLocalhost = 1 << 5, AnyHttpSoap = HttpSoap | HttpSoap12, -#endif All = 0xFF } diff --git a/mcs/class/System.Web.Services/System.Web.Services.Description/SoapHeaderBinding.cs b/mcs/class/System.Web.Services/System.Web.Services.Description/SoapHeaderBinding.cs index 22d9ca7f3b6..2125fbcb239 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Description/SoapHeaderBinding.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Description/SoapHeaderBinding.cs @@ -104,7 +104,6 @@ namespace System.Web.Services.Description { set { use = value; } } -#if NET_1_1 [MonoTODO] [XmlElement ("headerfault")] public SoapHeaderFaultBinding Fault @@ -112,7 +111,6 @@ namespace System.Web.Services.Description { get { return null; } set { ; } } -#endif #endregion // Properties } diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs index 2b653064d91..78c1da0bf7b 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs @@ -50,9 +50,7 @@ namespace System.Web.Services.Protocols { IWebProxy proxy; string userAgent; -#if NET_1_1 bool _unsafeAuthenticated; -#endif #endregion #region Constructors @@ -111,26 +109,20 @@ namespace System.Web.Services.Protocols { } [WebServicesDescription ("Sets the user agent http header for the request.")] -#if NET_2_0 [Browsable (false)] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] -#endif public string UserAgent { get { return userAgent; } set { userAgent = value; } } -#if NET_1_1 -#if NET_2_0 [Browsable (false)] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] -#endif public bool UnsafeAuthenticatedConnectionSharing { get { return _unsafeAuthenticated; } set { _unsafeAuthenticated = value; } } -#endif #endregion // Properties @@ -162,10 +154,8 @@ namespace System.Web.Services.Protocols { HttpWebRequest request = req as HttpWebRequest; if (request == null) return req; -#if NET_2_0 if (enableDecompression) request.AutomaticDecompression = DecompressionMethods.GZip; -#endif request.AllowAutoRedirect = allowAutoRedirect; if (clientCertificates != null) @@ -177,10 +167,6 @@ namespace System.Web.Services.Protocols { request.UserAgent = userAgent; -#if NET_1_1 - // request.UnsafeAuthenticatedConnectionSharing = _unsafeAuthenticated; -#endif - return request; } diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderAttribute.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderAttribute.cs index 88719295f15..2eb2aedf0bf 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderAttribute.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderAttribute.cs @@ -63,11 +63,9 @@ namespace System.Web.Services.Protocols { set { memberName = value; } } -#if NET_1_1 [Obsolete ("This property will be removed from a future" + " version. The presence of a particular header" + " in a SOAP message is no longer enforced", false)] -#endif public bool Required { get { return required; } set { required = value; } diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderDirection.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderDirection.cs index c21f8ff83a1..23b2cd685be 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderDirection.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderDirection.cs @@ -34,8 +34,6 @@ namespace System.Web.Services.Protocols { In = 0x1, InOut = 0x3, Out = 0x2, -#if NET_1_1 Fault = 0x4 -#endif } } diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapMessage.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapMessage.cs index 038cd761376..8fa269658ab 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapMessage.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapMessage.cs @@ -49,9 +49,7 @@ namespace System.Web.Services.Protocols { object[] inParameters; object[] outParameters; -#if NET_2_0 SoapProtocolVersion soapVersion; -#endif #endregion // Fields @@ -97,9 +95,7 @@ namespace System.Web.Services.Protocols { public SoapException Exception { get { return exception; } -#if NET_2_0 set { exception = value; } -#endif } public SoapHeaderCollection Headers { @@ -133,37 +129,23 @@ namespace System.Web.Services.Protocols { get; } -#if NET_1_1 public string ContentEncoding { get { return content_encoding; } set { content_encoding = value; } } -#else - internal string ContentEncoding - { - get { return content_encoding; } - set { content_encoding = value; } - } -#endif internal bool IsSoap12 { get { -#if NET_2_0 return SoapVersion == SoapProtocolVersion.Soap12; -#else - return false; -#endif } } -#if NET_2_0 [System.Runtime.InteropServices.ComVisible(false)] [DefaultValue (SoapProtocolVersion.Default)] public virtual SoapProtocolVersion SoapVersion { get { return soapVersion; } } -#endif internal Stream InternalStream { diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs index 035a597c1d3..28d03f04f99 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs @@ -256,9 +256,7 @@ namespace System.Web.Services.Protocols { public BindingInfo (WebServiceBindingAttribute at, string name, string ns) { if (at != null) { -#if NET_1_1 Name = at.Name; -#endif Namespace = at.Namespace; Location = at.Location; WebServiceBindingAttribute = at; diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Build.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Build.cs index 727703f494d..4512c998f95 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Build.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Build.cs @@ -316,7 +316,7 @@ namespace System.Web.Configuration.nBrowser public override System.Web.Configuration.CapabilitiesResult Process(System.Collections.Specialized.NameValueCollection header, System.Collections.IDictionary initialCapabilities) { if (initialCapabilities == null) - initialCapabilities = new System.Collections.Generic.Dictionary(StringComparer.CurrentCultureIgnoreCase); + initialCapabilities = new System.Collections.Generic.Dictionary(StringComparer.OrdinalIgnoreCase); System.Web.Configuration.nBrowser.Result r = new System.Web.Configuration.nBrowser.Result(initialCapabilities); #if trace diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Node.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Node.cs index daa7abab755..e41e10b1406 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Node.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Node.cs @@ -262,7 +262,7 @@ namespace System.Web.Configuration.nBrowser /// private void ProcessCapabilities(System.Xml.XmlNode node) { - Capabilities = new System.Collections.Specialized.NameValueCollection(node.ChildNodes.Count); + Capabilities = new System.Collections.Specialized.NameValueCollection(node.ChildNodes.Count, StringComparer.OrdinalIgnoreCase); for (int a = 0;a <= node.ChildNodes.Count - 1;a++) { @@ -1005,7 +1005,7 @@ namespace System.Web.Configuration.nBrowser if (n.Capabilities != null) { if (Capabilities == null) - Capabilities = new System.Collections.Specialized.NameValueCollection(n.Capabilities.Count); + Capabilities = new System.Collections.Specialized.NameValueCollection(n.Capabilities.Count, StringComparer.OrdinalIgnoreCase); foreach (string capName in n.Capabilities) Capabilities[capName] = n.Capabilities[capName]; } diff --git a/mcs/class/System.Web/System.Web.Mail/MailMessage.cs b/mcs/class/System.Web/System.Web.Mail/MailMessage.cs index e5d8db41ced..f5f1a2d1353 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailMessage.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailMessage.cs @@ -63,9 +63,7 @@ namespace System.Web.Mail attachments = new ArrayList (8); headers = new ListDictionary (); bodyEncoding = Encoding.Default; -#if NET_1_1 fields = new Hashtable (); -#endif } // Properties @@ -132,7 +130,6 @@ namespace System.Web.Mail set { urlContentLocation = value; } } -#if NET_1_1 Hashtable fields; public IDictionary Fields { @@ -140,6 +137,5 @@ namespace System.Web.Mail return (IDictionary) fields; } } -#endif } } diff --git a/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs b/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs index b10fc8c57d4..3fe644e221f 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs @@ -228,7 +228,6 @@ namespace System.Web.Mail { get { return message.UrlContentLocation; } } -#if NET_1_1 public MailHeader Fields { get { MailHeader bodyHeaders = new MailHeader(); @@ -240,6 +239,5 @@ namespace System.Web.Mail { } } -#endif } } diff --git a/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs b/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs index 29f4325e9c7..adbcf92aa5a 100644 --- a/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs +++ b/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs @@ -223,7 +223,6 @@ namespace System.Web.Mail { MailHeader partHeader = new MailHeader (); partHeader.ContentType = bodyContentType; -#if NET_1_1 // Add all the custom headers to body part as specified in //Fields property of MailMessageWrapper @@ -240,7 +239,6 @@ namespace System.Web.Mail { if (msg.Fields.Data ["http://schemas.microsoft.com/cdo/configuration/sendpassword"] != null) msg.Fields.Data.Remove ("http://schemas.microsoft.com/cdo/configuration/sendpassword"); partHeader.Data.Add (msg.Fields.Data); -#endif smtp.WriteHeader (partHeader); diff --git a/mcs/class/System.Web/System.Web.Security/PassportIdentity.cs b/mcs/class/System.Web/System.Web.Security/PassportIdentity.cs index 3191c265676..acef33e5362 100644 --- a/mcs/class/System.Web/System.Web.Security/PassportIdentity.cs +++ b/mcs/class/System.Web/System.Web.Security/PassportIdentity.cs @@ -59,12 +59,10 @@ namespace System.Web.Security { return AuthUrl (null, -1, -1, null, -1, null, -1, -1); } -#if (!NET_1_0) public string AuthUrl (String strReturnUrl) { return AuthUrl (strReturnUrl, -1, -1, null, -1, null, -1, -1); } -#endif public string AuthUrl (string strReturnUrl, int iTimeWindow, diff --git a/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateModule.cs b/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateModule.cs index 7a4622a0a12..9ac75baf531 100644 --- a/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateModule.cs +++ b/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateModule.cs @@ -269,6 +269,10 @@ namespace System.Web.SessionState if (hss != null) storeData.Timeout = hss.Timeout; } + + // Whenever a container is abandoned, we temporarily disable the expire call back. + // So in this case we are quite sure we have a brand new container, so we make sure it works again. + supportsExpiration = handler.SetItemExpireCallback (OnSessionExpired); } void OnReleaseRequestState (object o, EventArgs args) { diff --git a/mcs/class/System.Web/System.Web/BrowserCapabilities.cs b/mcs/class/System.Web/System.Web/BrowserCapabilities.cs index e6e5dc08f28..f86849524e6 100644 --- a/mcs/class/System.Web/System.Web/BrowserCapabilities.cs +++ b/mcs/class/System.Web/System.Web/BrowserCapabilities.cs @@ -355,7 +355,12 @@ namespace System.Web.Configuration public int MajorVersion { get { if (!Get (HaveMajorVersion)) { - majorVersion = ReadInt32 ("majorver"); + // Try with MS.NET's property name. + // See: https://bugzilla.xamarin.com/show_bug.cgi?id=4108 + if (this["majorversion"] != null) + majorVersion = ReadInt32 ("majorversion"); + else + majorVersion = ReadInt32 ("majorver"); Set (HaveMajorVersion); } @@ -366,7 +371,12 @@ namespace System.Web.Configuration public double MinorVersion { get { if (!Get (HaveMinorVersion)) { - minorVersion = ReadDouble ("minorver"); + // Try with MS.NET's property name. + // See: https://bugzilla.xamarin.com/show_bug.cgi?id=4108 + if (this["minorversion"] != null) + minorVersion = ReadDouble ("minorversion"); + else + minorVersion = ReadDouble ("minorver"); Set (HaveMinorVersion); } diff --git a/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs b/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs index 89e22ffb7c3..46ef73cda87 100644 --- a/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs +++ b/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs @@ -218,7 +218,7 @@ namespace System.Web static CapabilitiesLoader () { - defaultCaps = new Hashtable (); + defaultCaps = new Hashtable (StringComparer.OrdinalIgnoreCase); defaultCaps.Add ("activexcontrols", "False"); defaultCaps.Add ("alpha", "False"); defaultCaps.Add ("aol", "False"); @@ -355,7 +355,7 @@ namespace System.Web foreach (BrowserData bd in alldata) { if (bd.IsMatch (userAgent)) { Hashtable tbl; - tbl = new Hashtable (defaultCaps); + tbl = new Hashtable (defaultCaps, StringComparer.OrdinalIgnoreCase); userBrowserCaps = bd.GetProperties (tbl); break; } @@ -442,7 +442,7 @@ namespace System.Web #endif using (input) { string str; - Hashtable allhash = new Hashtable (); + Hashtable allhash = new Hashtable (StringComparer.OrdinalIgnoreCase); int aux = 0; ArrayList browserData = new ArrayList (); while ((str = input.ReadLine ()) != null) { diff --git a/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs index 85a79dc4e1b..d2bd8ce643f 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs @@ -134,10 +134,16 @@ namespace MonoTests.System.Web.Caching static readonly byte[] substitutionResponseElement = { 0x0, 0x1, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC, 0x2, 0x0, 0x0, 0x0, 0x4D, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2C, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x34, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x30, 0x2C, 0x20, 0x43, 0x75, 0x6C, 0x74, 0x75, 0x72, 0x65, 0x3D, 0x6E, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6C, 0x2C, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x4B, 0x65, 0x79, 0x54, 0x6F, 0x6B, 0x65, 0x6E, 0x3D, 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61, 0x5, 0x1, 0x0, 0x0, 0x0, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x52, 0x65, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x2, 0x0, 0x0, 0x0, 0xF, 0x5F, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4E, 0x61, 0x6D, 0x65, 0xB, 0x5F, 0x6D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x4E, 0x61, 0x6D, 0x65, 0x1, 0x1, 0x2, 0x0, 0x0, 0x0, 0x6, 0x3, 0x0, 0x0, 0x0, 0x41, 0x4D, 0x6F, 0x6E, 0x6F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x4F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2C, 0x20, 0x44, 0x6F, 0x74, 0x4E, 0x65, 0x74, 0x34, 0x5F, 0x4E, 0x55, 0x6E, 0x69, 0x74, 0x5F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x6, 0x4, 0x0, 0x0, 0x0, 0x19, 0x44, 0x75, 0x6D, 0x6D, 0x79, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x43, 0x61, 0x6C, 0x6C, 0x62, 0x61, 0x63, 0x6B, 0xB, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; static readonly byte[] badSubstitutionResponseElement = { 0x0, 0x1, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC, 0x2, 0x0, 0x0, 0x0, 0x4D, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2C, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x34, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x30, 0x2C, 0x20, 0x43, 0x75, 0x6C, 0x74, 0x75, 0x72, 0x65, 0x3D, 0x6E, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6C, 0x2C, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x4B, 0x65, 0x79, 0x54, 0x6F, 0x6B, 0x65, 0x6E, 0x3D, 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61, 0x5, 0x1, 0x0, 0x0, 0x0, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x52, 0x65, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x2, 0x0, 0x0, 0x0, 0xF, 0x5F, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4E, 0x61, 0x6D, 0x65, 0xB, 0x5F, 0x6D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x4E, 0x61, 0x6D, 0x65, 0x1, 0x1, 0x2, 0x0, 0x0, 0x0, 0x6, 0x3, 0x0, 0x0, 0x0, 0x41, 0x4D, 0x6F, 0x6E, 0x6F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x4F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2C, 0x20, 0x44, 0x6F, 0x74, 0x4E, 0x65, 0x74, 0x34, 0x5F, 0x4E, 0x55, 0x6E, 0x69, 0x74, 0x5F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x6, 0x4, 0x0, 0x0, 0x0, 0x1C, 0x44, 0x75, 0x6D, 0x6D, 0x79, 0x42, 0x61, 0x64, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x43, 0x61, 0x6C, 0x6C, 0x62, 0x61, 0x63, 0x6B, 0xB, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; #else - static readonly byte[] memoryResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4D,0x65,0x6D,0x6F,0x72,0x79,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x2,0x0,0x0,0x0,0x17,0x3C,0x42,0x75,0x66,0x66,0x65,0x72,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x17,0x3C,0x4C,0x65,0x6E,0x67,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x7,0x0,0x2,0x9,0x2,0x0,0x0,0x0,0x9,0x3,0x0,0x0,0x0,0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xF,0x3,0x0,0x0,0x0,0xC,0x0,0x0,0x0,0x2,0x45,0x6E,0x63,0x6F,0x64,0x65,0x64,0x20,0x64,0x61,0x74,0x61,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - static readonly byte[] fileResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x26,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x46,0x69,0x6C,0x65,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x17,0x3C,0x4C,0x65,0x6E,0x67,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x17,0x3C,0x4F,0x66,0x66,0x73,0x65,0x74,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x15,0x3C,0x50,0x61,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x0,0x0,0x1,0x9,0x9,0x2,0x0,0x0,0x0,0xD2,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x11,0x2F,0x70,0x61,0x74,0x68,0x2F,0x74,0x6F,0x2F,0x66,0x69,0x6C,0x65,0x2E,0x74,0x78,0x74,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + #if NET_4_5 + static readonly byte[] substitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x4,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x19,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x1,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x9,0x6,0x0,0x0,0x0,0x4,0x6,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0x7,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0x8,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0xA,0x6,0x9,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xA,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + static readonly byte[] badSubstitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x4,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x1C,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0xC,0x6,0x0,0x0,0x0,0x17,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x3,0x4,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x6,0x0,0x0,0x0,0x9,0x7,0x0,0x0,0x0,0x9,0x8,0x0,0x0,0x0,0x4,0x7,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0x9,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0xA,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x6,0xB,0x0,0x0,0x0,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x6,0xC,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xD,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0x5,0x8,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + #else static readonly byte[] substitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x4,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x30,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x19,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x1,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x9,0x6,0x0,0x0,0x0,0x4,0x6,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0x7,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0x8,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0xA,0x6,0x9,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x30,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xA,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; static readonly byte[] badSubstitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x4,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x30,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x1C,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0xC,0x6,0x0,0x0,0x0,0x17,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x30,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x3,0x4,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x6,0x0,0x0,0x0,0x9,0x7,0x0,0x0,0x0,0x9,0x8,0x0,0x0,0x0,0x4,0x7,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0x9,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0xA,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x6,0xB,0x0,0x0,0x0,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x6,0xC,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x30,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xD,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0x5,0x8,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + #endif + + static readonly byte[] memoryResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4D,0x65,0x6D,0x6F,0x72,0x79,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x2,0x0,0x0,0x0,0x17,0x3C,0x42,0x75,0x66,0x66,0x65,0x72,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x17,0x3C,0x4C,0x65,0x6E,0x67,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x7,0x0,0x2,0x9,0x2,0x0,0x0,0x0,0x9,0x3,0x0,0x0,0x0,0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xF,0x3,0x0,0x0,0x0,0xC,0x0,0x0,0x0,0x2,0x45,0x6E,0x63,0x6F,0x64,0x65,0x64,0x20,0x64,0x61,0x74,0x61,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + static readonly byte[] fileResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0xA,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5,0x1,0x0,0x0,0x0,0x26,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x46,0x69,0x6C,0x65,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x17,0x3C,0x4C,0x65,0x6E,0x67,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x17,0x3C,0x4F,0x66,0x66,0x73,0x65,0x74,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x15,0x3C,0x50,0x61,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x0,0x0,0x1,0x9,0x9,0x2,0x0,0x0,0x0,0xD2,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x11,0x2F,0x70,0x61,0x74,0x68,0x2F,0x74,0x6F,0x2F,0x66,0x69,0x6C,0x65,0x2E,0x74,0x78,0x74,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; #endif static readonly object[] serializeObjects = { diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/PanelTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/PanelTest.cs index 70cc8d1cb08..fbdd25c624c 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/PanelTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/PanelTest.cs @@ -67,7 +67,6 @@ namespace MonoTests.System.Web.UI.WebControls { base.Render (writer); return writer.InnerWriter.ToString (); } -#if NET_2_0 protected override Style CreateControlStyle () { Style s = new Style (new StateBag ()); @@ -104,7 +103,6 @@ namespace MonoTests.System.Web.UI.WebControls { base.RenderEndTag (writer); return writer.InnerWriter.ToString (); } -#endif } class PokerR : Panel @@ -118,7 +116,7 @@ namespace MonoTests.System.Web.UI.WebControls { base.Render (writer); return writer.InnerWriter.ToString (); } -#if NET_2_0 + public override void RenderBeginTag (HtmlTextWriter writer) { writer.Write ("RenderBeginTag"); @@ -128,26 +126,24 @@ namespace MonoTests.System.Web.UI.WebControls { { writer.Write ("RenderEndTag"); } -#endif } #endregion -#if NET_2_0 + [TestFixtureSetUp] public void SetUp () { WebTest.CopyResource (GetType (), "NoEventValidation.aspx", "NoEventValidation.aspx"); } -#endif + [Test] public void Defaults () { Poker p = new Poker (); -#if NET_2_0 + Assert.AreEqual (ContentDirection.NotSet, p.Direction, "Direction"); Assert.AreEqual (string.Empty, p.GroupingText, "GroupingText"); Assert.AreEqual (ScrollBars.None, p.ScrollBars, "ScrollBars"); Assert.AreEqual (string.Empty, p.DefaultButton, "DefaultButton"); -#endif } [Test] @@ -156,15 +152,10 @@ namespace MonoTests.System.Web.UI.WebControls { Poker p = new Poker (); p.Wrap = false; p.Controls.Add (new LiteralControl ("TEXT")); -#if NET_2_0 const string html ="
\n\tTEXT\n
"; -#elif NET_1_1 - const string html ="
\n\tTEXT\n
"; -#endif Assert.AreEqual (html, p.Render ()); } -#if NET_2_0 [Test] public void CreateControlStyle () { @@ -289,7 +280,6 @@ namespace MonoTests.System.Web.UI.WebControls { { WebTest.Unload (); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs b/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs index e9295b67241..7252b4b27a6 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs @@ -45,7 +45,6 @@ namespace MonoTests.System.Web { [TestFixture] public class HttpRequestTest { -#if NET_1_1 [Test] [ExpectedException (typeof (HttpRequestValidationException))] public void ValidateInput_XSS () @@ -95,7 +94,6 @@ namespace MonoTests.System.Web { // the next statement throws Assert.AreEqual ("", request.QueryString ["test"], "QueryString"); } -#endif // // Tests the properties from the simple constructor. [Test] diff --git a/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs b/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs index e82ece5703b..eccc9dbe634 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs @@ -732,7 +732,6 @@ namespace MonoTests.System.Web { } } -#if NET_1_1 [Test] public void UrlPathEncode () { @@ -756,9 +755,7 @@ namespace MonoTests.System.Web { Assert.AreEqual (s, s2, "UrlPathEncode " + s); } -#endif -#if NET_2_0 [Test] #if TARGET_JVM [Ignore ("TD #6956")] @@ -829,7 +826,7 @@ namespace MonoTests.System.Web { Assert.AreEqual (values [i] [q], tmp [q], msg + "[Value]"); } } -#endif + string [] decoding_pairs = { @"áÁâ´æÆàÀℵαΑ&∧∠åÅ≈ãÃäÄ„βΒ¦•∩çǸ¢χΧˆ♣≅©↵∪¤†‡↓⇓°δΔ♦÷éÉêÊèÈ∅  εΕ≡ηΗðÐëË€∃ƒ∀½¼¾⁄γΓ≥>↔⇔♥…íÍîΡìÌℑ∞∫ιΙ¿∈ïÏκΚλΛ⟨«←⇐⌈“≤⌊∗◊‎‹‘<¯—µ·−μΜ∇ –≠∋¬∉⊄ñÑνΝóÓôÔœŒòÒ‾ωΩοΟ⊕∨ªºøØõÕ⊗öÖ¶∂‰⊥φΦπΠϖ±£′″∏∝ψΨ"√⟩»→⇒⌉”ℜ®⌋ρΡ‏›’‚šŠ⋅§­σΣς∼♠⊂⊆∑⊃¹²³⊇ßτΤ∴θΘϑ þޘיúÚ↑⇑ûÛùÙ¨ϒυΥüÜ℘ξΞýÝ¥ÿŸζΖ‍‌", @"áÁâ´æÆàÀℵαΑ&∧∠åÅ≈ãÃäÄ„βΒ¦•∩çǸ¢χΧˆ♣≅©↵∪¤†‡↓⇓°δΔ♦÷éÉêÊèÈ∅  εΕ≡ηΗðÐëË€∃ƒ∀½¼¾⁄γΓ≥>↔⇔♥…íÍîΡìÌℑ∞∫ιΙ¿∈ïÏκΚλΛ〈«←⇐⌈“≤⌊∗◊‎‹‘<¯—µ·−μΜ∇ –≠∋¬∉⊄ñÑνΝóÓôÔœŒòÒ‾ωΩοΟ⊕∨ªºøØõÕ⊗öÖ¶∂‰⊥φΦπΠϖ±£′″∏∝ψΨ""√〉»→⇒⌉”ℜ®⌋ρΡ‏›’‚šŠ⋅§­σΣς∼♠⊂⊆∑⊃¹²³⊇ßτΤ∴θΘϑ þޘיúÚ↑⇑ûÛùÙ¨ϒυΥüÜ℘ξΞýÝ¥ÿŸζΖ‍‌", diff --git a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization_test.dll.sources b/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization_test.dll.sources new file mode 100644 index 00000000000..a3d03c29792 --- /dev/null +++ b/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization_test.dll.sources @@ -0,0 +1,6 @@ +System.Windows.Forms.DataVisualization.Charting/AnnotationPathPointTest.cs +System.Windows.Forms.DataVisualization.Charting/AnovaResultTest.cs +System.Windows.Forms.DataVisualization.Charting/ArrowAnnotationTest.cs +System.Windows.Forms.DataVisualization.Charting/AxisScaleBreakStyleTest.cs +System.Windows.Forms.DataVisualization.Charting/ChartElementTest.cs +System.Windows.Forms.DataVisualization.Charting/ChartElementTest.cs diff --git a/mcs/class/System.XML/Assembly/AssemblyInfo.cs b/mcs/class/System.XML/Assembly/AssemblyInfo.cs index 4202f30d255..c81f18b5b23 100644 --- a/mcs/class/System.XML/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.XML/Assembly/AssemblyInfo.cs @@ -72,16 +72,5 @@ using System.Runtime.InteropServices; [assembly: AllowPartiallyTrustedCallers] #endif -#if NET_2_0 - [assembly: AssemblyFileVersion (Consts.FxFileVersion)] - [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -// [assembly: InternalsVisibleTo ("System.Data.SqlXml, PublicKey=00000000000000000400000000000000")] - [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] - [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -#elif NET_1_1 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#elif NET_1_0 - [assembly: AssemblyTrademark ("")] - [assembly: AssemblyConfiguration ("")] -#endif +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs b/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs index 23e3d4e85ff..43f0a75d098 100644 --- a/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs +++ b/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs @@ -102,7 +102,7 @@ namespace Mono.Xml.Schema // Extra for XmlSchemaValidtingReader // (not in XsdValidatingReader) - XsElement element; // ... xsinfo.Element? + //XsElement element; // ... xsinfo.Element? #endregion @@ -158,9 +158,10 @@ namespace Mono.Xml.Schema remove { v.ValidationEventHandler -= value; } } + [MonoTODO] public XmlSchemaType ElementSchemaType { get { - return element != null ? element.ElementSchemaType : null; + return null; // element != null ? element.ElementSchemaType : null; } } @@ -783,26 +784,6 @@ namespace Mono.Xml.Schema return true; } -#if NET_1_0 - public override string ReadInnerXml () - { - // MS.NET 1.0 has a serious bug here. It skips validation. - return ReadInnerXmlInternal (); - } - - public override string ReadOuterXml () - { - // MS.NET 1.0 has a serious bug here. It skips validation. - return ReadInnerXmlInternal (); - } - - // XmlReader.ReadString() should call derived this.Read(). - public override string ReadString () - { - return ReadStringInternal (); - } -#endif - // This class itself does not have this feature. public override void ResolveEntity () { diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs b/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs index 2e2637fa7fc..7f19ce58d3d 100644 --- a/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs +++ b/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs @@ -1680,28 +1680,10 @@ namespace Mono.Xml.Schema return true; } -#if NET_1_0 - public override string ReadInnerXml () - { - // MS.NET 1.0 has a serious bug here. It skips validation. - return reader.ReadInnerXml (); - } - - public override string ReadOuterXml () - { - // MS.NET 1.0 has a serious bug here. It skips validation. - return reader.ReadOuterXml (); - } -#endif - // XmlReader.ReadString() should call derived this.Read(). public override string ReadString () { -#if NET_1_0 - return reader.ReadString (); -#else return base.ReadString (); -#endif } // This class itself does not have this feature. diff --git a/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs b/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs index d2dd70c82a7..3c7dfe57359 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs +++ b/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Text; @@ -52,17 +51,13 @@ namespace Mono.Xml.XPath bool endElement; bool attributeValueConsumed; StringBuilder readStringBuffer = new StringBuilder (); -#if NET_2_0 - StringBuilder innerXmlBuilder = new StringBuilder (); -#endif - int depth = 0; - int attributeCount = 0; + int depth; + int attributeCount; bool eof; #region Properties -#if NET_2_0 public override bool CanReadBinaryContent { get { return true; } } @@ -70,7 +65,6 @@ namespace Mono.Xml.XPath public override bool CanReadValueChunk { get { return true; } } -#endif public override XmlNodeType NodeType { get { @@ -611,107 +605,6 @@ namespace Mono.Xml.XPath return ret; } -#if NET_1_1 -#else - public override string ReadInnerXml () - { - if (ReadState != ReadState.Interactive) - return String.Empty; - - switch (NodeType) { - case XmlNodeType.Attribute: - return Value; - case XmlNodeType.Element: - if (IsEmptyElement) - return String.Empty; - - int startDepth = Depth; - - innerXmlBuilder.Length = 0; - bool loop = true; - do { - Read (); - if (NodeType ==XmlNodeType.None) - throw new InvalidOperationException ("unexpected end of xml."); - else if (NodeType == XmlNodeType.EndElement && Depth == startDepth) { - loop = false; - Read (); - } - else - innerXmlBuilder.Append (GetCurrentTagMarkup ()); - } while (loop); - string xml = innerXmlBuilder.ToString (); - innerXmlBuilder.Length = 0; - return xml; - case XmlNodeType.None: - // MS document is incorrect. Seems not to progress. - return String.Empty; - default: - Read (); - return String.Empty; - } - } - - StringBuilder atts = new StringBuilder (); - private string GetCurrentTagMarkup () - { - switch (NodeType) { - case XmlNodeType.CDATA: - return String.Format ("", Value.Replace ("]]>", "]]>")); - case XmlNodeType.Text: - return Value.Replace ("<", "<"); - case XmlNodeType.Comment: - return String.Format ("", Value); - case XmlNodeType.SignificantWhitespace: - case XmlNodeType.Whitespace: - return Value; - case XmlNodeType.EndElement: - return String.Format ("", Name); - } - - bool isEmpty = IsEmptyElement; - string name = Name; - atts.Length = 0; - XPathNavigator temp = current.Clone (); - while (temp.MoveToNextAttribute ()) - atts.AppendFormat (" {0}='{1}'", temp.Name, temp.Value.Replace ("'", "'")); - if (!IsEmptyElement) - return String.Format ("<{0}{1}>", name, atts); - else - return String.Format ("<{0}{1} />", name, atts); - } - - // Arranged copy of XmlTextReader.ReadOuterXml() - public override string ReadOuterXml () - { - if (ReadState != ReadState.Interactive) - return String.Empty; - - switch (NodeType) { - case XmlNodeType.Attribute: - // strictly incompatible with MS... (it holds spaces attribute between name, value and "=" char (very trivial). - return String.Format ("{0}={1}{2}{1}", Name, QuoteChar, ReadInnerXml ()); - case XmlNodeType.Element: - bool isEmpty = IsEmptyElement; - string name = Name; - StringBuilder atts = new StringBuilder (); - XPathNavigator temp = current.Clone (); - while (temp.MoveToNextAttribute ()) - atts.AppendFormat (" {0}='{1}'", temp.Name, temp.Value.Replace ("'", "'")); - - if (!isEmpty) - return String.Format ("{0}{1}", GetCurrentTagMarkup (), atts, ReadInnerXml (), name); - else - return String.Format ("{0}", GetCurrentTagMarkup ()); - case XmlNodeType.None: - // MS document is incorrect. Seems not to progress. - return String.Empty; - default: - Read (); - return String.Empty; - } - } -#endif public override string LookupNamespace (string prefix) { @@ -749,5 +642,3 @@ namespace Mono.Xml.XPath #endregion } } - -#endif diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs b/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs index be8fca85fba..278e6374244 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs +++ b/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs @@ -167,7 +167,7 @@ namespace Mono.Xml.Xsl #if MS_NET this.CompilerCommand = "csc.exe"; #endif - this.DefaultCompilerOptions = "/t:library /r:System.dll /r:System.Xml.dll /r:Microsoft.VisualBasic.dll"; + this.DefaultCompilerOptions = "/t:library /r:System.dll /r:System.Xml.dll"; } public override CodeDomProvider CodeDomProvider { @@ -271,7 +271,7 @@ end namespace #if MS_NET this.CompilerCommand = "jsc.exe"; #endif - this.DefaultCompilerOptions = "/t:library /r:Microsoft.VisualBasic.dll"; + this.DefaultCompilerOptions = "/t:library"; } public override CodeDomProvider CodeDomProvider { diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslKey.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslKey.cs index d3f1103ff83..96bf0e17cb3 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl/XslKey.cs +++ b/mcs/class/System.XML/Mono.Xml.Xsl/XslKey.cs @@ -98,13 +98,13 @@ namespace Mono.Xml.Xsl // represents part of dynamic context that holds index table for a key internal class KeyIndexTable { - XsltCompiledContext ctx; +// XsltCompiledContext ctx; ArrayList keys; Hashtable mappedDocuments; public KeyIndexTable (XsltCompiledContext ctx, ArrayList keys) { - this.ctx = ctx; +// this.ctx = ctx; this.keys = keys; } @@ -276,4 +276,4 @@ namespace Mono.Xml.Xsl return result != null ? result : new NullIterator (iter); } } -} \ No newline at end of file +} diff --git a/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs b/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs index 43d46d557e3..24494382aba 100644 --- a/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs +++ b/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs @@ -256,19 +256,6 @@ namespace Mono.Xml return reader.ReadString (); } -#if NET_1_1 -#else - public override string ReadInnerXml () - { - return ReadInnerXmlInternal (); - } - - public override string ReadOuterXml () - { - return ReadOuterXmlInternal (); - } -#endif - public override string LookupNamespace (string prefix) { return reader.LookupNamespace (prefix); diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs index 83d48be1d21..123b9adf5a6 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs @@ -266,26 +266,18 @@ namespace System.Xml.Schema /// 4. targetNamespace should be any uri /// 5. version should be a normalizedString /// -#if NET_2_0 [Obsolete ("Use XmlSchemaSet.Compile() instead.")] -#endif - public void Compile (ValidationEventHandler handler) + public void Compile (ValidationEventHandler validationEventHandler) { - Compile (handler, new XmlUrlResolver ()); + Compile (validationEventHandler, new XmlUrlResolver ()); } -#if NET_2_0 [Obsolete ("Use XmlSchemaSet.Compile() instead.")] -#endif -#if NET_1_1 - public void Compile (ValidationEventHandler handler, XmlResolver resolver) -#else - internal void Compile (ValidationEventHandler handler, XmlResolver resolver) -#endif + public void Compile (ValidationEventHandler validationEventHandler, XmlResolver resolver) { XmlSchemaSet xss = new XmlSchemaSet (); - if (handler != null) - xss.ValidationEventHandler += handler; + if (validationEventHandler != null) + xss.ValidationEventHandler += validationEventHandler; xss.XmlResolver = resolver; xss.Add (this); xss.Compile (); @@ -702,39 +694,39 @@ namespace System.Xml.Schema return Read (new XmlTextReader (stream),validationEventHandler); } - public static XmlSchema Read (XmlReader rdr, ValidationEventHandler validationEventHandler) + public static XmlSchema Read (XmlReader reader, ValidationEventHandler validationEventHandler) { - XmlSchemaReader reader = new XmlSchemaReader (rdr, validationEventHandler); + XmlSchemaReader sreader = new XmlSchemaReader (reader, validationEventHandler); - if (reader.ReadState == ReadState.Initial) - reader.ReadNextElement (); + if (sreader.ReadState == ReadState.Initial) + sreader.ReadNextElement (); - int startDepth = reader.Depth; + int startDepth = sreader.Depth; do { - switch(reader.NodeType) + switch(sreader.NodeType) { case XmlNodeType.Element: - if(reader.LocalName == "schema") + if(sreader.LocalName == "schema") { XmlSchema schema = new XmlSchema (); - schema.nameTable = rdr.NameTable; + schema.nameTable = reader.NameTable; - schema.LineNumber = reader.LineNumber; - schema.LinePosition = reader.LinePosition; - schema.SourceUri = reader.BaseURI; + schema.LineNumber = sreader.LineNumber; + schema.LinePosition = sreader.LinePosition; + schema.SourceUri = sreader.BaseURI; - ReadAttributes(schema, reader, validationEventHandler); + ReadAttributes(schema, sreader, validationEventHandler); //IsEmptyElement does not behave properly if reader is //positioned at an attribute. - reader.MoveToElement(); - if(!reader.IsEmptyElement) + sreader.MoveToElement(); + if(!sreader.IsEmptyElement) { - ReadContent(schema, reader, validationEventHandler); + ReadContent(schema, sreader, validationEventHandler); } else - rdr.Skip (); + reader.Skip (); return schema; } @@ -746,7 +738,7 @@ namespace System.Xml.Schema error(validationEventHandler, "This should never happen. XmlSchema.Read 1 ",null); break; } - } while(reader.Depth > startDepth && reader.ReadNextElement()); + } while(sreader.Depth > startDepth && sreader.ReadNextElement()); // This is thrown regardless of ValidationEventHandler existence. throw new XmlSchemaException ("The top level schema must have namespace " + XmlSchema.Namespace, null); diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs index 8b724c53009..e7884254b65 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs @@ -53,8 +53,8 @@ namespace System.Xml.Schema { } - public XmlSchemaCollection (XmlNameTable nameTable) - : this (new XmlSchemaSet (nameTable)) + public XmlSchemaCollection (XmlNameTable nametable) + : this (new XmlSchemaSet (nametable)) { schemaSet.ValidationEventHandler += new ValidationEventHandler (OnValidationError); } @@ -99,11 +99,7 @@ namespace System.Xml.Schema return Add (ns, reader, new XmlUrlResolver ()); } -#if NET_1_1 public XmlSchema Add (string ns, XmlReader reader, XmlResolver resolver) -#else - internal XmlSchema Add (string ns, XmlReader reader, XmlResolver resolver) -#endif { XmlSchema schema = XmlSchema.Read (reader, ValidationEventHandler); if (schema.TargetNamespace == null) diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs index 772d2ca8d5c..849185b7a4e 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs @@ -79,7 +79,7 @@ namespace System.Xml.Schema } [MonoTODO] - public virtual object ChangeType (object value, Type targetType, IXmlNamespaceResolver nsResolver) + public virtual object ChangeType (object value, Type targetType, IXmlNamespaceResolver namespaceResolver) { throw new NotImplementedException (); } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInference.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInference.cs index 7d0ee9b2063..381ea3ae371 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInference.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInference.cs @@ -97,15 +97,15 @@ namespace System.Xml.Schema set { typeInference = value; } } - public XmlSchemaSet InferSchema (XmlReader xmlReader) + public XmlSchemaSet InferSchema (XmlReader instanceDocument) { - return InferSchema (xmlReader, new XmlSchemaSet ()); + return InferSchema (instanceDocument, new XmlSchemaSet ()); } - public XmlSchemaSet InferSchema (XmlReader xmlReader, + public XmlSchemaSet InferSchema (XmlReader instanceDocument, XmlSchemaSet schemas) { - return XsdInference.Process (xmlReader, schemas, + return XsdInference.Process (instanceDocument, schemas, occurrence == InferenceOption.Relaxed, typeInference == InferenceOption.Relaxed); } @@ -169,9 +169,6 @@ namespace System.Xml.Schema static readonly QName QNameDecimal = new QName ( "decimal", XmlSchema.Namespace); - static readonly QName QNameUDecimal = new QName ( - "unsignedDecimal", XmlSchema.Namespace); - static readonly QName QNameDouble = new QName ( "double", XmlSchema.Namespace); diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInferenceException.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInferenceException.cs index 4153172a0bb..b1ceafbdcfd 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInferenceException.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInferenceException.cs @@ -63,8 +63,8 @@ namespace System.Xml.Schema } public XmlSchemaInferenceException (string message, - Exception innerException, int line, int column) - : base (message, innerException, line, column) + Exception innerException, int lineNumber, int linePosition) + : base (message, innerException, lineNumber, linePosition) { } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs index d82afab5213..11ad6b3a4a2 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs @@ -128,11 +128,11 @@ namespace System.Xml.Schema #endif } - public XmlSchema Add (string targetNamespace, string url) + public XmlSchema Add (string targetNamespace, string schemaUri) { XmlTextReader r = null; try { - r = new XmlTextReader (url, nameTable); + r = new XmlTextReader (schemaUri, nameTable); return Add (targetNamespace, r); } finally { if (r != null) @@ -140,9 +140,9 @@ namespace System.Xml.Schema } } - public XmlSchema Add (string targetNamespace, XmlReader reader) + public XmlSchema Add (string targetNamespace, XmlReader schemaDocument) { - XmlSchema schema = XmlSchema.Read (reader, ValidationEventHandler); + XmlSchema schema = XmlSchema.Read (schemaDocument, ValidationEventHandler); if (schema.TargetNamespace == null) schema.TargetNamespace = targetNamespace == String.Empty ? null : targetNamespace; // this weirdness is due to bug #571660. else if (targetNamespace != null && schema.TargetNamespace != targetNamespace) @@ -153,11 +153,11 @@ namespace System.Xml.Schema [MonoTODO] // FIXME: Check the exact behavior when namespaces are in conflict (but it would be preferable to wait for 2.0 RTM) - public void Add (XmlSchemaSet schemaSet) + public void Add (XmlSchemaSet schemas) { ArrayList al = new ArrayList (); - foreach (XmlSchema schema in schemaSet.schemas) { - if (!schemas.Contains (schema)) + foreach (XmlSchema schema in schemas.schemas) { + if (!this.schemas.Contains (schema)) al.Add (schema); } foreach (XmlSchema schema in al) @@ -246,17 +246,17 @@ namespace System.Xml.Schema return false; } - public bool Contains (XmlSchema targetNamespace) + public bool Contains (XmlSchema schema) { - foreach (XmlSchema schema in schemas) - if (schema == targetNamespace) + foreach (XmlSchema s in schemas) + if (s == schema) return true; return false; } - public void CopyTo (XmlSchema [] array, int index) + public void CopyTo (XmlSchema [] schemas, int index) { - schemas.CopyTo (array, index); + this.schemas.CopyTo (schemas, index); } internal void CopyTo (Array array, int index) @@ -294,16 +294,16 @@ namespace System.Xml.Schema ClearGlobalComponents (); } - public bool RemoveRecursive (XmlSchema schema) + public bool RemoveRecursive (XmlSchema schemaToRemove) { - if (schema == null) + if (schemaToRemove == null) throw new ArgumentNullException ("schema"); ArrayList al = new ArrayList (); al.AddRange (schemas); - if (!al.Contains (schema)) + if (!al.Contains (schemaToRemove)) return false; - al.Remove (schema); - schemas.Remove (schema); + al.Remove (schemaToRemove); + schemas.Remove (schemaToRemove); if (!IsCompiled) return true; @@ -311,7 +311,7 @@ namespace System.Xml.Schema ClearGlobalComponents (); foreach (XmlSchema s in al) { if (s.IsCompiled) - AddGlobalComponents (schema); + AddGlobalComponents (schemaToRemove); } return true; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs index a7d52536b57..a4cacf74181 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs @@ -188,9 +188,9 @@ namespace System.Xml.Schema } #if NET_2_0 - public static XmlSchemaComplexType GetBuiltInComplexType (XmlTypeCode type) + public static XmlSchemaComplexType GetBuiltInComplexType (XmlTypeCode typeCode) { - switch (type) { + switch (typeCode) { case XmlTypeCode.Item: return XmlSchemaComplexType.AnyType; } @@ -326,9 +326,9 @@ namespace System.Xml.Schema [MonoTODO] // Don't use this method to cover all XML Schema datatypes. - public static XmlSchemaSimpleType GetBuiltInSimpleType (XmlTypeCode type) + public static XmlSchemaSimpleType GetBuiltInSimpleType (XmlTypeCode typeCode) { - switch (type) { + switch (typeCode) { case XmlTypeCode.None: case XmlTypeCode.Item: case XmlTypeCode.Node: diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidationException.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidationException.cs index 66f65f0d9fa..cad3be4395a 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidationException.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidationException.cs @@ -94,9 +94,9 @@ namespace System.Xml.Schema } // Never use it. It actually does nothing even on MS.NET 2.0. - protected internal void SetSourceObject (object o) + protected internal void SetSourceObject (object sourceObject) { - source_object = o; + this.source_object = sourceObject; } public object SourceObject { diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs index d2d25a437b2..f3e1ec59f8b 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs @@ -96,13 +96,13 @@ namespace System.Xml.Schema public XmlSchemaValidator ( XmlNameTable nameTable, XmlSchemaSet schemas, - IXmlNamespaceResolver nsResolver, - ValidationFlags options) + IXmlNamespaceResolver namespaceResolver, + ValidationFlags validationFlags) { this.nameTable = nameTable; this.schemas = schemas; - this.nsResolver = nsResolver; - this.options = options; + this.nsResolver = namespaceResolver; + this.options = validationFlags; } #region Fields @@ -262,19 +262,19 @@ namespace System.Xml.Schema typeof (XmlSchemaParticle)); } - public void GetUnspecifiedDefaultAttributes (ArrayList defaultAttributeList) + public void GetUnspecifiedDefaultAttributes (ArrayList defaultAttributes) { - if (defaultAttributeList == null) - throw new ArgumentNullException ("defaultAttributeList"); + if (defaultAttributes == null) + throw new ArgumentNullException ("defaultAttributes"); if (transition != Transition.StartTag) throw new InvalidOperationException ("Method 'GetUnsoecifiedDefaultAttributes' works only when the validator state is inside a start tag."); foreach (XmlSchemaAttribute attr in GetExpectedAttributes ()) if (attr.ValidatedDefaultValue != null || attr.ValidatedFixedValue != null) - defaultAttributeList.Add (attr); + defaultAttributes.Add (attr); - defaultAttributeList.AddRange (defaultAttributes); + defaultAttributes.AddRange (defaultAttributes); } // State Controller @@ -324,7 +324,7 @@ namespace System.Xml.Schema // I guess it is for validation error recovery [MonoTODO] // FIXME: Find out how XmlSchemaInfo is used. - public void SkipToEndElement (XmlSchemaInfo info) + public void SkipToEndElement (XmlSchemaInfo schemaInfo) { CheckState (Transition.Content); if (schemas.Count == 0) @@ -334,13 +334,13 @@ namespace System.Xml.Schema public object ValidateAttribute ( string localName, - string ns, + string namespaceUri, string attributeValue, - XmlSchemaInfo info) + XmlSchemaInfo schemaInfo) { if (attributeValue == null) throw new ArgumentNullException ("attributeValue"); - return ValidateAttribute (localName, ns, delegate () { return attributeValue; }, info); + return ValidateAttribute (localName, namespaceUri, delegate () { return attributeValue; }, schemaInfo); } // I guess this weird XmlValueGetter is for such case that @@ -351,18 +351,18 @@ namespace System.Xml.Schema // AttDeriv public object ValidateAttribute ( string localName, - string ns, + string namespaceUri, XmlValueGetter attributeValue, - XmlSchemaInfo info) + XmlSchemaInfo schemaInfo) { if (localName == null) throw new ArgumentNullException ("localName"); - if (ns == null) - throw new ArgumentNullException ("ns"); + if (namespaceUri == null) + throw new ArgumentNullException ("namespaceUri"); if (attributeValue == null) throw new ArgumentNullException ("attributeValue"); - SetCurrentInfo (info); + SetCurrentInfo (schemaInfo); try { bool wasInitial = initial; @@ -371,12 +371,12 @@ namespace System.Xml.Schema else CheckState (Transition.StartTag); - QName qname = new QName (localName, ns); + QName qname = new QName (localName, namespaceUri); if (occuredAtts.Contains (qname)) throw new InvalidOperationException (String.Format ("Attribute '{0}' has already been validated in the same element.", qname)); occuredAtts.Add (qname); - if (ns == XmlNamespaceManager.XmlnsXmlns) + if (namespaceUri == XmlNamespaceManager.XmlnsXmlns) return null; if (schemas.Count == 0) @@ -386,14 +386,14 @@ namespace System.Xml.Schema var xa = startType as XmlSchemaAttribute; if (xa == null) return null; - return AssessAttributeLocallyValid (xa, info, attributeValue); + return AssessAttributeLocallyValid (xa, schemaInfo, attributeValue); } if (Context.Element != null && Context.XsiType == null) { // 3.3.4 Element Locally Valid (Type) - attribute if (Context.ActualType is ComplexType) - return AssessAttributeElementLocallyValidType (localName, ns, attributeValue, info); + return AssessAttributeElementLocallyValidType (localName, namespaceUri, attributeValue, schemaInfo); else HandleError ("Current simple type cannot accept attributes other than schema instance namespace."); } @@ -407,37 +407,37 @@ namespace System.Xml.Schema // StartTagOpenDeriv public void ValidateElement ( string localName, - string ns, - XmlSchemaInfo info) + string namespaceUri, + XmlSchemaInfo schemaInfo) { - ValidateElement (localName, ns, info, null, null, null, null); + ValidateElement (localName, namespaceUri, schemaInfo, null, null, null, null); } public void ValidateElement ( string localName, - string ns, - XmlSchemaInfo info, + string namespaceUri, + XmlSchemaInfo schemaInfo, string xsiType, string xsiNil, - string schemaLocation, - string noNsSchemaLocation) + string xsiSchemaLocation, + string xsiNoNamespaceSchemaLocation) { if (localName == null) throw new ArgumentNullException ("localName"); - if (ns == null) - throw new ArgumentNullException ("ns"); - SetCurrentInfo (info); + if (namespaceUri == null) + throw new ArgumentNullException ("namespaceUri"); + SetCurrentInfo (schemaInfo); try { CheckState (Transition.Content); transition = Transition.StartTag; - if (schemaLocation != null) - HandleSchemaLocation (schemaLocation); - if (noNsSchemaLocation != null) - HandleNoNSSchemaLocation (noNsSchemaLocation); + if (xsiSchemaLocation != null) + HandleSchemaLocation (xsiSchemaLocation); + if (xsiNoNamespaceSchemaLocation != null) + HandleNoNSSchemaLocation (xsiNoNamespaceSchemaLocation); - elementQNameStack.Add (new XmlQualifiedName (localName, ns)); + elementQNameStack.Add (new XmlQualifiedName (localName, namespaceUri)); if (schemas.Count == 0) return; @@ -453,24 +453,24 @@ namespace System.Xml.Schema if (shouldValidateCharacters) ValidateEndSimpleContent (null, null); - AssessOpenStartElementSchemaValidity (localName, ns); + AssessOpenStartElementSchemaValidity (localName, namespaceUri); } if (xsiNil != null) - HandleXsiNil (xsiNil, info); + HandleXsiNil (xsiNil, schemaInfo); if (xsiType != null) HandleXsiType (xsiType); if (xsiNilDepth < depth) shouldValidateCharacters = true; - if (info != null) { - info.IsNil = xsiNilDepth >= 0; - info.SchemaElement = Context.Element; - info.SchemaType = Context.ActualSchemaType; - info.SchemaAttribute = null; - info.IsDefault = false; - info.MemberType = null; + if (schemaInfo != null) { + schemaInfo.IsNil = xsiNilDepth >= 0; + schemaInfo.SchemaElement = Context.Element; + schemaInfo.SchemaType = Context.ActualSchemaType; + schemaInfo.SchemaAttribute = null; + schemaInfo.IsDefault = false; + schemaInfo.MemberType = null; // FIXME: supply Validity (really useful?) } @@ -479,9 +479,9 @@ namespace System.Xml.Schema } } - public object ValidateEndElement (XmlSchemaInfo info) + public object ValidateEndElement (XmlSchemaInfo schemaInfo) { - return ValidateEndElement (info, null); + return ValidateEndElement (schemaInfo, null); } // The return value is typed primitive, if supplied. @@ -489,17 +489,17 @@ namespace System.Xml.Schema // represented by current simple content type. (try passing // some kind of object to this method to check the behavior.) // EndTagDeriv - public object ValidateEndElement (XmlSchemaInfo info, - object var) + public object ValidateEndElement (XmlSchemaInfo schemaInfo, + object typedValue) { - SetCurrentInfo (info); + SetCurrentInfo (schemaInfo); try { // If it is going to validate an empty element, then // first validate end of attributes. if (transition == Transition.StartTag) { current_info = null; - ValidateEndOfAttributes (info); + ValidateEndOfAttributes (schemaInfo); } CheckState (Transition.Content); @@ -517,7 +517,7 @@ namespace System.Xml.Schema if (depth == skipValidationDepth) skipValidationDepth = -1; else if (skipValidationDepth < 0 || depth <= skipValidationDepth) - ret = AssessEndElementSchemaValidity (info, var); + ret = AssessEndElementSchemaValidity (schemaInfo, typedValue); return ret; } finally { @@ -527,10 +527,10 @@ namespace System.Xml.Schema // StartTagCloseDeriv // FIXME: fill validity inside this invocation. - public void ValidateEndOfAttributes (XmlSchemaInfo info) + public void ValidateEndOfAttributes (XmlSchemaInfo schemaInfo) { try { - SetCurrentInfo (info); + SetCurrentInfo (schemaInfo); CheckState (Transition.StartTag); transition = Transition.Content; @@ -538,7 +538,7 @@ namespace System.Xml.Schema return; if (skipValidationDepth < 0 || depth <= skipValidationDepth) - AssessCloseStartElementSchemaValidity (info); + AssessCloseStartElementSchemaValidity (schemaInfo); depth++; } finally { current_info = null; @@ -549,19 +549,19 @@ namespace System.Xml.Schema // LAMESPEC: It should also receive XmlSchemaInfo so that // a validator application can receive simple type or // or content type validation errors. - public void ValidateText (string value) + public void ValidateText (string elementValue) { - if (value == null) - throw new ArgumentNullException ("value"); - ValidateText (delegate () { return value; }); + if (elementValue == null) + throw new ArgumentNullException ("elementValue"); + ValidateText (delegate () { return elementValue; }); } // TextDeriv ... without text. Maybe typed check is done by // ValidateAtomicValue(). - public void ValidateText (XmlValueGetter getter) + public void ValidateText (XmlValueGetter elementValue) { - if (getter == null) - throw new ArgumentNullException ("getter"); + if (elementValue == null) + throw new ArgumentNullException ("elementValue"); CheckState (Transition.Content); if (schemas.Count == 0) @@ -584,20 +584,20 @@ namespace System.Xml.Schema } } - ValidateCharacters (getter); + ValidateCharacters (elementValue); } - public void ValidateWhitespace (string value) + public void ValidateWhitespace (string elementValue) { - if (value == null) - throw new ArgumentNullException ("value"); - ValidateWhitespace (delegate () { return value; }); + if (elementValue == null) + throw new ArgumentNullException ("elementValue"); + ValidateWhitespace (delegate () { return elementValue; }); } // TextDeriv. It should do the same as ValidateText() in our actual implementation (whitespaces are conditioned). - public void ValidateWhitespace (XmlValueGetter getter) + public void ValidateWhitespace (XmlValueGetter elementValue) { - ValidateText (getter); + ValidateText (elementValue); } #endregion diff --git a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs b/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs index cd672880ebf..20bfcf120eb 100644 --- a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs +++ b/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs @@ -50,8 +50,8 @@ namespace System.Xml.Serialization.Advanced bool mixed, XmlSchemas schemas, XmlSchemaImporter importer, - CodeCompileUnit codeCompileUnit, - CodeNamespace codeNamespace, + CodeCompileUnit compileUnit, + CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider ) @@ -69,8 +69,8 @@ namespace System.Xml.Serialization.Advanced XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, - CodeCompileUnit codeCompileUnit, - CodeNamespace codeNamespace, + CodeCompileUnit compileUnit, + CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider ) @@ -84,8 +84,8 @@ namespace System.Xml.Serialization.Advanced XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, - CodeCompileUnit codeCompileUnit, - CodeNamespace codeNamespace, + CodeCompileUnit compileUnit, + CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider ) diff --git a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs b/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs index 08309acbede..4f27ac436c5 100644 --- a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs +++ b/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs @@ -53,20 +53,20 @@ namespace System.Xml.Serialization.Advanced return List.Add (extension); } - public int Add (string key, Type type) + public int Add (string name, Type type) { - if (key == null) - throw new ArgumentNullException ("key"); + if (name == null) + throw new ArgumentNullException ("name"); if (type == null) throw new ArgumentNullException ("type"); if (!type.IsSubclassOf (typeof (SchemaImporterExtension))) throw new ArgumentException ("The type argument must be subclass of SchemaImporterExtension."); SchemaImporterExtension e = (SchemaImporterExtension) Activator.CreateInstance (type); - if (named_items.ContainsKey (key)) - throw new InvalidOperationException (String.Format ("A SchemaImporterExtension keyed by '{0}' already exists.", key)); + if (named_items.ContainsKey (name)) + throw new InvalidOperationException (String.Format ("A SchemaImporterExtension keyed by '{0}' already exists.", name)); int ret = Add (e); - named_items.Add (key, e); + named_items.Add (name, e); return ret; } diff --git a/mcs/class/System.XML/System.Xml.Serialization/MapCodeGenerator.cs b/mcs/class/System.XML/System.Xml.Serialization/MapCodeGenerator.cs index afd732cebbe..ed06d61a688 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/MapCodeGenerator.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/MapCodeGenerator.cs @@ -44,9 +44,9 @@ namespace System.Xml.Serialization { internal class MapCodeGenerator { CodeNamespace codeNamespace; - CodeCompileUnit codeCompileUnit; +// CodeCompileUnit codeCompileUnit; CodeAttributeDeclarationCollection includeMetadata; - XmlTypeMapping exportedAnyType = null; + XmlTypeMapping exportedAnyType; protected bool includeArrayTypes; #if NET_2_0 CodeDomProvider codeProvider; @@ -59,7 +59,7 @@ namespace System.Xml.Serialization { public MapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeGenerationOptions options) { - this.codeCompileUnit = codeCompileUnit; +// this.codeCompileUnit = codeCompileUnit; this.codeNamespace = codeNamespace; this.options = options; this.identifiers = new CodeIdentifiers (); @@ -67,7 +67,7 @@ namespace System.Xml.Serialization { public MapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeDomProvider codeProvider, CodeGenerationOptions options, Hashtable mappings) { - this.codeCompileUnit = codeCompileUnit; +// this.codeCompileUnit = codeCompileUnit; this.codeNamespace = codeNamespace; this.options = options; #if NET_2_0 diff --git a/mcs/class/System.XML/System.Xml.Serialization/SerializationSource.cs b/mcs/class/System.XML/System.Xml.Serialization/SerializationSource.cs index 0ecac0ee0bc..dfbaf783fa4 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/SerializationSource.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/SerializationSource.cs @@ -149,7 +149,7 @@ namespace System.Xml.Serialization string elementName; bool hasWrapperElement; string membersHash; - bool writeAccessors; +// bool writeAccessors; bool literalFormat; public MembersSerializationSource (string elementName, bool hasWrapperElement, XmlReflectionMember [] members, bool writeAccessors, @@ -158,7 +158,7 @@ namespace System.Xml.Serialization { this.elementName = elementName; this.hasWrapperElement = hasWrapperElement; - this.writeAccessors = writeAccessors; +// this.writeAccessors = writeAccessors; this.literalFormat = literalFormat; StringBuilder sb = new StringBuilder (); diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs index 3109f1eedb3..bfb360d03ca 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs @@ -48,9 +48,9 @@ namespace System.Xml.Serialization { } - public SoapAttributeAttribute (string attrName) + public SoapAttributeAttribute (string attributeName) { - this.attrName = attrName; + this.attrName = attributeName; } public string AttributeName { diff --git a/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs b/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs index 68afc6e9a87..49cb789696d 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs @@ -167,8 +167,11 @@ namespace System.Xml.Serialization return GetTypeData (type, null); } - public static TypeData GetTypeData (Type runtimeType, string xmlDataType) + public static TypeData GetTypeData (Type runtimeType, string xmlDataType, bool underlyingEnumType = false) { + if (underlyingEnumType && runtimeType.IsEnum) + runtimeType = Enum.GetUnderlyingType (runtimeType); + Type type = runtimeType; bool nullableOverride = false; #if NET_2_0 diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlCodeExporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlCodeExporter.cs index e13d60807f8..f5ab65c318f 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlCodeExporter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlCodeExporter.cs @@ -114,16 +114,16 @@ namespace System.Xml.Serialization AddMappingMetadata (metadata, member, ns, false); } - public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlTypeMapping member, string ns) + public void AddMappingMetadata (CodeAttributeDeclarationCollection metadata, XmlTypeMapping mapping, string ns) { - if ( (member.TypeData.SchemaType == SchemaTypes.Primitive || - member.TypeData.SchemaType == SchemaTypes.Array) - && member.Namespace != XmlSchema.Namespace) + if ( (mapping.TypeData.SchemaType == SchemaTypes.Primitive || + mapping.TypeData.SchemaType == SchemaTypes.Array) + && mapping.Namespace != XmlSchema.Namespace) { CodeAttributeDeclaration ratt = new CodeAttributeDeclaration ("System.Xml.Serialization.XmlRoot"); - ratt.Arguments.Add (MapCodeGenerator.GetArg (member.ElementName)); - ratt.Arguments.Add (MapCodeGenerator.GetArg ("Namespace", member.Namespace)); - ratt.Arguments.Add (MapCodeGenerator.GetArg ("IsNullable", member.IsNullable)); + ratt.Arguments.Add (MapCodeGenerator.GetArg (mapping.ElementName)); + ratt.Arguments.Add (MapCodeGenerator.GetArg ("Namespace", mapping.Namespace)); + ratt.Arguments.Add (MapCodeGenerator.GetArg ("IsNullable", mapping.IsNullable)); metadata.Add (ratt); } } diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs index 44158f5dd5d..dca5ac50d47 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs @@ -272,11 +272,11 @@ namespace System.Xml.Serialization { case "char": return (char)XmlConvert.ToInt32 (value); #if NET_2_0 case "dateTime": return XmlConvert.ToDateTime (value, XmlDateTimeSerializationMode.RoundtripKind); - case "date": return DateTime.ParseExact (value, "yyyy-MM-dd", null); + case "date": return XmlConvert.ToDateTime (value).Date; case "time": return DateTime.ParseExact (value, "HH:mm:ss.FFFFFFF", null); #else case "dateTime": return XmlConvert.ToDateTime (value); - case "date": return DateTime.ParseExact (value, "yyyy-MM-dd", null); + case "date": return XmlConvert.ToDateTime (value).Date; case "time": return DateTime.ParseExact (value, "HH:mm:ss.fffffffzzz", null); #endif case "decimal": return XmlConvert.ToDecimal (value); @@ -375,11 +375,11 @@ namespace System.Xml.Serialization { case "char": return "(char)Int32.Parse (" + value + ", CultureInfo.InvariantCulture)"; #if NET_2_0 case "dateTime": return "XmlConvert.ToDateTime (" + value + ", XmlDateTimeSerializationMode.RoundtripKind)"; - case "date": return "DateTime.ParseExact (" + value + ", \"yyyy-MM-dd\", CultureInfo.InvariantCulture)"; + case "date": return "XmlConvert.ToDateTime (" + value + ").Date"; case "time": return "DateTime.ParseExact (" + value + ", \"HH:mm:ss.FFFFFFF\", CultureInfo.InvariantCulture)"; #else case "dateTime": return "XmlConvert.ToDateTime (" + value + ")"; - case "date": return "DateTime.ParseExact (" + value + ", \"yyyy-MM-dd\", CultureInfo.InvariantCulture)"; + case "date": return "XmlConvert.ToDateTime (" + value + ").Date"; case "time": return "DateTime.ParseExact (" + value + ", \"HH:mm:ss.fffffffzzz\", CultureInfo.InvariantCulture)"; #endif case "decimal": return "Decimal.Parse (" + value + ", CultureInfo.InvariantCulture)"; diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlMemberMapping.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlMemberMapping.cs index 3e1228f6cee..e61c599490b 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlMemberMapping.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlMemberMapping.cs @@ -122,7 +122,6 @@ namespace System.Xml.Serialization get { return _form; } } -#if NET_2_0 public string XsdElementName { get { return _mapMember.Name; } @@ -135,15 +134,11 @@ namespace System.Xml.Serialization "System.Nullable`1[" + ret + "]" : ret; } #endif -#endif -#if NET_1_1 public bool CheckSpecified { get { return _mapMember.IsOptionalValueType; } } -#endif - #endregion // Properties } } diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs index dffae294ea4..ce274821b43 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs @@ -118,9 +118,9 @@ namespace System.Xml.Serialization { string ns, XmlReflectionMember[] members, bool hasWrapperElement, - bool writeAccessors) + bool rpc) { - return ImportMembersMapping (elementName, ns, members, hasWrapperElement, writeAccessors, true); + return ImportMembersMapping (elementName, ns, members, hasWrapperElement, rpc, true); } #if NET_2_0 @@ -131,10 +131,10 @@ namespace System.Xml.Serialization { string ns, XmlReflectionMember[] members, bool hasWrapperElement, - bool writeAccessors, - bool validate) + bool rpc, + bool openModel) { - return ImportMembersMapping (elementName, ns, members, hasWrapperElement, writeAccessors, validate, XmlMappingAccess.Read | XmlMappingAccess.Write); + return ImportMembersMapping (elementName, ns, members, hasWrapperElement, rpc, openModel, XmlMappingAccess.Read | XmlMappingAccess.Write); } #if NET_2_0 @@ -145,8 +145,8 @@ namespace System.Xml.Serialization { string ns, XmlReflectionMember[] members, bool hasWrapperElement, - bool writeAccessors, - bool validate, + bool rpc, + bool openModel, XmlMappingAccess access) { // Reset (); Disabled. See ChangeLog @@ -181,9 +181,9 @@ namespace System.Xml.Serialization { return ImportTypeMapping (type, null, defaultNamespace); } - public XmlTypeMapping ImportTypeMapping (Type type, XmlRootAttribute group) + public XmlTypeMapping ImportTypeMapping (Type type, XmlRootAttribute root) { - return ImportTypeMapping (type, group, null); + return ImportTypeMapping (type, root, null); } public XmlTypeMapping ImportTypeMapping (Type type, XmlRootAttribute root, string defaultNamespace) diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs index b9dcde908ef..61f300cfb85 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs @@ -43,7 +43,7 @@ namespace System.Xml.Serialization { private string dataType; private string elementName; - private bool isNullable = true, isNullableSpecified; + private bool isNullable = true; private string ns; public XmlRootAttribute () @@ -78,15 +78,10 @@ namespace System.Xml.Serialization public bool IsNullable { get { return isNullable; } set { - isNullableSpecified = true; isNullable = value; } } - - public bool IsNullableSpecified { - get { return isNullableSpecified; } - } - + public string Namespace { get { return ns; } set { ns = value; } diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs index ec37b2f303e..fdcbc0e186f 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs @@ -62,9 +62,7 @@ namespace System.Xml.Serialization SoapReflectionImporter auxSoapRefImporter; bool anyTypeImported; -#if NET_2_0 - CodeGenerationOptions options; -#endif +// CodeGenerationOptions options; static readonly XmlQualifiedName anyType = new XmlQualifiedName ("anyType",XmlSchema.Namespace); static readonly XmlQualifiedName arrayType = new XmlQualifiedName ("Array",XmlSerializer.EncodingNamespace); @@ -99,13 +97,12 @@ namespace System.Xml.Serialization this.typeIdentifiers = typeIdentifiers; } -#if NET_2_0 #if !TARGET_JVM && !MOBILE [MonoTODO] public XmlSchemaImporter (XmlSchemas schemas, CodeGenerationOptions options, CodeDomProvider codeProvider, ImportContext context) { this.schemas = schemas; - this.options = options; +// this.options = options; if (context != null) { typeIdentifiers = context.TypeIdentifiers; InitSharedData (context); @@ -115,12 +112,12 @@ namespace System.Xml.Serialization InitializeExtensions (); } -#endif + [MonoTODO] public XmlSchemaImporter (XmlSchemas schemas, CodeGenerationOptions options, ImportContext context) { this.schemas = schemas; - this.options = options; +// this.options = options; if (context != null) { typeIdentifiers = context.TypeIdentifiers; InitSharedData (context); @@ -131,12 +128,12 @@ namespace System.Xml.Serialization InitializeExtensions (); } - + [MonoTODO] public XmlSchemaImporter (XmlSchemas schemas, CodeIdentifiers typeIdentifiers, CodeGenerationOptions options) { this.typeIdentifiers = typeIdentifiers; this.schemas = schemas; - this.options = options; +// this.options = options; InitializeExtensions (); } diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs index 24a4c228ca0..604a9113bfc 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs @@ -757,9 +757,9 @@ namespace System.Xml.Serialization return (value + reader.ReadString ()); } - protected object ReadTypedPrimitive (XmlQualifiedName qname) + protected object ReadTypedPrimitive (XmlQualifiedName type) { - return ReadTypedPrimitive (qname, false); + return ReadTypedPrimitive (type, false); } object ReadTypedPrimitive (XmlQualifiedName qname, bool reportUnknown) diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs index 890d22022d9..7ea8d1ec215 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs @@ -500,14 +500,14 @@ namespace System.Xml.Serialization WriteAttribute ("id", GetId (o, true)); } - protected void WriteNamespaceDeclarations (XmlSerializerNamespaces ns) + protected void WriteNamespaceDeclarations (XmlSerializerNamespaces xmlns) { - if (ns == null) + if (xmlns == null) return; #if MOONLIGHT IEnumerable namespaces = ns.GetNamespaces (); #else - ICollection namespaces = ns.Namespaces.Values; + ICollection namespaces = xmlns.Namespaces.Values; #endif foreach (XmlQualifiedName qn in namespaces) { if (qn.Namespace != String.Empty && Writer.LookupPrefix (qn.Namespace) != qn.Name) @@ -587,11 +587,7 @@ namespace System.Xml.Serialization protected void WriteNullTagEncoded (string name, string ns) { Writer.WriteStartElement (name, ns); -#if NET_1_1 Writer.WriteAttributeString ("nil", XmlSchema.InstanceNamespace, "true"); -#else - Writer.WriteAttributeString ("null", XmlSchema.InstanceNamespace, "1"); -#endif Writer.WriteEndElement (); } @@ -630,19 +626,21 @@ namespace System.Xml.Serialization return; } + var t = o.GetType (); + WriteStartElement (n, ns, true); CheckReferenceQueue (); if (callbacks != null && callbacks.ContainsKey (o.GetType ())) { - WriteCallbackInfo info = (WriteCallbackInfo) callbacks[o.GetType()]; - if (o.GetType ().IsEnum) { + WriteCallbackInfo info = (WriteCallbackInfo) callbacks[t]; + if (t.IsEnum) { info.Callback (o); } else if (suppressReference) { Writer.WriteAttributeString ("id", GetId (o, false)); - if (ambientType != o.GetType ()) WriteXsiType(info.TypeName, info.TypeNs); + if (ambientType != t) WriteXsiType(info.TypeName, info.TypeNs); info.Callback (o); } else { @@ -653,15 +651,17 @@ namespace System.Xml.Serialization else { // Must be a primitive type or array of primitives - TypeData td = TypeTranslator.GetTypeData (o.GetType ()); + TypeData td = TypeTranslator.GetTypeData (t, null, true); if (td.SchemaType == SchemaTypes.Primitive) { - WriteXsiType (td.XmlType, XmlSchema.Namespace); + if (t != ambientType) + WriteXsiType (td.XmlType, XmlSchema.Namespace); Writer.WriteString (XmlCustomFormatter.ToXmlString (td, o)); } else if (IsPrimitiveArray (td)) { if (!AlreadyQueued (o)) referencedElements.Enqueue (o); Writer.WriteAttributeString ("href", "#" + GetId (o, true)); - } else - throw new InvalidOperationException ("Invalid type: " + o.GetType().FullName); + } else { + throw new InvalidOperationException ("Invalid type: " + t.FullName); + } } WriteEndElement (); @@ -891,7 +891,7 @@ namespace System.Xml.Serialization protected void WriteTypedPrimitive (string name, string ns, object o, bool xsiType) { string value; - TypeData td = TypeTranslator.GetTypeData (o.GetType ()); + TypeData td = TypeTranslator.GetTypeData (o.GetType (), null, true); if (td.SchemaType != SchemaTypes.Primitive) throw new InvalidOperationException (String.Format ("The type of the argument object '{0}' is not primitive.", td.FullTypeName)); @@ -977,9 +977,9 @@ namespace System.Xml.Serialization return CreateInvalidAnyTypeException (o.GetType ()); } - protected Exception CreateInvalidAnyTypeException (Type t) + protected Exception CreateInvalidAnyTypeException (Type type) { - return new InvalidOperationException (String.Format ("An object of type '{0}' is invalid as anyType in XmlSerializer", t)); + return new InvalidOperationException (String.Format ("An object of type '{0}' is invalid as anyType in XmlSerializer", type)); } protected Exception CreateInvalidEnumValueException (object value, string typeName) diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs index 326fcd8b268..19947fa599b 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs @@ -397,11 +397,11 @@ namespace System.Xml.Serialization return sers; } - public static XmlSerializer [] FromTypes (Type [] mappings) + public static XmlSerializer [] FromTypes (Type [] types) { - XmlSerializer [] sers = new XmlSerializer [mappings.Length]; - for (int n=0; n GetNamespacesInScope (XmlNamespaceScope scope) @@ -786,7 +786,7 @@ namespace System.Xml.XPath #else internal #endif - virtual string LookupPrefix (string namespaceUri) + virtual string LookupPrefix (string namespaceURI) { XPathNavigator nav = Clone (); if (nav.NodeType != XPathNodeType.Element) @@ -794,7 +794,7 @@ namespace System.Xml.XPath if (!nav.MoveToFirstNamespace ()) return null; do { - if (nav.Value == namespaceUri) + if (nav.Value == namespaceURI) return nav.Name; } while (nav.MoveToNextNamespace ()); return null; @@ -982,9 +982,9 @@ namespace System.Xml.XPath } } - public virtual XPathNodeIterator Select (string xpath, IXmlNamespaceResolver nsResolver) + public virtual XPathNodeIterator Select (string xpath, IXmlNamespaceResolver resolver) { - return Select (Compile (xpath), nsResolver); + return Select (Compile (xpath), resolver); } public virtual XPathNavigator SelectSingleNode (string xpath) @@ -992,10 +992,10 @@ namespace System.Xml.XPath return SelectSingleNode (xpath, null); } - public virtual XPathNavigator SelectSingleNode (string xpath, IXmlNamespaceResolver nsResolver) + public virtual XPathNavigator SelectSingleNode (string xpath, IXmlNamespaceResolver resolver) { XPathExpression expr = Compile (xpath); - expr.SetContext (nsResolver); + expr.SetContext (resolver); return SelectSingleNode (expr); } @@ -1009,9 +1009,9 @@ namespace System.Xml.XPath } // it is not very effective code but should just work - public override object ValueAs (Type type, IXmlNamespaceResolver nsResolver) + public override object ValueAs (Type returnType, IXmlNamespaceResolver nsResolver) { - return new XmlAtomicValue (Value, XmlSchemaSimpleType.XsString).ValueAs (type, nsResolver); + return new XmlAtomicValue (Value, XmlSchemaSimpleType.XsString).ValueAs (returnType, nsResolver); } public virtual void WriteSubtree (XmlWriter writer) @@ -1229,30 +1229,30 @@ namespace System.Xml.XPath } public virtual void AppendChild ( - string xmlFragments) + string newChild) { - AppendChild (CreateFragmentReader (xmlFragments)); + AppendChild (CreateFragmentReader (newChild)); } public virtual void AppendChild ( - XmlReader reader) + XmlReader newChild) { XmlWriter w = AppendChild (); - while (!reader.EOF) - w.WriteNode (reader, false); + while (!newChild.EOF) + w.WriteNode (newChild, false); w.Close (); } public virtual void AppendChild ( - XPathNavigator nav) + XPathNavigator newChild) { - AppendChild (new XPathNavigatorReader (nav)); + AppendChild (new XPathNavigatorReader (newChild)); } - public virtual void AppendChildElement (string prefix, string name, string ns, string value) + public virtual void AppendChildElement (string prefix, string localName, string namespaceURI, string value) { XmlWriter xw = AppendChild (); - xw.WriteStartElement (prefix, name, ns); + xw.WriteStartElement (prefix, localName, namespaceURI); xw.WriteString (value); xw.WriteEndElement (); xw.Close (); @@ -1278,12 +1278,12 @@ namespace System.Xml.XPath } // must override it. - public virtual void DeleteRange (XPathNavigator nav) + public virtual void DeleteRange (XPathNavigator lastSiblingToDelete) { throw new NotSupportedException (); } - public virtual XmlWriter ReplaceRange (XPathNavigator nav) + public virtual XmlWriter ReplaceRange (XPathNavigator lastSiblingToReplace) { throw new NotSupportedException (); } @@ -1305,21 +1305,21 @@ namespace System.Xml.XPath throw new InvalidOperationException ("Could not move to parent to insert sibling node"); } - public virtual void InsertAfter (string xmlFragments) + public virtual void InsertAfter (string newSibling) { - InsertAfter (CreateFragmentReader (xmlFragments)); + InsertAfter (CreateFragmentReader (newSibling)); } - public virtual void InsertAfter (XmlReader reader) + public virtual void InsertAfter (XmlReader newSibling) { using (XmlWriter w = InsertAfter ()) { - w.WriteNode (reader, false); + w.WriteNode (newSibling, false); } } - public virtual void InsertAfter (XPathNavigator nav) + public virtual void InsertAfter (XPathNavigator newSibling) { - InsertAfter (new XPathNavigatorReader (nav)); + InsertAfter (new XPathNavigatorReader (newSibling)); } public virtual XmlWriter InsertBefore () @@ -1327,21 +1327,21 @@ namespace System.Xml.XPath throw new NotSupportedException (); } - public virtual void InsertBefore (string xmlFragments) + public virtual void InsertBefore (string newSibling) { - InsertBefore (CreateFragmentReader (xmlFragments)); + InsertBefore (CreateFragmentReader (newSibling)); } - public virtual void InsertBefore (XmlReader reader) + public virtual void InsertBefore (XmlReader newSibling) { using (XmlWriter w = InsertBefore ()) { - w.WriteNode (reader, false); + w.WriteNode (newSibling, false); } } - public virtual void InsertBefore (XPathNavigator nav) + public virtual void InsertBefore (XPathNavigator newSibling) { - InsertBefore (new XPathNavigatorReader (nav)); + InsertBefore (new XPathNavigatorReader (newSibling)); } public virtual void InsertElementAfter (string prefix, @@ -1369,21 +1369,21 @@ namespace System.Xml.XPath return AppendChild (); } - public virtual void PrependChild (string xmlFragments) + public virtual void PrependChild (string newChild) { - PrependChild (CreateFragmentReader (xmlFragments)); + PrependChild (CreateFragmentReader (newChild)); } - public virtual void PrependChild (XmlReader reader) + public virtual void PrependChild (XmlReader newChild) { using (XmlWriter w = PrependChild ()) { - w.WriteNode (reader, false); + w.WriteNode (newChild, false); } } - public virtual void PrependChild (XPathNavigator nav) + public virtual void PrependChild (XPathNavigator newChild) { - PrependChild (new XPathNavigatorReader (nav)); + PrependChild (new XPathNavigatorReader (newChild)); } public virtual void PrependChildElement (string prefix, @@ -1394,25 +1394,25 @@ namespace System.Xml.XPath } } - public virtual void ReplaceSelf (string xmlFragment) + public virtual void ReplaceSelf (string newNode) { - ReplaceSelf (CreateFragmentReader (xmlFragment)); + ReplaceSelf (CreateFragmentReader (newNode)); } // must override it. - public virtual void ReplaceSelf (XmlReader reader) + public virtual void ReplaceSelf (XmlReader newNode) { throw new NotSupportedException (); } - public virtual void ReplaceSelf (XPathNavigator navigator) + public virtual void ReplaceSelf (XPathNavigator newNode) { - ReplaceSelf (new XPathNavigatorReader (navigator)); + ReplaceSelf (new XPathNavigatorReader (newNode)); } // Dunno the exact purpose, but maybe internal editor use [MonoTODO] - public virtual void SetTypedValue (object value) + public virtual void SetTypedValue (object typedValue) { throw new NotSupportedException (); } diff --git a/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform.cs b/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform.cs index 3500e44c0b7..efe7a6cf2d7 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.CodeDom.Compiler; using System.Collections; @@ -81,76 +79,76 @@ namespace System.Xml.Xsl #region Transform - public void Transform (string inputfile, string outputfile) + public void Transform (string inputUri, string resultsFile) { - using (Stream outStream = File.Create (outputfile)) { - Transform (new XPathDocument (inputfile, XmlSpace.Preserve), null, outStream); + using (Stream outStream = File.Create (resultsFile)) { + Transform (new XPathDocument (inputUri, XmlSpace.Preserve), null, outStream); } } - public void Transform (string inputfile, XmlWriter output) + public void Transform (string inputUri, XmlWriter results) { - Transform (inputfile, null, output); + Transform (inputUri, null, results); } - public void Transform (string inputfile, XsltArgumentList args, Stream output) + public void Transform (string inputUri, XsltArgumentList arguments, Stream results) { - Transform (new XPathDocument (inputfile, XmlSpace.Preserve), args, output); + Transform (new XPathDocument (inputUri, XmlSpace.Preserve), arguments, results); } - public void Transform (string inputfile, XsltArgumentList args, TextWriter output) + public void Transform (string inputUri, XsltArgumentList arguments, TextWriter results) { - Transform (new XPathDocument (inputfile, XmlSpace.Preserve), args, output); + Transform (new XPathDocument (inputUri, XmlSpace.Preserve), arguments, results); } - public void Transform (string inputfile, XsltArgumentList args, XmlWriter output) + public void Transform (string inputUri, XsltArgumentList arguments, XmlWriter results) { - Transform (new XPathDocument (inputfile, XmlSpace.Preserve), args, output); + Transform (new XPathDocument (inputUri, XmlSpace.Preserve), arguments, results); } - public void Transform (XmlReader reader, XmlWriter output) + public void Transform (XmlReader input, XmlWriter results) { - Transform (reader, null, output); + Transform (input, null, results); } - public void Transform (XmlReader reader, XsltArgumentList args, Stream output) + public void Transform (XmlReader input, XsltArgumentList arguments, Stream results) { - Transform (new XPathDocument (reader, XmlSpace.Preserve), args, output); + Transform (new XPathDocument (input, XmlSpace.Preserve), arguments, results); } - public void Transform (XmlReader reader, XsltArgumentList args, TextWriter output) + public void Transform (XmlReader input, XsltArgumentList arguments, TextWriter results) { - Transform (new XPathDocument (reader, XmlSpace.Preserve), args, output); + Transform (new XPathDocument (input, XmlSpace.Preserve), arguments, results); } - public void Transform (XmlReader reader, XsltArgumentList args, XmlWriter output) + public void Transform (XmlReader input, XsltArgumentList arguments, XmlWriter results) { - Transform (reader, args, output, null); + Transform (input, arguments, results, null); } - public void Transform (IXPathNavigable input, XsltArgumentList args, TextWriter output) + public void Transform (IXPathNavigable input, XsltArgumentList arguments, TextWriter results) { - Transform (input.CreateNavigator (), args, output); + Transform (input.CreateNavigator (), arguments, results); } - public void Transform (IXPathNavigable input, XsltArgumentList args, Stream output) + public void Transform (IXPathNavigable input, XsltArgumentList arguments, Stream results) { - Transform (input.CreateNavigator (), args, output); + Transform (input.CreateNavigator (), arguments, results); } - public void Transform (IXPathNavigable input, XmlWriter output) + public void Transform (IXPathNavigable input, XmlWriter results) { - Transform (input, null, output); + Transform (input, null, results); } - public void Transform (IXPathNavigable input, XsltArgumentList args, XmlWriter output) + public void Transform (IXPathNavigable input, XsltArgumentList arguments, XmlWriter results) { - Transform (input.CreateNavigator (), args, output, null); + Transform (input.CreateNavigator (), arguments, results, null); } - public void Transform (XmlReader input, XsltArgumentList args, XmlWriter output, XmlResolver resolver) + public void Transform (XmlReader input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) { - Transform (new XPathDocument (input, XmlSpace.Preserve).CreateNavigator (), args, output, resolver); + Transform (new XPathDocument (input, XmlSpace.Preserve).CreateNavigator (), arguments, results, documentResolver); } void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output, XmlResolver resolver) @@ -197,9 +195,9 @@ namespace System.Xml.Xsl return xvr; } - public void Load (string url) + public void Load (string stylesheetUri) { - using (XmlReader r = GetXmlReader (url)) { + using (XmlReader r = GetXmlReader (stylesheetUri)) { Load (r); } } @@ -214,25 +212,25 @@ namespace System.Xml.Xsl Load (stylesheet.CreateNavigator(), null, null); } - public void Load (IXPathNavigable stylesheet, XsltSettings settings, XmlResolver resolver) + public void Load (IXPathNavigable stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) { - Load (stylesheet.CreateNavigator(), settings, resolver); + Load (stylesheet.CreateNavigator(), settings, stylesheetResolver); } - public void Load (XmlReader stylesheet, XsltSettings settings, XmlResolver resolver) + public void Load (XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) { - Load (new XPathDocument (stylesheet, XmlSpace.Preserve).CreateNavigator (), settings, resolver); + Load (new XPathDocument (stylesheet, XmlSpace.Preserve).CreateNavigator (), settings, stylesheetResolver); } - public void Load (string stylesheet, XsltSettings settings, XmlResolver resolver) + public void Load (string stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver) { - Load (new XPathDocument (stylesheet, XmlSpace.Preserve).CreateNavigator (), settings, resolver); + Load (new XPathDocument (stylesheetUri, XmlSpace.Preserve).CreateNavigator (), settings, stylesheetResolver); } private void Load (XPathNavigator stylesheet, - XsltSettings settings, XmlResolver resolver) + XsltSettings settings, XmlResolver stylesheetResolver) { - s = new Compiler (debugger).Compile (stylesheet, resolver, null); + s = new Compiler (debugger).Compile (stylesheet, stylesheetResolver, null); } #endregion @@ -257,4 +255,3 @@ namespace System.Xml.Xsl */ } } -#endif diff --git a/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs b/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs index a83b7ee80bc..a3c2c5a70d3 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs @@ -64,6 +64,7 @@ namespace System.Xml.Xsl { } } + [Obsolete] public sealed class XslTransform { internal static readonly bool TemplateStackFrameError; @@ -111,10 +112,6 @@ namespace System.Xml.Xsl { XmlResolver xmlResolver = new XmlUrlResolver (); [MonoTODO] // FIXME: audit security check -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public XmlResolver XmlResolver { set { xmlResolver = value; @@ -122,37 +119,22 @@ namespace System.Xml.Xsl { } #region Transform -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public XmlReader Transform (IXPathNavigable input, XsltArgumentList args) { return Transform (input.CreateNavigator (), args, xmlResolver); } -#if NET_1_1 public XmlReader Transform (IXPathNavigable input, XsltArgumentList args, XmlResolver resolver) -#else - XmlReader Transform (IXPathNavigable input, XsltArgumentList args, XmlResolver resolver) -#endif { return Transform (input.CreateNavigator (), args, resolver); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public XmlReader Transform (XPathNavigator input, XsltArgumentList args) { return Transform (input, args, xmlResolver); } -#if NET_1_1 + public XmlReader Transform (XPathNavigator input, XsltArgumentList args, XmlResolver resolver) -#else - XmlReader Transform (XPathNavigator input, XsltArgumentList args, XmlResolver resolver) -#endif { // todo: is this right? MemoryStream stream = new MemoryStream (); @@ -161,70 +143,41 @@ namespace System.Xml.Xsl { return new XmlTextReader (stream, XmlNodeType.Element, null); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (IXPathNavigable input, XsltArgumentList args, TextWriter output) { Transform (input.CreateNavigator (), args, output, xmlResolver); } -#if NET_1_1 + public void Transform (IXPathNavigable input, XsltArgumentList args, TextWriter output, XmlResolver resolver) -#else - void Transform (IXPathNavigable input, XsltArgumentList args, TextWriter output, XmlResolver resolver) -#endif { Transform (input.CreateNavigator (), args, output, resolver); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (IXPathNavigable input, XsltArgumentList args, Stream output) { Transform (input.CreateNavigator (), args, output, xmlResolver); } -#if NET_1_1 public void Transform (IXPathNavigable input, XsltArgumentList args, Stream output, XmlResolver resolver) -#else - void Transform (IXPathNavigable input, XsltArgumentList args, Stream output, XmlResolver resolver) -#endif { Transform (input.CreateNavigator (), args, output, resolver); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (IXPathNavigable input, XsltArgumentList args, XmlWriter output) { Transform (input.CreateNavigator (), args, output, xmlResolver); } -#if NET_1_1 + public void Transform (IXPathNavigable input, XsltArgumentList args, XmlWriter output, XmlResolver resolver) -#else - void Transform (IXPathNavigable input, XsltArgumentList args, XmlWriter output, XmlResolver resolver) -#endif { Transform (input.CreateNavigator (), args, output, resolver); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output) { Transform (input, args, output, xmlResolver); } -#if NET_1_1 + public void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output, XmlResolver resolver) -#else - void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output, XmlResolver resolver) -#endif { if (s == null) throw new XsltException ("No stylesheet was loaded.", null); @@ -234,37 +187,22 @@ namespace System.Xml.Xsl { output.Flush (); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (XPathNavigator input, XsltArgumentList args, Stream output) { Transform (input, args, output, xmlResolver); } -#if NET_1_1 public void Transform (XPathNavigator input, XsltArgumentList args, Stream output, XmlResolver resolver) -#else - void Transform (XPathNavigator input, XsltArgumentList args, Stream output, XmlResolver resolver) -#endif { XslOutput xslOutput = (XslOutput)s.Outputs[String.Empty]; Transform (input, args, new StreamWriter (output, xslOutput.Encoding), resolver); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output) { Transform (input, args, output, xmlResolver); } -#if NET_1_1 + public void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver) -#else - void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver) -#endif { if (s == null) throw new XsltException ("No stylesheet was loaded.", null); @@ -275,20 +213,12 @@ namespace System.Xml.Xsl { output.Flush (); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete ("You should pass XmlResolver to Transform() method", false)] -#endif public void Transform (string inputfile, string outputfile) { Transform (inputfile, outputfile, xmlResolver); } -#if NET_1_1 public void Transform (string inputfile, string outputfile, XmlResolver resolver) -#else - void Transform (string inputfile, string outputfile, XmlResolver resolver) -#endif { using (Stream s = new FileStream (outputfile, FileMode.Create, FileAccess.ReadWrite)) { Transform(new XPathDocument (inputfile).CreateNavigator (), null, s, resolver); @@ -318,84 +248,48 @@ namespace System.Xml.Xsl { } } -#if NET_2_0 -#elif NET_1_1 - [Obsolete("You should pass evidence.", false)] -#endif public void Load (XmlReader stylesheet) { Load (stylesheet, null, null); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete("You should pass evidence.", false)] -#endif public void Load (XmlReader stylesheet, XmlResolver resolver) { Load (stylesheet, resolver, null); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete("You should pass evidence.", false)] -#endif public void Load (XPathNavigator stylesheet) { Load (stylesheet, null, null); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete("You should pass evidence.", false)] -#endif public void Load (XPathNavigator stylesheet, XmlResolver resolver) { Load (stylesheet, resolver, null); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete("You should pass evidence.", false)] -#endif public void Load (IXPathNavigable stylesheet) { Load (stylesheet.CreateNavigator(), null); } -#if NET_2_0 -#elif NET_1_1 - [Obsolete("You should pass evidence.", false)] -#endif public void Load (IXPathNavigable stylesheet, XmlResolver resolver) { Load (stylesheet.CreateNavigator(), resolver); } // Introduced in .NET 1.1 -#if NET_1_1 public void Load (IXPathNavigable stylesheet, XmlResolver resolver, Evidence evidence) -#else - internal void Load (IXPathNavigable stylesheet, XmlResolver resolver, Evidence evidence) -#endif { Load (stylesheet.CreateNavigator(), resolver, evidence); } -#if NET_1_1 public void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence) -#else - internal void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence) -#endif { s = new Compiler (debugger).Compile (stylesheet, resolver, evidence); } -#if NET_1_1 public void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence) -#else - internal void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence) -#endif { Load (new XPathDocument (stylesheet, XmlSpace.Preserve).CreateNavigator (), resolver, evidence); } diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs index 4a7e712a715..db01ad9f5e5 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs @@ -30,9 +30,6 @@ using System.Xml.XPath; namespace System.Xml.Xsl { -#if !NET_2_0 - sealed -#endif public class XsltArgumentList { #region Fields @@ -53,11 +50,12 @@ namespace System.Xml.Xsl #endregion #region Event -#if NET_2_0 +#pragma warning disable 67 + [MonoTODO] public event XsltMessageEncounteredEventHandler XsltMessageEncountered; +#pragma warning restore 67 -#endif #endregion #region Methods diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs index c739bc9a23e..c24b21d8a89 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs @@ -40,7 +40,6 @@ namespace System.Xml.Xsl { #region Constructors -#if NET_2_0 public XsltCompileException () { } @@ -54,7 +53,6 @@ namespace System.Xml.Xsl : base (message, innerException) { } -#endif protected XsltCompileException (SerializationInfo info, StreamingContext context ) : base (info, context) @@ -62,12 +60,8 @@ namespace System.Xml.Xsl } public XsltCompileException (Exception inner, String sourceUri, int lineNumber, int linePosition) -#if NET_2_0 : base (lineNumber != 0 ? "{0} at {1}({2},{3}). See InnerException for details." : "{0}.", "XSLT compile error", inner, lineNumber, linePosition, sourceUri) -#else - : base ("{0}{1}({2},{3}) :\n", string.Empty, inner, lineNumber, linePosition, sourceUri) -#endif { } @@ -77,17 +71,6 @@ namespace System.Xml.Xsl } #endregion - #region Properties - -#if NET_2_0 -#else - public override string Message { - get { return base.Message; } - } -#endif - - #endregion - #region Methods [SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)] diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs index 5dbdef680b1..fea825ac41f 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs @@ -33,22 +33,12 @@ namespace System.Xml.Xsl public abstract class XsltContext : XmlNamespaceManager { #region Constructors -#if NET_2_0 - protected -#else - public -#endif - XsltContext () + protected XsltContext () : base (new NameTable ()) { } -#if NET_2_0 - protected -#else - public -#endif - XsltContext (NameTable table) + protected XsltContext (NameTable table) : base (table) { } @@ -58,14 +48,14 @@ namespace System.Xml.Xsl #region Properties public abstract bool Whitespace { get; } - public abstract bool PreserveWhitespace (XPathNavigator nav); + public abstract bool PreserveWhitespace (XPathNavigator node); #endregion #region Methods public abstract int CompareDocument (string baseUri, string nextbaseUri); - public abstract IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType [] argTypes); + public abstract IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType [] ArgTypes); public abstract IXsltContextVariable ResolveVariable (string prefix, string name); #endregion diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs index f8b44a6e174..6645dae2b4b 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs @@ -70,7 +70,6 @@ namespace System.Xml.Xsl #region Constructors -#if NET_2_0 public XsltException () : this (string.Empty, (Exception) null) { @@ -80,7 +79,6 @@ namespace System.Xml.Xsl : this (message, (Exception) null) { } -#endif public XsltException (string message, Exception innerException) : this ("{0}", message, innerException, 0, 0, (string) null) @@ -116,19 +114,11 @@ namespace System.Xml.Xsl #region Properties -#if NET_2_0 public virtual int LineNumber { -#else - public int LineNumber { -#endif get { return lineNumber; } } -#if NET_2_0 public virtual int LinePosition { -#else - public int LinePosition { -#endif get { return linePosition; } } @@ -138,11 +128,7 @@ namespace System.Xml.Xsl } } -#if NET_2_0 public virtual string SourceUri { -#else - public string SourceUri { -#endif get { return sourceUri; } } diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventArgs.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventArgs.cs index ea82f63915d..2d2345ba0ef 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventArgs.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventArgs.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; @@ -42,4 +41,3 @@ namespace System.Xml.Xsl } } } -#endif diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventHandler.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventHandler.cs index 5ba123ec9bf..021d9542778 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventHandler.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltMessageEncounteredEventHandler.cs @@ -27,10 +27,9 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + namespace System.Xml.Xsl { public delegate void XsltMessageEncounteredEventHandler ( Object sender, XsltMessageEncounteredEventArgs e); } -#endif diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltSettings.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltSettings.cs index cb4b741f605..86838e4b1e0 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XsltSettings.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XsltSettings.cs @@ -27,7 +27,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + namespace System.Xml.Xsl { public sealed class XsltSettings @@ -90,4 +90,3 @@ namespace System.Xml.Xsl } } } -#endif diff --git a/mcs/class/System.XML/System.Xml/ConformanceLevel.cs b/mcs/class/System.XML/System.Xml/ConformanceLevel.cs index d54a6cb5d21..6c21dc49596 100644 --- a/mcs/class/System.XML/System.Xml/ConformanceLevel.cs +++ b/mcs/class/System.XML/System.Xml/ConformanceLevel.cs @@ -25,7 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + namespace System.Xml { public enum ConformanceLevel @@ -35,4 +35,3 @@ namespace System.Xml Document } } -#endif diff --git a/mcs/class/System.XML/System.Xml/EntityResolvingXmlReader.cs b/mcs/class/System.XML/System.Xml/EntityResolvingXmlReader.cs index 2f7fb8c31d6..9fb6e6fb583 100644 --- a/mcs/class/System.XML/System.Xml/EntityResolvingXmlReader.cs +++ b/mcs/class/System.XML/System.Xml/EntityResolvingXmlReader.cs @@ -26,9 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Generic; -#endif using System; using System.Globalization; using System.IO; @@ -40,10 +38,7 @@ using System.Xml; namespace Mono.Xml { [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)] - internal class EntityResolvingXmlReader : XmlReader, -#if NET_2_0 - IXmlNamespaceResolver, -#endif + internal class EntityResolvingXmlReader : XmlReader, IXmlNamespaceResolver, IXmlLineInfo, IHasXmlParserContext { EntityResolvingXmlReader entity; @@ -78,21 +73,6 @@ namespace Mono.Xml get { return entity != null && entity.ReadState != ReadState.Initial ? (XmlReader) entity : source; } } -#if NET_2_0 -#else - public override string this [int i] { - get { return GetAttribute (i); } - } - - public override string this [string name] { - get { return GetAttribute (name); } - } - - public override string this [string localName, string namespaceName] { - get { return GetAttribute (localName, namespaceName); } - } -#endif - public override int AttributeCount { get { return Current.AttributeCount; } } @@ -264,7 +244,6 @@ namespace Mono.Xml return Current.GetAttribute (localName, namespaceURI); } -#if NET_2_0 public IDictionary GetNamespacesInScope (XmlNamespaceScope scope) { return ((IXmlNamespaceResolver) Current).GetNamespacesInScope (scope); @@ -279,7 +258,6 @@ namespace Mono.Xml { return ((IXmlNamespaceResolver) Current).LookupPrefix (ns); } -#endif public override string LookupNamespace (string prefix) { @@ -421,14 +399,9 @@ namespace Mono.Xml return base.ReadString (); } - public override - void ResolveEntity () + public override void ResolveEntity () { -#if NET_2_0 DoResolveEntity (); -#else - do_resolve = true; -#endif } void DoResolveEntity () diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs index 9fc0ce9d74d..120355f5843 100644 --- a/mcs/class/System.XML/System.Xml/XmlElement.cs +++ b/mcs/class/System.XML/System.Xml/XmlElement.cs @@ -36,9 +36,7 @@ using System.Xml.XPath; using System.IO; using System.Text; using Mono.Xml; -#if NET_2_0 using System.Xml.Schema; -#endif namespace System.Xml { @@ -51,9 +49,7 @@ namespace System.Xml XmlLinkedNode lastLinkedChild; private bool isNotEmpty; -#if NET_2_0 IXmlSchemaInfo schemaInfo; -#endif #endregion @@ -218,11 +214,7 @@ namespace System.Xml if (IsReadOnly) throw new ArgumentException ("This node is readonly."); if (value == null) { -#if NET_2_0 value = string.Empty; -#else - throw new ArgumentNullException ("Prefix value is null."); -#endif } if ((!String.Empty.Equals(value))&&(!XmlChar.IsNCName (value))) throw new ArgumentException ("Specified name is not a valid NCName: " + value); @@ -233,7 +225,6 @@ namespace System.Xml } } -#if NET_2_0 public override XmlNode ParentNode { get { return base.ParentNode; } } @@ -242,7 +233,6 @@ namespace System.Xml get { return schemaInfo; } internal set { schemaInfo = value; } } -#endif #endregion diff --git a/mcs/class/System.XML/System.Xml/XmlInputStream.cs b/mcs/class/System.XML/System.Xml/XmlInputStream.cs index 01e0ab0461e..fca7ad4f596 100644 --- a/mcs/class/System.XML/System.Xml/XmlInputStream.cs +++ b/mcs/class/System.XML/System.Xml/XmlInputStream.cs @@ -51,8 +51,6 @@ namespace System.Xml { } - static XmlException invalidDataException = new XmlException ("invalid data."); - public override void Close () { this.input.Close (); @@ -63,15 +61,9 @@ namespace System.Xml try { return base.Read (dest_buffer, index, count); } -#if NET_1_1 catch (System.ArgumentException ex) { throw new XmlException ("Invalid data", ex); } -#else - catch (System.Text.DecoderFallbackException) { - throw invalidDataException; - } -#endif } protected override void Dispose (bool disposing) diff --git a/mcs/class/System.XML/System.Xml/XmlIteratorNodeList.cs b/mcs/class/System.XML/System.Xml/XmlIteratorNodeList.cs index 36735fa5048..e05f92a2ec2 100644 --- a/mcs/class/System.XML/System.Xml/XmlIteratorNodeList.cs +++ b/mcs/class/System.XML/System.Xml/XmlIteratorNodeList.cs @@ -36,11 +36,11 @@ namespace System.Xml { internal class XmlIteratorNodeList : XmlNodeList//, IDisposable { - XmlDocument doc; + //XmlDocument doc; XPathNodeIterator source; XPathNodeIterator iterator; ArrayList list; - bool finished, event_detached; + bool finished; #region Constructors @@ -48,7 +48,7 @@ namespace System.Xml { if (doc == null) throw new Exception ("huh?"); - this.doc = doc; + //this.doc = doc; //doc.NodeRemoving += SaveNodeList; source = iter; iterator = iter.Clone (); diff --git a/mcs/class/System.XML/System.Xml/XmlNode.cs b/mcs/class/System.XML/System.Xml/XmlNode.cs index 47532bc2555..2ec0f1bb12d 100644 --- a/mcs/class/System.XML/System.Xml/XmlNode.cs +++ b/mcs/class/System.XML/System.Xml/XmlNode.cs @@ -36,10 +36,8 @@ using System.Globalization; using System.IO; using System.Text; using System.Xml.XPath; -#if NET_2_0 using System.Diagnostics; using System.Xml.Schema; -#endif namespace System.Xml { @@ -339,12 +337,10 @@ namespace System.Xml } } -#if NET_2_0 public virtual IXmlSchemaInfo SchemaInfo { get { return null; } internal set { } } -#endif #endregion @@ -369,21 +365,12 @@ namespace System.Xml public abstract XmlNode CloneNode (bool deep); -#if NET_2_0 public virtual XPathNavigator CreateNavigator () { // XmlDocument has overriden definition, so it is safe // to use OwnerDocument here. return OwnerDocument.CreateNavigator (this); } -#else - public XPathNavigator CreateNavigator () - { - XmlDocument document = this.NodeType == XmlNodeType.Document ? - this as XmlDocument : this.ownerDocument; - return document.CreateNavigator (this); - } -#endif public IEnumerator GetEnumerator () { @@ -395,12 +382,10 @@ namespace System.Xml switch (prefix) { case null: throw new ArgumentNullException ("prefix"); -#if NET_2_0 case "xml": return XmlNamespaceManager.XmlnsXml; case "xmlns": return XmlNamespaceManager.XmlnsXmlns; -#endif } XmlNode node; @@ -438,14 +423,12 @@ namespace System.Xml public virtual string GetPrefixOfNamespace (string namespaceURI) { -#if NET_2_0 switch (namespaceURI) { case XmlNamespaceManager.XmlnsXml: return XmlNamespaceManager.PrefixXml; case XmlNamespaceManager.XmlnsXmlns: return XmlNamespaceManager.PrefixXmlns; } -#endif XmlNode node; switch (NodeType) { diff --git a/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs b/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs index 033db077a86..84e7ba4fbe1 100644 --- a/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs +++ b/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs @@ -29,10 +29,6 @@ namespace System.Xml { -#if NET_2_0 -#else - [Serializable] -#endif public enum XmlNodeOrder { Before = 0, diff --git a/mcs/class/System.XML/System.Xml/XmlReader.cs b/mcs/class/System.XML/System.Xml/XmlReader.cs index b590dac506c..03e415f7a4c 100644 --- a/mcs/class/System.XML/System.Xml/XmlReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlReader.cs @@ -41,6 +41,10 @@ using System.Xml.Serialization; // only required for NET_2_0 (SchemaInfo) using Mono.Xml.Schema; // only required for NET_2_0 #endif using Mono.Xml; // only required for NET_2_0 +#if NET_4_5 +using System.Threading; +using System.Threading.Tasks; +#endif namespace System.Xml { @@ -236,7 +240,15 @@ namespace System.Xml #region Methods +#if NET_4_5 + public virtual void Close () + { + if (asyncRunning) + throw new InvalidOperationException ("An asynchronous operation is already in progress."); + } +#else public abstract void Close (); +#endif #if NET_2_0 private static XmlNameTable PopulateNameTable ( @@ -306,10 +318,30 @@ namespace System.Xml static XmlReaderSettings PopulateSettings (XmlReaderSettings src) { + XmlReaderSettings copy; + if (src == null) + copy = new XmlReaderSettings (); + else + copy = src.Clone (); +#if NET_4_5 + copy.SetReadOnly (); +#endif + return copy; + } + + static XmlReaderSettings PopulateSettings (XmlReader reader, XmlReaderSettings src) + { + XmlReaderSettings copy; if (src == null) - return new XmlReaderSettings (); + copy = new XmlReaderSettings (); else - return src.Clone (); + copy = src.Clone (); +#if NET_4_5 + if (reader.Settings != null) + copy.Async = reader.Settings.Async; + copy.SetReadOnly (); +#endif + return copy; } public static XmlReader Create (Stream input, XmlReaderSettings settings, string baseUri) @@ -328,7 +360,7 @@ namespace System.Xml public static XmlReader Create (XmlReader reader, XmlReaderSettings settings) { - settings = PopulateSettings (settings); + settings = PopulateSettings (reader, settings); XmlReader r = CreateFilteredXmlReader (reader, settings); r.settings = settings; return r; @@ -464,7 +496,11 @@ namespace System.Xml #endif } - void IDisposable.Dispose () +#if NET_4_0 || MOBILE + public void Dispose () +#else + void IDisposable.Dispose() +#endif { Dispose (false); } @@ -975,6 +1011,13 @@ namespace System.Xml return ReadContentAs (ValueType, null); } +#if NET_4_5 + public virtual DateTimeOffset ReadContentAsDateTimeOffset () + { + return XmlConvert.ToDateTimeOffset (ReadContentString ()); + } +#endif + public virtual object ReadElementContentAs (Type returnType, IXmlNamespaceResolver namespaceResolver) { bool isEmpty = IsEmptyElement; @@ -1357,5 +1400,228 @@ namespace System.Xml } #endif #endregion + +#if NET_4_5 + #region .NET 4.5 Async Methods + + bool asyncRunning; + + void StartAsync () + { + if (!settings.Async) + throw new InvalidOperationException ("Set XmlReaderSettings.Async to true if you want to use Async Methods."); + lock (this) { + if (asyncRunning) + throw new InvalidOperationException ("An asynchronous operation is already in progress."); + asyncRunning = true; + } + } + + public virtual Task ReadAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return Read (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task GetValueAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return Value; + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadInnerXmlAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return ReadInnerXml (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadOuterXmlAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return ReadOuterXml (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadContentAsStringAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return ReadContentAsString (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadContentAsBase64Async (byte[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadContentAsBase64 (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadContentAsBinHexAsync (byte[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadContentAsBinHex (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadElementContentAsBase64Async (byte[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadElementContentAsBase64 (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadElementContentAsBinHexAsync (byte[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadElementContentAsBinHex (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadValueChunkAsync (char[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadValueChunk (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadContentAsAsync (Type returnType, IXmlNamespaceResolver namespaceResolver) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadContentAs (returnType, namespaceResolver); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadContentAsObjectAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return ReadContentAsObject (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadElementContentAsAsync (Type returnType, IXmlNamespaceResolver namespaceResolver) + { + StartAsync (); + return Task.Run (() => { + try { + return ReadElementContentAs (returnType, namespaceResolver); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadElementContentAsObjectAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return ReadElementContentAsObject (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task ReadElementContentAsStringAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return ReadElementContentAsString (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task MoveToContentAsync () + { + StartAsync (); + return Task.Run (() => { + try { + return MoveToContent (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task SkipAsync () + { + StartAsync (); + return Task.Run (() => { + try { + Skip (); + } finally { + asyncRunning = false; + } + }); + } + + #endregion +#endif } } diff --git a/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs b/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs index e4938b1ea8d..324504c6ede 100644 --- a/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs +++ b/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs @@ -58,12 +58,17 @@ namespace System.Xml private ValidationType validationType; #endif private XmlResolver xmlResolver; -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 private DtdProcessing dtdProcessing; #endif private long maxCharactersFromEntities; private long maxCharactersInDocument; +#if NET_4_5 + private bool isReadOnly; + private bool isAsync; +#endif + public XmlReaderSettings () { Reset (); @@ -75,7 +80,11 @@ namespace System.Xml public XmlReaderSettings Clone () { - return (XmlReaderSettings) MemberwiseClone (); + var clone = (XmlReaderSettings) MemberwiseClone (); +#if NET_4_5 + clone.isReadOnly = false; +#endif + return clone; } public void Reset () @@ -99,6 +108,9 @@ namespace System.Xml XsValidationFlags.AllowXmlAttributes; validationType = ValidationType.None; xmlResolver = new XmlUrlResolver (); +#endif +#if NET_4_5 + isAsync = false; #endif } @@ -116,7 +128,7 @@ namespace System.Xml get { return conformance; } set { conformance = value; } } -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 public DtdProcessing DtdProcessing { get { return dtdProcessing; } set { @@ -220,5 +232,30 @@ namespace System.Xml internal get { return xmlResolver; } set { xmlResolver = value; } } + +#if NET_4_5 + internal void SetReadOnly () + { + isReadOnly = true; + } + + /* + * FIXME: The .NET 4.5 runtime throws an exception when attempting to + * modify any of the properties after the XmlReader has been constructed. + */ + void EnsureWritability () + { + if (isReadOnly) + throw new InvalidOperationException ("XmlReaderSettings in read-only"); + } + + public bool Async { + get { return isAsync; } + set { + EnsureWritability (); + isAsync = value; + } + } +#endif } } diff --git a/mcs/class/System.XML/System.Xml/XmlResolver.cs b/mcs/class/System.XML/System.Xml/XmlResolver.cs index 8949225d3bb..6774f5d1f73 100644 --- a/mcs/class/System.XML/System.Xml/XmlResolver.cs +++ b/mcs/class/System.XML/System.Xml/XmlResolver.cs @@ -33,13 +33,22 @@ using System.IO; using System.Net; using System.Security.Permissions; +#if NET_4_5 +using System.Threading.Tasks; +#endif namespace System.Xml { public abstract class XmlResolver { #if !MOONLIGHT +#if NET_4_5 + public virtual ICredentials Credentials { + set { throw new NotImplementedException (); } + } +#else public abstract ICredentials Credentials { set; } +#endif #endif public abstract object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn); @@ -77,7 +86,7 @@ namespace System.Xml .Replace ("%", "%25") .Replace ("\"", "%22"); } -#if MOONLIGHT +#if MOONLIGHT || NET_4_5 public virtual bool SupportsType (Uri absoluteUri, Type type) { if (absoluteUri == null) @@ -85,5 +94,12 @@ namespace System.Xml return ((type == null) || (type == typeof (Stream))); } #endif + +#if NET_4_5 + public virtual Task GetEntityAsync (Uri absoluteUri, string role, Type ofObjectToReturn) + { + throw new NotImplementedException (); + } +#endif } } diff --git a/mcs/class/System.XML/System.Xml/XmlSecureResolver.cs b/mcs/class/System.XML/System.Xml/XmlSecureResolver.cs index 2260d81a0bd..2400c52cb26 100644 --- a/mcs/class/System.XML/System.Xml/XmlSecureResolver.cs +++ b/mcs/class/System.XML/System.Xml/XmlSecureResolver.cs @@ -32,6 +32,9 @@ using System.Net; using System.Security; using System.Security.Policy; using System.Security.Permissions; +#if NET_4_5 +using System.Threading.Tasks; +#endif namespace System.Xml { @@ -131,6 +134,22 @@ namespace System.Xml { return resolver.ResolveUri (baseUri, relativeUri); } + +#if NET_4_5 + public override Task GetEntityAsync ( + Uri absoluteUri, string role, Type ofObjectToReturn) + { + if (SecurityManager.SecurityEnabled) { + // in case the security manager was switched after the constructor was called + if (permissionSet == null) { + throw new SecurityException (Locale.GetText ( + "Security Manager wasn't active when instance was created.")); + } + permissionSet.PermitOnly (); + } + return resolver.GetEntityAsync (absoluteUri, role, ofObjectToReturn); + } +#endif #endregion } diff --git a/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs b/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs index fb67f99329c..ba07ba5695d 100644 --- a/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs +++ b/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs @@ -69,11 +69,9 @@ namespace System.Xml } } -#if NET_2_0 public override XmlNode ParentNode { get { return base.ParentNode; } } -#endif // Methods public override XmlNode CloneNode (bool deep) diff --git a/mcs/class/System.XML/System.Xml/XmlText.cs b/mcs/class/System.XML/System.Xml/XmlText.cs index 21fbd3cc775..710fb6112c5 100644 --- a/mcs/class/System.XML/System.Xml/XmlText.cs +++ b/mcs/class/System.XML/System.Xml/XmlText.cs @@ -69,11 +69,10 @@ namespace System.Xml set { Data = value; } } -#if NET_2_0 public override XmlNode ParentNode { get { return base.ParentNode; } } -#endif + #endregion #region Methods diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs index ae54a23518d..d50d8954cbd 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs @@ -41,32 +41,19 @@ using System; using System.Collections; -#if NET_2_0 using System.Collections.Generic; -#endif using System.Globalization; using System.IO; using System.Security.Permissions; using System.Text; using System.Xml.Schema; using Mono.Xml; - -#if NET_2_0 using System.Xml; namespace Mono.Xml2 -#else -namespace System.Xml -#endif { - -#if NET_2_0 - internal class XmlTextReader : XmlReader, + class XmlTextReader : XmlReader, IXmlLineInfo, IXmlNamespaceResolver, IHasXmlParserContext -#else - [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)] - public class XmlTextReader : XmlReader, IXmlLineInfo, IHasXmlParserContext -#endif { #region Constructors @@ -213,7 +200,6 @@ namespace System.Xml get { return parserContext.BaseURI; } } -#if NET_2_0 public override bool CanReadBinaryContent { get { return true; } } @@ -221,15 +207,6 @@ namespace System.Xml public override bool CanReadValueChunk { get { return true; } } -#else - internal override bool CanReadBinaryContent { - get { return true; } - } - - internal override bool CanReadValueChunk { - get { return true; } - } -#endif internal bool CharacterChecking { get { return checkCharacters; } @@ -258,12 +235,11 @@ namespace System.Xml { get { return parserContext.Encoding; } } -#if NET_2_0 + public EntityHandling EntityHandling { get { return entityHandling; } set { entityHandling = value; } } -#endif public override bool EOF { get { return readState == ReadState.EndOfFile; } @@ -282,21 +258,6 @@ namespace System.Xml get { return cursorToken.IsEmptyElement; } } -#if NET_2_0 -#else - public override string this [int i] { - get { return GetAttribute (i); } - } - - public override string this [string name] { - get { return GetAttribute (name); } - } - - public override string this [string localName, string namespaceName] { - get { return GetAttribute (localName, namespaceName); } - } -#endif - public int LineNumber { get { if (useProceedingLineInfo) @@ -366,11 +327,9 @@ namespace System.Xml get { return readState; } } -#if NET_2_0 public override XmlReaderSettings Settings { get { return base.Settings; } } -#endif public override string Value { get { return cursorToken.Value != null ? cursorToken.Value : String.Empty; } @@ -451,7 +410,6 @@ namespace System.Xml return attributeTokens [idx].Value; } -#if NET_2_0 public IDictionary GetNamespacesInScope (XmlNamespaceScope scope) { return nsmgr.GetNamespacesInScope (scope); @@ -461,7 +419,6 @@ namespace System.Xml { return GetNamespacesInScope (scope); } -#endif public TextReader GetRemainder () { @@ -470,11 +427,7 @@ namespace System.Xml return new StringReader (new string (peekChars, peekCharsIndex, peekCharsLength - peekCharsIndex) + reader.ReadToEnd ()); } -#if NET_2_0 public bool HasLineInfo () -#else - bool IXmlLineInfo.HasLineInfo () -#endif { return true; } @@ -491,7 +444,6 @@ namespace System.Xml return s == String.Empty ? null : s; } -#if NET_2_0 string IXmlNamespaceResolver.LookupPrefix (string ns) { return LookupPrefix (ns, false); @@ -501,7 +453,6 @@ namespace System.Xml { return nsmgr.LookupPrefix (ns, atomizedName); } -#endif public override void MoveToAttribute (int i) { @@ -720,13 +671,11 @@ namespace System.Xml throw new InvalidOperationException ("XmlTextReader cannot resolve external entities."); } -#if NET_2_0 [MonoTODO] // FIXME: Implement, for performance improvement public override void Skip () { base.Skip (); } -#endif #endregion #region Internals @@ -997,10 +946,8 @@ namespace System.Xml #endif checkCharacters = true; -#if NET_2_0 if (Settings != null) checkCharacters = Settings.CheckCharacters; -#endif prohibitDtd = false; closeInput = true; entityHandling = EntityHandling.ExpandCharEntities; @@ -1073,11 +1020,7 @@ namespace System.Xml #else Uri uri = null; try { -#if NET_2_0 uri = new Uri (url, UriKind.RelativeOrAbsolute); -#else - uri = new Uri (url); -#endif } catch (Exception) { string path = Path.GetFullPath ("./a"); uri = new Uri (new Uri (path), url); @@ -1105,7 +1048,6 @@ namespace System.Xml } } -#if NET_2_0 internal ConformanceLevel Conformance { get { return allowMultipleRoot ? ConformanceLevel.Fragment : ConformanceLevel.Document; } set { @@ -1126,7 +1068,6 @@ namespace System.Xml { parserContext.NameTable = nameTable; } -#endif // Use this method rather than setting the properties // directly so that all the necessary properties can @@ -1625,7 +1566,7 @@ namespace System.Xml break; if (whitespacePool == null) whitespacePool = new NameTable (); -#if NET_2_0 && !NET_2_1 +#if !NET_2_1 valueBuffer.CopyTo (0, whitespaceCache, 0, len); #else for (int i = 0; i < len; i++) @@ -1974,14 +1915,11 @@ namespace System.Xml int predefined = XmlChar.GetPredefinedEntity (entName); if (predefined < 0) { CheckAttributeEntityReferenceWFC (entName); -#if NET_2_0 if (entityHandling == EntityHandling.ExpandEntities) { string value = DTD.GenerateEntityAttributeText (entName); foreach (char c in (IEnumerable) value) AppendValueChar (c); - } else -#endif - { + } else { currentAttributeValueToken.ValueBufferEnd = valueBuffer.Length; currentAttributeValueToken.NodeType = XmlNodeType.Text; if (!isNewToken) @@ -2272,13 +2210,11 @@ namespace System.Xml } // Encoding value should be checked inside XmlInputStream. } -#if NET_2_0 // this condition is to check if this instance is // not created by XmlReader.Create() (which just // omits strict text declaration check). else if (Conformance == ConformanceLevel.Auto) throw NotWFError ("Encoding declaration is mandatory in text declaration."); -#endif Expect ("?>"); diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader2.cs b/mcs/class/System.XML/System.Xml/XmlTextReader2.cs index b975f9849e3..2110bb62f17 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextReader2.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextReader2.cs @@ -254,9 +254,11 @@ namespace System.Xml get { return entity != null ? ReadState.Interactive : source.ReadState; } } +#if !NET_4_5 public override XmlReaderSettings Settings { get { return base.Settings; } } +#endif public override string Value { get { return Current.Value; } @@ -497,11 +499,11 @@ namespace System.Xml return true; } - public override bool MoveToAttribute (string localName, string namespaceName) + public override bool MoveToAttribute (string localName, string namespaceURI) { if (entity != null && !entityInsideAttribute) - return entity.MoveToAttribute (localName, namespaceName); - if (!source.MoveToAttribute (localName, namespaceName)) + return entity.MoveToAttribute (localName, namespaceURI); + if (!source.MoveToAttribute (localName, namespaceURI)) return false; if (entity != null && entityInsideAttribute) CloseEntity (); @@ -651,67 +653,67 @@ namespace System.Xml } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public int ReadBase64 (byte [] buffer, int offset, int length) + public int ReadBase64 (byte [] array, int offset, int len) { if (entity != null) - return entity.ReadBase64 (buffer, offset, length); + return entity.ReadBase64 (array, offset, len); else - return source.ReadBase64 (buffer, offset, length); + return source.ReadBase64 (array, offset, len); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public int ReadBinHex (byte [] buffer, int offset, int length) + public int ReadBinHex (byte [] array, int offset, int len) { if (entity != null) - return entity.ReadBinHex (buffer, offset, length); + return entity.ReadBinHex (array, offset, len); else - return source.ReadBinHex (buffer, offset, length); + return source.ReadBinHex (array, offset, len); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public int ReadChars (char [] buffer, int offset, int length) + public int ReadChars (char [] buffer, int index, int count) { if (entity != null) - return entity.ReadChars (buffer, offset, length); + return entity.ReadChars (buffer, index, count); else - return source.ReadChars (buffer, offset, length); + return source.ReadChars (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadContentAsBase64 (byte [] buffer, int offset, int length) + public override int ReadContentAsBase64 (byte [] buffer, int index, int count) { if (entity != null) - return entity.ReadContentAsBase64 (buffer, offset, length); + return entity.ReadContentAsBase64 (buffer, index, count); else - return source.ReadContentAsBase64 (buffer, offset, length); + return source.ReadContentAsBase64 (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadContentAsBinHex (byte [] buffer, int offset, int length) + public override int ReadContentAsBinHex (byte [] buffer, int index, int count) { if (entity != null) - return entity.ReadContentAsBinHex (buffer, offset, length); + return entity.ReadContentAsBinHex (buffer, index, count); else - return source.ReadContentAsBinHex (buffer, offset, length); + return source.ReadContentAsBinHex (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadElementContentAsBase64 (byte [] buffer, int offset, int length) + public override int ReadElementContentAsBase64 (byte [] buffer, int index, int count) { if (entity != null) - return entity.ReadElementContentAsBase64 (buffer, offset, length); + return entity.ReadElementContentAsBase64 (buffer, index, count); else - return source.ReadElementContentAsBase64 (buffer, offset, length); + return source.ReadElementContentAsBase64 (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadElementContentAsBinHex (byte [] buffer, int offset, int length) + public override int ReadElementContentAsBinHex (byte [] buffer, int index, int count) { if (entity != null) - return entity.ReadElementContentAsBinHex (buffer, offset, length); + return entity.ReadElementContentAsBinHex (buffer, index, count); else - return source.ReadElementContentAsBinHex (buffer, offset, length); + return source.ReadElementContentAsBinHex (buffer, index, count); } #endregion } diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs index 008a22366d6..1394a1e7d8b 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs @@ -139,13 +139,7 @@ Here are some implementation notes (mostly common to previous module): closing '>' is written). */ - - -#if NET_1_1 namespace System.Xml -#else -namespace Mono.Xml -#endif { public class XmlTextWriter : XmlWriter { @@ -219,7 +213,7 @@ namespace Mono.Xml XmlDeclState xmldecl_state = XmlDeclState.Allow; bool check_character_validity; - NewLineHandling newline_handling = NewLineHandling.None; + NewLineHandling newline_handling = NewLineHandling.Replace; bool is_document_entity; WriteState state = WriteState.Start; @@ -250,8 +244,8 @@ namespace Mono.Xml { } - public XmlTextWriter (Stream stream, Encoding encoding) - : this (new StreamWriter (stream, + public XmlTextWriter (Stream w, Encoding encoding) + : this (new StreamWriter (w, encoding == null ? unmarked_utf8encoding : encoding)) { ignore_encoding = (encoding == null); @@ -259,16 +253,15 @@ namespace Mono.Xml allow_doc_fragment = true; } - public XmlTextWriter (TextWriter writer) + public XmlTextWriter (TextWriter w) { - if (writer == null) + if (w == null) throw new ArgumentNullException ("writer"); - ignore_encoding = (writer.Encoding == null); - Initialize (writer); + ignore_encoding = (w.Encoding == null); + Initialize (w); allow_doc_fragment = true; } -#if NET_2_0 internal XmlTextWriter ( TextWriter writer, XmlWriterSettings settings, bool closeOutput) { @@ -277,6 +270,7 @@ namespace Mono.Xml if (settings == null) settings = new XmlWriterSettings (); + newline_handling = settings.NewLineHandling; Initialize (writer); close_output_stream = closeOutput; @@ -309,10 +303,8 @@ namespace Mono.Xml indent_attributes = settings.NewLineOnAttributes; check_character_validity = settings.CheckCharacters; - newline_handling = settings.NewLineHandling; namespace_handling = settings.NamespaceHandling; } -#endif void Initialize (TextWriter writer) { @@ -331,10 +323,11 @@ namespace Mono.Xml new char [] {'&', '<', '>', '\r', '\n'} : new char [] {'&', '<', '>'}; escaped_attr_chars = - new char [] {'"', '&', '<', '>', '\r', '\n'}; + newline_handling != NewLineHandling.None ? + v2 ? new char [] {'"', '&', '<', '>', '\r', '\n', '\t'} : new char [] {'"', '&', '<', '>', '\r', '\n' } : + new char [] {'"', '&', '<', '>' }; } -#if NET_2_0 // 2.0 XmlWriterSettings support // As for ConformanceLevel, MS.NET is inconsistent with @@ -343,8 +336,6 @@ namespace Mono.Xml // result in an error. // ms-help://MS.NETFramework.v20.en/wd_xml/html/7db8802b-53d8-4735-a637-4d2d2158d643.htm -#endif - // Literal Output Control public Formatting Formatting { @@ -405,16 +396,16 @@ namespace Mono.Xml get { return state; } } - public override string LookupPrefix (string namespaceUri) + public override string LookupPrefix (string ns) { - if (namespaceUri == null || namespaceUri == String.Empty) + if (ns == null || ns == String.Empty) throw ArgumentError ("The Namespace cannot be empty."); - if (namespaceUri == nsmanager.DefaultNamespace) + if (ns == nsmanager.DefaultNamespace) return String.Empty; string prefix = nsmanager.LookupPrefixExclusive ( - namespaceUri, false); + ns, false); // XmlNamespaceManager has changed to return null // when NSURI not found. @@ -430,17 +421,12 @@ namespace Mono.Xml public override void Close () { -#if NET_2_0 if (state != WriteState.Error) { -#endif if (state == WriteState.Attribute) WriteEndAttribute (); while (open_count > 0) WriteEndElement (); -#if NET_2_0 } -#endif - if (close_output_stream) writer.Close (); else @@ -515,9 +501,7 @@ namespace Mono.Xml public override void WriteEndDocument () { switch (state) { -#if NET_2_0 case WriteState.Error: -#endif case WriteState.Closed: case WriteState.Start: throw StateError ("EndDocument"); @@ -585,13 +569,9 @@ namespace Mono.Xml // StartElement public override void WriteStartElement ( - string prefix, string localName, string namespaceUri) + string prefix, string localName, string ns) { -#if NET_2_0 if (state == WriteState.Error || state == WriteState.Closed) -#else - if (state == WriteState.Closed) -#endif throw StateError ("StartTag"); node_state = XmlNodeType.Element; @@ -610,7 +590,7 @@ namespace Mono.Xml // not considered. // 4. prefix must not be equivalent to "XML" in // case-insensitive comparison. - if (!namespaces && namespaceUri != null && namespaceUri.Length > 0) + if (!namespaces && ns != null && ns.Length > 0) throw ArgumentError ("Namespace is disabled in this XmlTextWriter."); if (!namespaces && prefix.Length > 0) throw ArgumentError ("Namespace prefix is disabled in this XmlTextWriter."); @@ -618,9 +598,9 @@ namespace Mono.Xml // If namespace URI is empty, then either prefix // must be empty as well, or there is an // existing namespace mapping for the prefix. - if (prefix.Length > 0 && namespaceUri == null) { - namespaceUri = nsmanager.LookupNamespace (prefix, false); - if (namespaceUri == null || namespaceUri.Length == 0) + if (prefix.Length > 0 && ns == null) { + ns = nsmanager.LookupNamespace (prefix, false); + if (ns == null || ns.Length == 0) throw ArgumentError ("Namespace URI must not be null when prefix is not an empty string."); } // Considering the fact that WriteStartAttribute() @@ -628,7 +608,7 @@ namespace Mono.Xml // is kind of silly implementation. See bug #77094. if (namespaces && prefix != null && prefix.Length == 3 && - namespaceUri != XmlNamespace && + ns != XmlNamespace && (prefix [0] == 'x' || prefix [0] == 'X') && (prefix [1] == 'm' || prefix [1] == 'M') && (prefix [2] == 'l' || prefix [2] == 'L')) @@ -644,12 +624,12 @@ namespace Mono.Xml nsmanager.PushScope (); - if (namespaces && namespaceUri != null) { + if (namespaces && ns != null) { // If namespace URI is empty, then prefix must // be empty as well. - if (anonPrefix && namespaceUri.Length > 0) - prefix = LookupPrefix (namespaceUri); - if (prefix == null || namespaceUri.Length == 0) + if (anonPrefix && ns.Length > 0) + prefix = LookupPrefix (ns); + if (prefix == null || ns.Length == 0) prefix = String.Empty; } @@ -674,17 +654,17 @@ namespace Mono.Xml XmlNodeInfo info = elements [open_count]; info.Prefix = prefix; info.LocalName = localName; - info.NS = namespaceUri; + info.NS = ns; info.HasSimple = false; info.HasElements = false; info.XmlLang = XmlLang; info.XmlSpace = XmlSpace; open_count++; - if (namespaces && namespaceUri != null) { + if (namespaces && ns != null) { string oldns = nsmanager.LookupNamespace (prefix, false); - if (oldns != namespaceUri) { - nsmanager.AddNamespace (prefix, namespaceUri); + if (oldns != ns) { + nsmanager.AddNamespace (prefix, ns); new_local_namespaces.Push (prefix); } } @@ -763,11 +743,7 @@ namespace Mono.Xml void WriteEndElementCore (bool full) { -#if NET_2_0 if (state == WriteState.Error || state == WriteState.Closed) -#else - if (state == WriteState.Closed) -#endif throw StateError ("EndElement"); if (open_count == 0) throw InvalidOperation ("There is no more open element."); @@ -808,7 +784,7 @@ namespace Mono.Xml // Attribute public override void WriteStartAttribute ( - string prefix, string localName, string namespaceUri) + string prefix, string localName, string ns) { // LAMESPEC: this violates the expected behavior of // this method, as it incorrectly allows unbalanced @@ -826,7 +802,7 @@ namespace Mono.Xml // For xmlns URI, prefix is forced to be "xmlns" bool isNSDecl = false; - if (namespaceUri == XmlnsNamespace) { + if (ns == XmlnsNamespace) { isNSDecl = true; if (prefix.Length == 0 && localName != "xmlns") prefix = "xmlns"; @@ -840,13 +816,13 @@ namespace Mono.Xml // Regardless of namespace URI it is regarded // as NS URI for "xml". if (prefix == "xml") - namespaceUri = XmlNamespace; + ns = XmlNamespace; // infer namespace URI. - else if ((object) namespaceUri == null || (v2 && namespaceUri.Length == 0)) { + else if ((object) ns == null || (v2 && ns.Length == 0)) { if (isNSDecl) - namespaceUri = XmlnsNamespace; + ns = XmlnsNamespace; else - namespaceUri = String.Empty; + ns = String.Empty; } // It is silly design - null namespace with @@ -854,22 +830,22 @@ namespace Mono.Xml // output; while there is Namespaces property) // On the other hand, namespace "" is not // allowed. - if (isNSDecl && namespaceUri != XmlnsNamespace) + if (isNSDecl && ns != XmlnsNamespace) throw ArgumentError (String.Format ("The 'xmlns' attribute is bound to the reserved namespace '{0}'", XmlnsNamespace)); // If namespace URI is empty, then either prefix // must be empty as well, or there is an // existing namespace mapping for the prefix. - if (prefix.Length > 0 && namespaceUri.Length == 0) { - namespaceUri = nsmanager.LookupNamespace (prefix, false); - if (namespaceUri == null || namespaceUri.Length == 0) + if (prefix.Length > 0 && ns.Length == 0) { + ns = nsmanager.LookupNamespace (prefix, false); + if (ns == null || ns.Length == 0) throw ArgumentError ("Namespace URI must not be null when prefix is not an empty string."); } // Dive into extremely complex procedure. - if (!isNSDecl && namespaceUri.Length > 0) + if (!isNSDecl && ns.Length > 0) prefix = DetermineAttributePrefix ( - prefix, localName, namespaceUri); + prefix, localName, ns); } if (indent_attributes) @@ -1073,20 +1049,20 @@ namespace Mono.Xml // Text Content - public override void WriteWhitespace (string text) + public override void WriteWhitespace (string ws) { - if (text == null) + if (ws == null) throw ArgumentError ("text"); // huh? Shouldn't it accept an empty string??? - if (text.Length == 0 || - XmlChar.IndexOfNonWhitespace (text) >= 0) + if (ws.Length == 0 || + XmlChar.IndexOfNonWhitespace (ws) >= 0) throw ArgumentError ("WriteWhitespace method accepts only whitespaces."); bool pastTopLevelWSIgnored = top_level_space_ignored; ShiftStateTopLevel ("Whitespace", true, false, true); if (!indent || WriteState != WriteState.Prolog || pastTopLevelWSIgnored) - writer.Write (text); + writer.Write (ws); top_level_space_ignored = true; } @@ -1112,9 +1088,9 @@ namespace Mono.Xml WriteEscapedString (text, state == WriteState.Attribute); } - public override void WriteRaw (string raw) + public override void WriteRaw (string data) { - if (raw == null) + if (data == null) return; // do nothing, including state transition. //WriteIndent (); @@ -1123,7 +1099,7 @@ namespace Mono.Xml // DocType which could consist of non well-formed XML. ShiftStateTopLevel ("Raw string", true, true, true); - writer.Write (raw); + writer.Write (data); } public override void WriteCharEntity (char ch) @@ -1131,9 +1107,9 @@ namespace Mono.Xml WriteCharacterEntity (ch, '\0', false); } - public override void WriteSurrogateCharEntity (char low, char high) + public override void WriteSurrogateCharEntity (char lowChar, char highChar) { - WriteCharacterEntity (low, high, true); + WriteCharacterEntity (lowChar, highChar, true); } void WriteCharacterEntity (char ch, char high, bool surrogate) @@ -1178,13 +1154,13 @@ namespace Mono.Xml WriteString (name); } - public override void WriteNmToken (string nmtoken) + public override void WriteNmToken (string name) { - if (nmtoken == null) + if (name == null) throw ArgumentError ("nmtoken"); - if (!XmlChar.IsNmToken (nmtoken)) + if (!XmlChar.IsNmToken (name)) throw ArgumentError ("Not a valid NMTOKEN string."); - WriteString (nmtoken); + WriteString (name); } public override void WriteQualifiedName ( @@ -1307,9 +1283,7 @@ namespace Mono.Xml void ShiftStateTopLevel (string occured, bool allowAttribute, bool dontCheckXmlDecl, bool isCharacter) { switch (state) { -#if NET_2_0 case WriteState.Error: -#endif case WriteState.Closed: throw StateError (occured); case WriteState.Start: @@ -1348,9 +1322,7 @@ namespace Mono.Xml void ShiftStateContent (string occured, bool allowAttribute) { switch (state) { -#if NET_2_0 case WriteState.Error: -#endif case WriteState.Closed: throw StateError (occured); case WriteState.Prolog: @@ -1454,30 +1426,43 @@ namespace Mono.Xml if (isAttribute && text [i] == quote_char) goto case '&'; continue; + case '\t': + if(isAttribute && v2 + && newline_handling != NewLineHandling.None) { + if (start < i) + WriteCheckedBuffer (text, start, i - start); + writer.Write (" "); + } else + continue; + break; case '\r': - if (i + 1 < end && text [i] == '\n') - i++; // CRLF - goto case '\n'; case '\n': + // If no translation was requested, don't change + // anything. + if(newline_handling == NewLineHandling.None) + continue; + // \n is left alone in text if entitizing. + if(!isAttribute + && newline_handling == NewLineHandling.Entitize + && text [i] == '\n') + continue; if (start < i) WriteCheckedBuffer (text, start, i - start); - if (isAttribute) { - writer.Write (text [i] == '\r' ? - " " : " "); - break; - } - switch (newline_handling) { - case NewLineHandling.Entitize: + // Both newline characters in attributes are fully + // entitized for both Entitize and Replace. + if(isAttribute + || newline_handling == NewLineHandling.Entitize) { writer.Write (text [i] == '\r' ? " " : " "); break; - case NewLineHandling.Replace: - writer.Write (newline); - break; - default: - writer.Write (text [i]); - break; } + // By this point the requested behavior must be + // Replace, and the text must not be an attribute + // value. CR, LF and CRLF all get converted to + // the configured newline sequence. + if (text [i] == '\r' && i + 1 < end && text [i + 1] == '\n') + i++; // CRLF + writer.Write (newline); break; } start = i + 1; @@ -1490,25 +1475,19 @@ namespace Mono.Xml Exception ArgumentOutOfRangeError (string name) { -#if NET_2_0 state = WriteState.Error; -#endif return new ArgumentOutOfRangeException (name); } Exception ArgumentError (string msg) { -#if NET_2_0 state = WriteState.Error; -#endif return new ArgumentException (msg); } Exception InvalidOperation (string msg) { -#if NET_2_0 state = WriteState.Error; -#endif return new InvalidOperationException (msg); } diff --git a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs index 9745f5b6f69..66dfcb0e342 100644 --- a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs +++ b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs @@ -30,6 +30,10 @@ using System.Net; using System.IO; using System.Text; +#if NET_4_5 +using System.Net.Cache; +using System.Threading.Tasks; +#endif namespace System.Xml { @@ -37,6 +41,10 @@ namespace System.Xml { // Field ICredentials credential; +#if NET_4_5 + RequestCachePolicy cachePolicy; + IWebProxy proxy; +#endif // Constructor public XmlUrlResolver () @@ -50,6 +58,16 @@ namespace System.Xml set { credential = value; } } +#if NET_4_5 + public RequestCachePolicy CachePolicy { + set { cachePolicy = value; } + } + + public IWebProxy Proxy { + set { proxy = value; } + } +#endif + // Methods public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn) { @@ -71,6 +89,12 @@ namespace System.Xml // (MS documentation says) parameter role isn't used yet. WebRequest req = WebRequest.Create (absoluteUri); +#if NET_4_5 + if (cachePolicy != null) + req.CachePolicy = cachePolicy; + if (proxy != null) + req.Proxy = proxy; +#endif if (credential != null) req.Credentials = credential; return req.GetResponse().GetResponseStream(); @@ -93,5 +117,36 @@ namespace System.Xml .Replace ("%20", " ") .Replace ("%25", "%"); } + +#if NET_4_5 + public override async Task GetEntityAsync ( + Uri absoluteUri, string role, Type ofObjectToReturn) + { + if (ofObjectToReturn == null) + ofObjectToReturn = typeof (Stream); + if (ofObjectToReturn != typeof (Stream)) + throw new XmlException ("This object type is not supported."); + + if (!absoluteUri.IsAbsoluteUri) + throw new ArgumentException ("uri must be absolute.", "absoluteUri"); + + if (absoluteUri.Scheme == "file") { + if (absoluteUri.AbsolutePath == String.Empty) + throw new ArgumentException ("uri must be absolute.", "absoluteUri"); + return new FileStream (UnescapeRelativeUriBody (absoluteUri.LocalPath), FileMode.Open, FileAccess.Read, FileShare.Read); + } + + // (MS documentation says) parameter role isn't used yet. + WebRequest req = WebRequest.Create (absoluteUri); + if (cachePolicy != null) + req.CachePolicy = cachePolicy; + if (proxy != null) + req.Proxy = proxy; + if (credential != null) + req.Credentials = credential; + var res = await req.GetResponseAsync ().ConfigureAwait (false); + return res.GetResponseStream (); + } +#endif } } diff --git a/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs b/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs index de12750f0ab..1d94412e878 100644 --- a/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs @@ -377,9 +377,9 @@ namespace System.Xml return validatingReader == null ? null : validatingReader [name]; } - public override string GetAttribute (string localName, string namespaceName) + public override string GetAttribute (string localName, string namespaceURI) { - return validatingReader == null ? null : validatingReader [localName, namespaceName]; + return validatingReader == null ? null : validatingReader [localName, namespaceURI]; } XmlParserContext IHasXmlParserContext.ParserContext { @@ -446,11 +446,11 @@ namespace System.Xml return validatingReader.MoveToAttribute (name); } - public override bool MoveToAttribute (string localName, string namespaceName) + public override bool MoveToAttribute (string localName, string namespaceURI) { if (validatingReader == null) return false; - return validatingReader.MoveToAttribute (localName, namespaceName); + return validatingReader.MoveToAttribute (localName, namespaceURI); } public override bool MoveToElement () @@ -579,39 +579,39 @@ namespace System.Xml #if NET_2_0 [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadContentAsBase64 (byte [] buffer, int offset, int length) + public override int ReadContentAsBase64 (byte [] buffer, int index, int count) { if (validatingReader != null) - return validatingReader.ReadContentAsBase64 (buffer, offset, length); + return validatingReader.ReadContentAsBase64 (buffer, index, count); else - return sourceReader.ReadContentAsBase64 (buffer, offset, length); + return sourceReader.ReadContentAsBase64 (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadContentAsBinHex (byte [] buffer, int offset, int length) + public override int ReadContentAsBinHex (byte [] buffer, int index, int count) { if (validatingReader != null) - return validatingReader.ReadContentAsBinHex (buffer, offset, length); + return validatingReader.ReadContentAsBinHex (buffer, index, count); else - return sourceReader.ReadContentAsBinHex (buffer, offset, length); + return sourceReader.ReadContentAsBinHex (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadElementContentAsBase64 (byte [] buffer, int offset, int length) + public override int ReadElementContentAsBase64 (byte [] buffer, int index, int count) { if (validatingReader != null) - return validatingReader.ReadElementContentAsBase64 (buffer, offset, length); + return validatingReader.ReadElementContentAsBase64 (buffer, index, count); else - return sourceReader.ReadElementContentAsBase64 (buffer, offset, length); + return sourceReader.ReadElementContentAsBase64 (buffer, index, count); } [MonoTODO] // FIXME: Check how expanded entity is handled here. - public override int ReadElementContentAsBinHex (byte [] buffer, int offset, int length) + public override int ReadElementContentAsBinHex (byte [] buffer, int index, int count) { if (validatingReader != null) - return validatingReader.ReadElementContentAsBinHex (buffer, offset, length); + return validatingReader.ReadElementContentAsBinHex (buffer, index, count); else - return sourceReader.ReadElementContentAsBinHex (buffer, offset, length); + return sourceReader.ReadElementContentAsBinHex (buffer, index, count); } #endif #endregion // Methods diff --git a/mcs/class/System.XML/System.Xml/XmlWriter.cs b/mcs/class/System.XML/System.Xml/XmlWriter.cs index 066e762b792..08fadd6afc1 100755 --- a/mcs/class/System.XML/System.Xml/XmlWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlWriter.cs @@ -38,14 +38,16 @@ using System.Text; #if !MOONLIGHT using System.Xml.XPath; #endif +#if NET_4_5 +using System.Threading; +using System.Threading.Tasks; +#endif namespace System.Xml { public abstract class XmlWriter : IDisposable { -#if NET_2_0 XmlWriterSettings settings; -#endif #region Constructors @@ -55,16 +57,12 @@ namespace System.Xml #region Properties -#if NET_2_0 public virtual XmlWriterSettings Settings { get { return settings; } } -#endif public abstract WriteState WriteState { get; } - -#if NET_2_0 public virtual string XmlLang { get { return null; } } @@ -72,80 +70,85 @@ namespace System.Xml public virtual XmlSpace XmlSpace { get { return XmlSpace.None; } } -#else - public abstract string XmlLang { get; } - - public abstract XmlSpace XmlSpace { get; } -#endif #endregion #region Methods +#if NET_4_5 + public virtual void Close () + { + if (asyncRunning) + throw new InvalidOperationException ("An asynchronous operation is already in progress."); + } +#else public abstract void Close (); +#endif -#if NET_2_0 - public static XmlWriter Create (Stream stream) + public static XmlWriter Create (Stream output) { - return Create (stream, null); + return Create (output, null); } - public static XmlWriter Create (string file) + public static XmlWriter Create (string outputFileName) { - return Create (file, null); + return Create (outputFileName, null); } - public static XmlWriter Create (TextWriter writer) + public static XmlWriter Create (TextWriter output) { - return Create (writer, null); + return Create (output, null); } - public static XmlWriter Create (XmlWriter writer) + public static XmlWriter Create (XmlWriter output) { - return Create (writer, null); + return Create (output, null); } - public static XmlWriter Create (StringBuilder builder) + public static XmlWriter Create (StringBuilder output) { - return Create (builder, null); + return Create (output, null); } - public static XmlWriter Create (Stream stream, XmlWriterSettings settings) + public static XmlWriter Create (Stream output, XmlWriterSettings settings) { Encoding enc = settings != null ? settings.Encoding : Encoding.UTF8; - return Create (new StreamWriter (stream, enc), settings); + return Create (new StreamWriter (output, enc), settings); } - public static XmlWriter Create (string file, XmlWriterSettings settings) + public static XmlWriter Create (string outputFileName, XmlWriterSettings settings) { Encoding enc = settings != null ? settings.Encoding : Encoding.UTF8; - return CreateTextWriter (new StreamWriter (file, false, enc), settings, true); + return CreateTextWriter (new StreamWriter (outputFileName, false, enc), settings, true); } - public static XmlWriter Create (StringBuilder builder, XmlWriterSettings settings) + public static XmlWriter Create (StringBuilder output, XmlWriterSettings settings) { - return Create (new StringWriter (builder), settings); + return Create (new StringWriter (output), settings); } - public static XmlWriter Create (TextWriter writer, XmlWriterSettings settings) + public static XmlWriter Create (TextWriter output, XmlWriterSettings settings) { if (settings == null) settings = new XmlWriterSettings (); - return CreateTextWriter (writer, settings, settings.CloseOutput); + return CreateTextWriter (output, settings, settings.CloseOutput); } - public static XmlWriter Create (XmlWriter writer, XmlWriterSettings settings) + public static XmlWriter Create (XmlWriter output, XmlWriterSettings settings) { if (settings == null) settings = new XmlWriterSettings (); else settings = settings.Clone (); - var src = writer.Settings; + var src = output.Settings; if (src == null) { settings.ConformanceLevel = ConformanceLevel.Document; // Huh? Why?? - writer = new DefaultXmlWriter (writer); - writer.settings = settings; + output = new DefaultXmlWriter (output); +#if NET_4_5 + settings.SetReadOnly (); +#endif + output.settings = settings; } else { ConformanceLevel dst = src.ConformanceLevel; switch (src.ConformanceLevel) { @@ -161,14 +164,18 @@ namespace System.Xml settings.MergeFrom (src); +#if NET_4_5 + settings.SetReadOnly (); +#endif + // It returns a new XmlWriter instance if 1) Settings is null, or 2) Settings ConformanceLevel (or might be other members as well) give significant difference. if (src.ConformanceLevel != dst) { - writer = new DefaultXmlWriter (writer, false); - writer.settings = settings; + output = new DefaultXmlWriter (output, false); + output.settings = settings; } } - return writer; + return output; } private static XmlWriter CreateTextWriter (TextWriter writer, XmlWriterSettings settings, bool closeOutput) @@ -184,11 +191,14 @@ namespace System.Xml Close (); } - void IDisposable.Dispose () +#if NET_4_0 || MOBILE + public void Dispose () +#else + void IDisposable.Dispose() +#endif { Dispose (false); } -#endif public abstract void Flush (); @@ -269,16 +279,12 @@ namespace System.Xml public abstract void WriteBase64 (byte[] buffer, int index, int count); -#if NET_2_0 public virtual void WriteBinHex (byte [] buffer, int index, int count) { StringWriter sw = new StringWriter (); XmlConvert.WriteBinHex (buffer, index, count, sw); WriteString (sw.ToString ()); } -#else - public abstract void WriteBinHex (byte[] buffer, int index, int count); -#endif public abstract void WriteCData (string text); @@ -306,7 +312,6 @@ namespace System.Xml WriteEndElement(); } -#if NET_2_0 public void WriteElementString (string prefix, string localName, string ns, string value) { WriteStartElement(prefix, localName, ns); @@ -314,7 +319,6 @@ namespace System.Xml WriteString(value); WriteEndElement(); } -#endif public abstract void WriteEndAttribute (); @@ -326,7 +330,6 @@ namespace System.Xml public abstract void WriteFullEndElement (); -#if NET_2_0 public virtual void WriteName (string name) { WriteNameInternal (name); @@ -341,42 +344,27 @@ namespace System.Xml { WriteQualifiedNameInternal (localName, ns); } -#else - public abstract void WriteName (string name); - - public abstract void WriteNmToken (string name); - - public abstract void WriteQualifiedName (string localName, string ns); -#endif internal void WriteNameInternal (string name) { -#if NET_2_0 switch (Settings.ConformanceLevel) { case ConformanceLevel.Document: case ConformanceLevel.Fragment: XmlConvert.VerifyName (name); break; } -#else - XmlConvert.VerifyName (name); -#endif WriteString (name); } internal virtual void WriteNmTokenInternal (string name) { bool valid = true; -#if NET_2_0 switch (Settings.ConformanceLevel) { case ConformanceLevel.Document: case ConformanceLevel.Fragment: valid = XmlChar.IsNmToken (name); break; } -#else - valid = XmlChar.IsNmToken (name); -#endif if (!valid) throw new ArgumentException ("Argument name is not a valid NMTOKEN."); WriteString (name); @@ -389,7 +377,6 @@ namespace System.Xml if (ns == null) ns = String.Empty; -#if NET_2_0 if (Settings != null) { switch (Settings.ConformanceLevel) { case ConformanceLevel.Document: @@ -400,9 +387,6 @@ namespace System.Xml } else XmlConvert.VerifyNCName (localName); -#else - XmlConvert.VerifyNCName (localName); -#endif string prefix = ns.Length > 0 ? LookupPrefix (ns) : String.Empty; if (prefix == null) @@ -582,12 +566,10 @@ namespace System.Xml public abstract void WriteRaw (char[] buffer, int index, int count); -#if NET_2_0 public void WriteStartAttribute (string localName) { WriteStartAttribute (null, localName, null); } -#endif public void WriteStartAttribute (string localName, string ns) { @@ -618,7 +600,6 @@ namespace System.Xml public abstract void WriteWhitespace (string ws); -#if NET_2_0 public virtual void WriteValue (bool value) { WriteString (XQueryConvert.BooleanToString (value)); @@ -715,8 +696,408 @@ namespace System.Xml { WriteString (value); } + +#if NET_4_5 + public virtual void WriteValue (DateTimeOffset value) + { + WriteString (XmlConvert.ToString (value)); + } #endif #endregion + +#if NET_4_5 + #region .NET 4.5 Async Methods + + bool asyncRunning; + + void StartAsync () + { + if (!settings.Async) + throw new InvalidOperationException ("Set XmlWriterSettings.Async to true if you want to use Async Methods."); + lock (this) { + if (asyncRunning) + throw new InvalidOperationException ("An asynchronous operation is already in progress."); + asyncRunning = true; + } + } + + public virtual Task FlushAsync () + { + StartAsync (); + return Task.Run (() => { + try { + Flush (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteAttributesAsync (XmlReader reader, bool defattr) + { + StartAsync (); + return Task.Run (() => { + try { + WriteAttributes (reader, defattr); + } finally { + asyncRunning = false; + } + }); + } + + public Task WriteAttributeStringAsync (string prefix, string localName, + string ns, string value) + { + StartAsync (); + return Task.Run (() => { + try { + WriteAttributeString (prefix, localName, ns, value); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteBase64Async (byte[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + WriteBase64 (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteBinHexAsync (byte[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + WriteBinHex (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteCDataAsync (string text) + { + StartAsync (); + return Task.Run (() => { + try { + WriteCData (text); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteCharEntityAsync (char ch) + { + StartAsync (); + return Task.Run (() => { + try { + WriteCharEntity (ch); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteCharsAsync (char[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + WriteChars (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteCommentAsync (string text) + { + StartAsync (); + return Task.Run (() => { + try { + WriteComment (text); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteDocTypeAsync (string name, string pubid, string sysid, string subset) + { + StartAsync (); + return Task.Run (() => { + try { + WriteDocType (name, pubid, sysid, subset); + } finally { + asyncRunning = false; + } + }); + } + + public Task WriteElementStringAsync (string prefix, string localName, string ns, string value) + { + StartAsync (); + return Task.Run (() => { + try { + WriteElementString (prefix, localName, ns, value); + } finally { + asyncRunning = false; + } + }); + } + + protected internal virtual Task WriteEndAttributeAsync () + { + StartAsync (); + return Task.Run (() => { + try { + WriteEndAttribute (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteEndDocumentAsync () + { + StartAsync (); + return Task.Run (() => { + try { + WriteEndDocument (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteEndElementAsync () + { + StartAsync (); + return Task.Run (() => { + try { + WriteEndElement (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteEntityRefAsync (string name) + { + StartAsync (); + return Task.Run (() => { + try { + WriteEntityRef (name); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteFullEndElementAsync () + { + StartAsync (); + return Task.Run (() => { + try { + WriteFullEndElement (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteNameAsync (string name) + { + StartAsync (); + return Task.Run (() => { + try { + WriteName (name); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteNmTokenAsync (string name) + { + StartAsync (); + return Task.Run (() => { + try { + WriteNmToken (name); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteNodeAsync (XmlReader reader, bool defattr) + { + StartAsync (); + return Task.Run (() => { + try { + WriteNode (reader, defattr); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteNodeAsync (XPathNavigator navigator, bool defattr) + { + StartAsync (); + return Task.Run (() => { + try { + WriteNode (navigator, defattr); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteProcessingInstructionAsync (string name, string text) + { + StartAsync (); + return Task.Run (() => { + try { + WriteProcessingInstruction (name, text); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteQualifiedNameAsync (string localName, string ns) + { + StartAsync (); + return Task.Run (() => { + try { + WriteQualifiedName (localName, ns); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteRawAsync (string data) + { + StartAsync (); + return Task.Run (() => { + try { + WriteRaw (data); + } finally { + asyncRunning = false; + } + }); + + } + + public virtual Task WriteRawAsync (char[] buffer, int index, int count) + { + StartAsync (); + return Task.Run (() => { + try { + WriteRaw (buffer, index, count); + } finally { + asyncRunning = false; + } + }); + } + + protected internal virtual Task WriteStartAttributeAsync ( + string prefix, string localName, string ns) + { + StartAsync (); + return Task.Run (() => { + try { + WriteStartAttribute (prefix, localName, ns); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteStartDocumentAsync () + { + StartAsync (); + return Task.Run (() => { + try { + WriteStartDocument (); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteStartDocumentAsync (bool standalone) + { + StartAsync (); + return Task.Run (() => { + try { + WriteStartDocument (standalone); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteStartElementAsync (string prefix, string localName, string ns) + { + StartAsync (); + return Task.Run (() => { + try { + WriteStartElement (prefix, localName, ns); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteStringAsync (string text) + { + StartAsync (); + return Task.Run (() => { + try { + WriteString (text); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteSurrogateCharEntityAsync (char lowChar, char highChar) + { + StartAsync (); + return Task.Run (() => { + try { + WriteSurrogateCharEntity (lowChar, highChar); + } finally { + asyncRunning = false; + } + }); + } + + public virtual Task WriteWhitespaceAsync (string ws) + { + StartAsync (); + return Task.Run (() => { + try { + WriteWhitespace (ws); + } finally { + asyncRunning = false; + } + }); + } + + #endregion +#endif } } diff --git a/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs b/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs index 7d8fa4f2749..a1ee351f35b 100644 --- a/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs +++ b/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs @@ -51,6 +51,11 @@ namespace System.Xml private bool omitXmlDeclaration; private XmlOutputMethod outputMethod; +#if NET_4_5 + private bool isReadOnly; + private bool isAsync; +#endif + public XmlWriterSettings () { Reset (); @@ -78,12 +83,14 @@ namespace System.Xml encoding = Encoding.UTF8; indent = false; indentChars = " "; - // LAMESPEC: MS.NET says it is "\r\n", but it is silly decision. - newLineChars = Environment.NewLine; + newLineChars = "\r\n"; newLineOnAttributes = false; - newLineHandling = NewLineHandling.None; + newLineHandling = NewLineHandling.Replace; omitXmlDeclaration = false; outputMethod = XmlOutputMethod.AutoDetect; +#if NET_4_5 + isAsync = false; +#endif } // It affects only on XmlTextWriter @@ -161,6 +168,32 @@ namespace System.Xml internal #endif NamespaceHandling NamespaceHandling { get; set; } + +#if NET_4_5 + internal void SetReadOnly () + { + isReadOnly = true; + } + + /* + * FIXME: The .NET 4.5 runtime throws an exception when attempting to + * modify any of the properties after the XmlReader has been constructed. + */ + void EnsureWritability () + { + if (isReadOnly) + throw new InvalidOperationException ("XmlReaderSettings in read-only"); + } + + public bool Async { + get { return isAsync; } + set { + EnsureWritability (); + isAsync = value; + } + } +#endif + } } diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs index b2843765a64..90f16f0899c 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs @@ -1158,7 +1158,7 @@ namespace MonoTests.System.XmlSerialization e = (FlagEnum) Deserialize (typeof (FlagEnum), "two four two"); Assert.AreEqual (FlagEnum.e2 | FlagEnum.e4, e, "#A6"); - e = (FlagEnum) Deserialize (typeof (FlagEnum), "two four two\tone\u2002four\u200btwo one"); + e = (FlagEnum) Deserialize (typeof (FlagEnum), "two four two\tone\u2002four\rtwo one"); Assert.AreEqual (FlagEnum.e1 | FlagEnum.e2 | FlagEnum.e4, e, "#A7"); e = (FlagEnum) Deserialize (typeof (FlagEnum), ""); @@ -1545,5 +1545,13 @@ namespace MonoTests.System.XmlSerialization } catch (InvalidOperationException) { } } + + [Test] + public void NotExactDateParse () + { + XmlSerializer xs = new XmlSerializer (typeof (NotExactDateParseClass)); + NotExactDateParseClass o = (NotExactDateParseClass) xs.Deserialize (new StringReader ("2012-02-05-09:00")); + Assert.AreEqual (new DateTime (2012,2,5), o.SomeDate); + } } } diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs index f58d0e35884..e27b8db60f4 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs @@ -466,7 +466,7 @@ namespace MonoTests.System.XmlSerialization } [Test] - [Category ("NotWorking")] + [Ignore ("Additional namespace prefixes are added")] public void TestWritePotentiallyReferencingElement () { XmlSerializarionWriterTester xsw = new XmlSerializarionWriterTester (); @@ -496,7 +496,7 @@ namespace MonoTests.System.XmlSerialization Assert.AreEqual (string.Format (CultureInfo.InvariantCulture, "something", XmlSchemaNamespace, XmlSchemaInstanceNamespace, ANamespace), - xsw.Content, "#2"); + xsw.Content, "#4"); xsw.Reset (); diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs index 8d6af186a7f..955a8e3f7cb 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs @@ -1047,5 +1047,11 @@ namespace MonoTests.System.Xml.TestClasses [XmlElementAttribute ("MyDateNullable", DataType = "date", IsNullable = true)] public DateTime? MyDateNullable; } + + public class NotExactDateParseClass + { + [XmlElementAttribute (DataType = "date")] + public DateTime SomeDate; + } } diff --git a/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs b/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs index 785f5a13d38..18cef9df486 100644 --- a/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs @@ -414,9 +414,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros // http://support.microsoft.com/default.aspx?scid=kb;en-us;834667 [Test] -#if NET_1_1 [Category ("NotDotNet")] -#endif public void LocalParameter () { string xsltFragment = @" diff --git a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs index 4ac6da7d7e5..8f522a85e56 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs @@ -15,6 +15,10 @@ using System.Text; using System.Xml; using System.Xml.Schema; using System.Xml.XPath; +#if NET_4_5 +using System.Threading; +using System.Threading.Tasks; +#endif using NUnit.Framework; @@ -2265,6 +2269,57 @@ namespace MonoTests.System.Xml Assert.AreEqual (arr [0], ret [0], "#2"); Assert.AreEqual (arr [1], ret [1], "#3"); } + +#if NET_4_5 + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void MustSetAsyncFlag () + { + var r = XmlReader.Create (new StringReader ("")); + r.ReadAsync (); + } + + Exception RunAsync (Action action) + { + var task = Task.Run (async () => { + try { + action (); + return null; + } catch (Exception ex) { + return ex; + } + }); + task.Wait (); + Assert.That (task.IsCompleted); + return task.Result; + } + + [Test] + public void SimpleAsync () + { + var xml = ""; + var task = Task.Run (async () => { + try { + var s = new XmlReaderSettings (); + s.Async = true; + var r = XmlReader.Create (new StringReader (xml), s); + + Assert.That (await r.ReadAsync ()); + Assert.That (r.MoveToFirstAttribute ()); + + Assert.AreEqual (await r.GetValueAsync (), "monkey"); + r.Close (); + return null; + } catch (Exception ex) { + return ex; + } + }); + task.Wait (); + Assert.That (task.IsCompleted); + if (task.Result != null) + throw task.Result; + } +#endif #endif } } diff --git a/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs index 33115994bca..c6a7e220cf3 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs @@ -419,6 +419,33 @@ namespace MonoTests.System.Xml XmlReader r = XmlReader.Create (new StringReader (""), new XmlReaderSettings (), "urn:foo"); Assert.AreEqual ("urn:foo", r.BaseURI); } + +#if NET_4_5 + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void ReadonlyAsync () + { + var s = new XmlReaderSettings (); + var r = XmlReader.Create (new StringReader (""), s); + r.Settings.Async = true; + } + + [Test] + public void AsyncPropagation () + { + var s = new XmlReaderSettings (); + s.Async = true; + var r = XmlReader.Create (new StringReader (""), s); + + var c = s.Clone (); + Assert.IsTrue (c.Async); + c.Reset (); + Assert.IsFalse (c.Async); + + var r2 = XmlReader.Create (r, c); + Assert.IsTrue (r2.Settings.Async); + } +#endif } } #endif diff --git a/mcs/class/System.XML/Test/System.Xml/XmlResolverTest.cs b/mcs/class/System.XML/Test/System.Xml/XmlResolverTest.cs index bfd2cb5aa27..fcdc34e7f7a 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlResolverTest.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlResolverTest.cs @@ -104,5 +104,25 @@ namespace MonoTest.System.Xml { Assert.IsTrue (u2.IsAbsoluteUri, "null,absolute/file"); } #endif + +#if NET_4_5 + class AsyncXmlResolver : XmlResolver + { + public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn) + { + throw new AssertionException ("Should not be reached"); + } + } + + [Test] + [ExpectedException(typeof(NotImplementedException))] + [Category("Async")] + public void TestAsync () + { + var ar = new AsyncXmlResolver (); + var uri = new Uri ("http://www.mono-project.com"); + ar.GetEntityAsync (uri, null, typeof(string)); + } +#endif } } diff --git a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs index 48d1de59d85..0603a694d42 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs @@ -111,6 +111,24 @@ namespace MonoTestsXml Assert.IsTrue (zone, "Zone-2"); Assert.IsTrue (site, "Site-2"); } + +#if NET_4_5 + [Test] + [Category("Async")] + public void TestAsync () + { + var loc = Assembly.GetExecutingAssembly ().Location; + Evidence e = XmlSecureResolver.CreateEvidenceForUrl (loc); + var ur = new XmlUrlResolver (); + var sr = new XmlSecureResolver (ur, e); + Uri resolved = sr.ResolveUri (null, loc); + Assert.AreEqual ("file", resolved.Scheme); + var task = sr.GetEntityAsync (resolved, null, typeof (Stream)); + Assert.That (task.Wait (3000)); + Assert.IsInstanceOfType (typeof (Stream), task.Result); + } +#endif + } } diff --git a/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs index 09ac79a423f..17e94fc1567 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs @@ -10,6 +10,9 @@ using System; using System.IO; using System.Xml; using NUnit.Framework; +#if NET_4_5 +using System.Reflection; +#endif namespace MonoTests.System.Xml { @@ -98,5 +101,37 @@ namespace MonoTests.System.Xml Assert.AreEqual ("Standard.xslt", uri.AbsolutePath, "#2"); Assert.AreEqual ("view:Standard.xslt", uri.AbsoluteUri, "#2"); } + +#if NET_4_5 + [Test] + [Category("Async")] + public void TestAsync () + { + var loc = Assembly.GetExecutingAssembly ().Location; + Uri resolved = resolver.ResolveUri (null, loc); + Assert.AreEqual ("file", resolved.Scheme); + var task = resolver.GetEntityAsync (resolved, null, typeof (Stream)); + Assert.That (task.Wait (3000)); + Assert.IsInstanceOfType (typeof (Stream), task.Result); + } + + [Test] + [Category("Async")] + public void TestAsyncError () + { + var loc = Assembly.GetExecutingAssembly ().Location; + Uri resolved = resolver.ResolveUri (null, loc); + Assert.AreEqual ("file", resolved.Scheme); + var task = resolver.GetEntityAsync (resolved, null, typeof (File)); + try { + task.Wait (3000); + Assert.Fail ("#1"); + } catch (Exception ex) { + if (ex is AggregateException) + ex = ((AggregateException) ex).InnerException; + Assert.IsInstanceOfType (typeof (XmlException), ex); + } + } +#endif } } diff --git a/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs index 1c2a24ab259..6ade78b4461 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs @@ -37,9 +37,13 @@ namespace MonoTests.System.Xml Assert.AreEqual (Encoding.UTF8, s.Encoding); Assert.AreEqual (false, s.Indent); Assert.AreEqual (" ", s.IndentChars); - Assert.AreEqual (Environment.NewLine, s.NewLineChars); + Assert.AreEqual ("\r\n", s.NewLineChars); Assert.AreEqual (false, s.NewLineOnAttributes); Assert.AreEqual (false, s.OmitXmlDeclaration); + Assert.AreEqual (NewLineHandling.Replace, s.NewLineHandling); +#if NET_4_5 + Assert.IsFalse (s.Async); +#endif } [Test] @@ -303,6 +307,109 @@ namespace MonoTests.System.Xml "; Assert.AreEqual (xml, sw.ToString ().Replace ("\r\n", "\n"), "#1"); } + + [Test] + public void NewlineHandlingNone () + { + var sw = new StringWriter (); + var xw = XmlWriter.Create (sw, new XmlWriterSettings () { NewLineHandling = NewLineHandling.None }); + xw.WriteStartElement("root"); + xw.WriteElementString("element", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteStartElement("element"); + xw.WriteAttributeString("attr", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteEndElement(); + xw.WriteEndElement(); + xw.Close(); + string xml = "lf\ncr\rcrlf\r\nht\t"; + Assert.AreEqual (xml, sw.ToString ()); + } + + [Test] + public void NewlineHandlingReplace () + { + var sw = new StringWriter (); + var xw = XmlWriter.Create (sw, new XmlWriterSettings () { + NewLineHandling = NewLineHandling.Replace, + NewLineChars = "\n" + }); + xw.WriteStartElement("root"); + xw.WriteElementString("element", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteStartElement("element"); + xw.WriteAttributeString("attr", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteEndElement(); + xw.WriteEndElement(); + xw.Close(); + string xml = "lf\ncr\ncrlf\nht\t"; + Assert.AreEqual (xml, sw.ToString ()); + } + + [Test] + public void NewlineHandlingReplaceCRLF () + { + var sw = new StringWriter (); + var xw = XmlWriter.Create (sw, new XmlWriterSettings () { + NewLineHandling = NewLineHandling.Replace, + NewLineChars = "\r\n" + }); + xw.WriteStartElement("root"); + xw.WriteElementString("element", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteStartElement("element"); + xw.WriteAttributeString("attr", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteEndElement(); + xw.WriteEndElement(); + xw.Close(); + string xml = "lf\r\ncr\r\ncrlf\r\nht\t"; + Assert.AreEqual (xml, sw.ToString ()); + } + + [Test] + public void NewlineHandlingEntitize () + { + var sw = new StringWriter (); + var xw = XmlWriter.Create (sw, new XmlWriterSettings () { + NewLineHandling = NewLineHandling.Entitize, + NewLineChars = "\n" + }); + xw.WriteStartElement("root"); + xw.WriteElementString("element", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteStartElement("element"); + xw.WriteAttributeString("attr", "lf\ncr\rcrlf\r\nht\t"); + xw.WriteEndElement(); + xw.WriteEndElement(); + xw.Close(); + string xml = "lf\ncr crlf \nht\t"; + Assert.AreEqual (xml, sw.ToString ()); + } + +#if NET_4_5 + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void ReadonlyAsync () + { + var sw = new StringWriter (); + var s = new XmlWriterSettings (); + var w = XmlWriter.Create (sw, s); + w.Settings.Async = true; + } + + [Test] + public void AsyncPropagation () + { + var sw = new StringWriter (); + var s = new XmlWriterSettings (); + s.Async = true; + var w = XmlWriter.Create (sw, s); + + var c = s.Clone (); + Assert.IsTrue (c.Async); + c.Reset (); + Assert.IsFalse (c.Async); + + var w2 = XmlWriter.Create (w, c); + Assert.IsTrue (w2.Settings.Async); + } +#endif + } } #endif diff --git a/mcs/class/System.XML/mobile_System.Xml.dll.sources b/mcs/class/System.XML/mobile_System.Xml.dll.sources index 05592f22911..458410154b6 100644 --- a/mcs/class/System.XML/mobile_System.Xml.dll.sources +++ b/mcs/class/System.XML/mobile_System.Xml.dll.sources @@ -80,6 +80,7 @@ Mono.Xml/XmlNodeWriter.cs System.Xml/ConformanceLevel.cs System.Xml/DTDAutomata.cs System.Xml/DTDObjectModel.cs +System.Xml/DtdProcessing.cs System.Xml/DTDReader.cs System.Xml/DTDValidatingReader2.cs System.Xml/DefaultXmlWriter.cs diff --git a/mcs/class/System.Xaml/System.Windows.Markup/ContentWrapperAttribute.cs b/mcs/class/System.Xaml/System.Windows.Markup/ContentWrapperAttribute.cs index c18653fcfbb..12e10c5e151 100755 --- a/mcs/class/System.Xaml/System.Windows.Markup/ContentWrapperAttribute.cs +++ b/mcs/class/System.Xaml/System.Windows.Markup/ContentWrapperAttribute.cs @@ -38,7 +38,7 @@ namespace System.Windows.Markup public Type ContentWrapper { get; private set; } #if !NET_2_1 public override Object TypeId { - get { return ContentWrapper; } + get { return this; } } #endif diff --git a/mcs/class/System.Xaml/System.Windows.Markup/DependsOnAttribute.cs b/mcs/class/System.Xaml/System.Windows.Markup/DependsOnAttribute.cs index 47e1158fc6f..f49ce4fb5be 100755 --- a/mcs/class/System.Xaml/System.Windows.Markup/DependsOnAttribute.cs +++ b/mcs/class/System.Xaml/System.Windows.Markup/DependsOnAttribute.cs @@ -40,7 +40,7 @@ namespace System.Windows.Markup #if !NET_2_1 // really? I doubt it should be overriden. public override Object TypeId { - get { return base.TypeId; } + get { return this; } } #endif } diff --git a/mcs/class/System.Xaml/Test/System.Xaml/XamlObjectWriterTest.cs b/mcs/class/System.Xaml/Test/System.Xaml/XamlObjectWriterTest.cs index f3e89003b3b..35f5c7347ba 100755 --- a/mcs/class/System.Xaml/Test/System.Xaml/XamlObjectWriterTest.cs +++ b/mcs/class/System.Xaml/Test/System.Xaml/XamlObjectWriterTest.cs @@ -709,6 +709,12 @@ namespace MonoTests.System.Xaml [Test] public void OnSetValueAndHandledFalse () // part of bug #3003 { +#if NET_4_5 + string ver = "net_4_5"; +#else + string ver = "net_4_0"; +#endif + /* var obj = new TestClass3 (); obj.Nested = new TestClass3 (); @@ -717,7 +723,7 @@ namespace MonoTests.System.Xaml XamlServices.Transform (new XamlObjectReader (obj), xxw); Console.Error.WriteLine (sw); */ - var xml = ""; + var xml = "".Replace ("net_4_0", ver); var settings = new XamlObjectWriterSettings (); bool invoked = false; settings.XamlSetValueHandler = (sender, e) => { @@ -832,7 +838,13 @@ namespace MonoTests.System.Xaml XamlReader GetReader (string filename) { - return new XamlXmlReader (XmlReader.Create (Path.Combine ("Test/XmlFiles", filename), new XmlReaderSettings () { CloseInput =true })); +#if NET_4_5 + string ver = "net_4_5"; +#else + string ver = "net_4_0"; +#endif + string xml = File.ReadAllText (Path.Combine ("Test/XmlFiles", filename)).Replace ("net_4_0", ver); + return new XamlXmlReader (XmlReader.Create (new StringReader (xml))); } [Test] diff --git a/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs b/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs index e27e2a77d8e..b8dd211e648 100755 --- a/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs +++ b/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs @@ -45,7 +45,13 @@ namespace MonoTests.System.Xaml XamlReader GetReader (string filename) { - return new XamlXmlReader (XmlReader.Create (Path.Combine ("Test/XmlFiles", filename), new XmlReaderSettings () { CloseInput =true })); +#if NET_4_5 + string ver = "net_4_5"; +#else + string ver = "net_4_0"; +#endif + string xml = File.ReadAllText (Path.Combine ("Test/XmlFiles", filename)).Replace ("net_4_0", ver); + return new XamlXmlReader (XmlReader.Create (new StringReader (xml))); } void ReadTest (string filename) diff --git a/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlWriterTest.cs b/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlWriterTest.cs index aebfed0cd1d..11f58acb2e2 100755 --- a/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlWriterTest.cs +++ b/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlWriterTest.cs @@ -636,7 +636,12 @@ namespace MonoTests.System.Xaml string ReadXml (string name) { - return File.ReadAllText ("Test/XmlFiles/" + name).Trim ().Replace ("\r\n", "\n").Replace ("\n", Environment.NewLine); +#if NET_4_5 + string ver = "net_4_5"; +#else + string ver = "net_4_0"; +#endif + return File.ReadAllText ("Test/XmlFiles/" + name).Trim ().Replace (">\n", ">\r\n").Replace ("net_4_0", ver); } [Test] diff --git a/mcs/class/System.Xml.Linq/Assembly/AssemblyInfo.cs b/mcs/class/System.Xml.Linq/Assembly/AssemblyInfo.cs index 40a2cd53aa7..169f6d17271 100644 --- a/mcs/class/System.Xml.Linq/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Xml.Linq/Assembly/AssemblyInfo.cs @@ -64,6 +64,3 @@ using System.Runtime.InteropServices; [assembly: ComVisible (false)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -// Extension attribute should be added by compiler diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XCData.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XCData.cs index 74893003ecc..73d6f011f5c 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XCData.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XCData.cs @@ -49,7 +49,7 @@ namespace System.Xml.Linq get { return XmlNodeType.CDATA; } } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { int start = 0; StringBuilder sb = null; @@ -65,7 +65,7 @@ namespace System.Xml.Linq } if (start != 0 && start != Value.Length) sb.Append (Value, start, Value.Length - start); - w.WriteCData (sb == null ? Value : sb.ToString ()); + writer.WriteCData (sb == null ? Value : sb.ToString ()); } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XComment.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XComment.cs index 62793017540..edab3fb4775 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XComment.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XComment.cs @@ -52,9 +52,9 @@ namespace System.Xml.Linq set { this.value = value; } } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { - w.WriteComment (value); + writer.WriteComment (value); } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocument.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocument.cs index d8a0ad6dd37..40ac74035a0 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocument.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocument.cs @@ -48,9 +48,9 @@ namespace System.Xml.Linq Add (content); } - public XDocument (XDeclaration xmldecl, params object [] content) + public XDocument (XDeclaration declaration, params object [] content) { - Declaration = xmldecl; + Declaration = declaration; Add (content); } @@ -114,19 +114,19 @@ namespace System.Xml.Linq return Load (new StreamReader (stream), options); } - public static XDocument Load (TextReader reader) + public static XDocument Load (TextReader textReader) { - return Load (reader, LoadOptions.None); + return Load (textReader, LoadOptions.None); } - public static XDocument Load (TextReader reader, LoadOptions options) + public static XDocument Load (TextReader textReader, LoadOptions options) { XmlReaderSettings s = new XmlReaderSettings (); #if !MOONLIGHT s.ProhibitDtd = false; // see XNodeNavigatorTest.MoveToId(). #endif s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0; - using (XmlReader r = XmlReader.Create (reader, s)) { + using (XmlReader r = XmlReader.Create (textReader, s)) { return LoadCore (r, options); } } @@ -180,22 +180,22 @@ namespace System.Xml.Linq } } - public static XDocument Parse (string s) + public static XDocument Parse (string text) { - return Parse (s, LoadOptions.None); + return Parse (text, LoadOptions.None); } - public static XDocument Parse (string s, LoadOptions options) + public static XDocument Parse (string text, LoadOptions options) { - return Load (new StringReader (s), options); + return Load (new StringReader (text), options); } - public void Save (string filename) + public void Save (string fileName) { - Save (filename, SaveOptions.None); + Save (fileName, SaveOptions.None); } - public void Save (string filename, SaveOptions options) + public void Save (string fileName, SaveOptions options) { XmlWriterSettings s = new XmlWriterSettings (); if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) @@ -205,17 +205,17 @@ namespace System.Xml.Linq s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; #endif - using (XmlWriter w = XmlWriter.Create (filename, s)) { + using (XmlWriter w = XmlWriter.Create (fileName, s)) { Save (w); } } - public void Save (TextWriter tw) + public void Save (TextWriter textWriter) { - Save (tw, SaveOptions.None); + Save (textWriter, SaveOptions.None); } - public void Save (TextWriter tw, SaveOptions options) + public void Save (TextWriter textWriter, SaveOptions options) { XmlWriterSettings s = new XmlWriterSettings (); if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) @@ -224,26 +224,24 @@ namespace System.Xml.Linq if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; #endif - using (XmlWriter w = XmlWriter.Create (tw, s)) { + using (XmlWriter w = XmlWriter.Create (textWriter, s)) { Save (w); } } - public void Save (XmlWriter w) + public void Save (XmlWriter writer) { - WriteTo (w); + WriteTo (writer); } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { - if (xmldecl != null) { - if (xmldecl.Standalone != null) - w.WriteStartDocument (xmldecl.Standalone == "yes"); - else - w.WriteStartDocument (); - } + if (xmldecl != null && xmldecl.Standalone != null) + writer.WriteStartDocument (xmldecl.Standalone == "yes"); + else + writer.WriteStartDocument (); foreach (XNode node in Nodes ()) - node.WriteTo (w); + node.WriteTo (writer); } internal override bool OnAddingObject (object obj, bool rejectAttribute, XNode refNode, bool addFirst) diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocumentType.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocumentType.cs index 8bbcac9b187..c54ffdf3b94 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocumentType.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XDocumentType.cs @@ -95,12 +95,12 @@ namespace System.Xml.Linq get { return XmlNodeType.DocumentType; } } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { XDocument doc = Document; XElement root = doc.Root; if (root != null) - w.WriteDocType (root.Name.LocalName, pubid, sysid, intSubset); + writer.WriteDocType (root.Name.LocalName, pubid, sysid, intSubset); } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs index f3ed29bec64..924f64ca827 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XElement.cs @@ -50,17 +50,17 @@ namespace System.Xml.Linq XAttribute attr_first, attr_last; bool explicit_is_empty = true; - public XElement (XName name, object value) + public XElement (XName name, object content) { this.name = name; - Add (value); + Add (content); } - public XElement (XElement source) + public XElement (XElement other) { - name = source.name; - Add (source.Attributes ()); - Add (source.Nodes ()); + name = other.name; + Add (other.Attributes ()); + Add (other.Nodes ()); } public XElement (XName name) @@ -68,16 +68,16 @@ namespace System.Xml.Linq this.name = name; } - public XElement (XName name, params object [] contents) + public XElement (XName name, params object [] content) { this.name = name; - Add (contents); + Add (content); } - public XElement (XStreamingElement source) + public XElement (XStreamingElement other) { - this.name = source.Name; - Add (source.Contents); + this.name = other.Name; + Add (other.Contents); } [CLSCompliant (false)] @@ -426,16 +426,16 @@ namespace System.Xml.Linq } } - public static XElement Load (TextReader tr) + public static XElement Load (TextReader textReader) { - return Load (tr, LoadOptions.None); + return Load (textReader, LoadOptions.None); } - public static XElement Load (TextReader tr, LoadOptions options) + public static XElement Load (TextReader textReader, LoadOptions options) { XmlReaderSettings s = CreateDefaultSettings (options); - using (XmlReader r = XmlReader.Create (tr, s)) { + using (XmlReader r = XmlReader.Create (textReader, s)) { return LoadCore (r, options); } } @@ -504,14 +504,14 @@ namespace System.Xml.Linq return e; } - public static XElement Parse (string s) + public static XElement Parse (string text) { - return Parse (s, LoadOptions.None); + return Parse (text, LoadOptions.None); } - public static XElement Parse (string s, LoadOptions options) + public static XElement Parse (string text, LoadOptions options) { - return Load (new StringReader (s), options); + return Load (new StringReader (text), options); } public void RemoveAll () @@ -526,12 +526,12 @@ namespace System.Xml.Linq attr_last.Remove (); } - public void Save (string filename) + public void Save (string fileName) { - Save (filename, SaveOptions.None); + Save (fileName, SaveOptions.None); } - public void Save (string filename, SaveOptions options) + public void Save (string fileName, SaveOptions options) { XmlWriterSettings s = new XmlWriterSettings (); @@ -541,17 +541,17 @@ namespace System.Xml.Linq if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; #endif - using (XmlWriter w = XmlWriter.Create (filename, s)) { + using (XmlWriter w = XmlWriter.Create (fileName, s)) { Save (w); } } - public void Save (TextWriter tw) + public void Save (TextWriter textWriter) { - Save (tw, SaveOptions.None); + Save (textWriter, SaveOptions.None); } - public void Save (TextWriter tw, SaveOptions options) + public void Save (TextWriter textWriter, SaveOptions options) { XmlWriterSettings s = new XmlWriterSettings (); @@ -561,14 +561,14 @@ namespace System.Xml.Linq if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; #endif - using (XmlWriter w = XmlWriter.Create (tw, s)) { + using (XmlWriter w = XmlWriter.Create (textWriter, s)) { Save (w); } } - public void Save (XmlWriter w) + public void Save (XmlWriter writer) { - WriteTo (w); + WriteTo (writer); } #if NET_4_0 || MOONLIGHT || MOBILE @@ -655,7 +655,7 @@ namespace System.Xml.Linq string LookupPrefix (string ns, XmlWriter w) { - string prefix = ns.Length > 0 ? w.LookupPrefix (ns) : String.Empty; + string prefix = ns.Length > 0 ? GetPrefixOfNamespace (ns) ?? w.LookupPrefix (ns) : String.Empty; foreach (XAttribute a in Attributes ()) { if (a.IsNamespaceDeclaration && a.Value == ns) { if (a.Name.Namespace == XNamespace.Xmlns) @@ -666,49 +666,53 @@ namespace System.Xml.Linq } return prefix; } + + static string CreateDummyNamespace (ref int createdNS, IEnumerable atts, bool isAttr) + { + if (!isAttr && atts.All (a => a.Name.LocalName != "xmlns" || a.Name.NamespaceName == XNamespace.Xmlns.NamespaceName)) + return String.Empty; + string p = null; + do { + p = "p" + (++createdNS); + // check conflict + if (atts.All (a => a.Name.LocalName != p || a.Name.NamespaceName == XNamespace.Xmlns.NamespaceName)) + break; + } while (true); + return p; + } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { // some people expect the same prefix output as in input, // in the loss of performance... see bug #466423. + string prefix = LookupPrefix (name.NamespaceName, writer); int createdNS = 0; - string prefix = LookupPrefix (name.NamespaceName, w); - Func nsCreator = () => { - string p = null; - do { - p = "p" + (++createdNS); - // check conflict - if (Attributes ().All (a => a.Name.LocalName != p)) - break; - } while (true); - return p; - }; if (prefix == null) - prefix = nsCreator (); + prefix = CreateDummyNamespace (ref createdNS, Attributes (), false); - w.WriteStartElement (prefix, name.LocalName, name.Namespace.NamespaceName); + writer.WriteStartElement (prefix, name.LocalName, name.Namespace.NamespaceName); foreach (XAttribute a in Attributes ()) { if (a.IsNamespaceDeclaration) { if (a.Name.Namespace == XNamespace.Xmlns) - w.WriteAttributeString ("xmlns", a.Name.LocalName, XNamespace.Xmlns.NamespaceName, a.Value); + writer.WriteAttributeString ("xmlns", a.Name.LocalName, XNamespace.Xmlns.NamespaceName, a.Value); else - w.WriteAttributeString ("xmlns", a.Value); + writer.WriteAttributeString ("xmlns", a.Value); } else { - string apfix = LookupPrefix (a.Name.NamespaceName, w); + string apfix = LookupPrefix (a.Name.NamespaceName, writer); if (apfix == null) - apfix = nsCreator (); - w.WriteAttributeString (apfix, a.Name.LocalName, a.Name.Namespace.NamespaceName, a.Value); + apfix = CreateDummyNamespace (ref createdNS, Attributes (), true); + writer.WriteAttributeString (apfix, a.Name.LocalName, a.Name.Namespace.NamespaceName, a.Value); } } foreach (XNode node in Nodes ()) - node.WriteTo (w); + node.WriteTo (writer); if (explicit_is_empty) - w.WriteEndElement (); + writer.WriteEndElement (); else - w.WriteFullEndElement (); + writer.WriteFullEndElement (); } public XNamespace GetDefaultNamespace () @@ -745,28 +749,28 @@ namespace System.Xml.Linq yield return a.Name.Namespace == XNamespace.None ? String.Empty : a.Name.LocalName; } - public void ReplaceAll (object item) + public void ReplaceAll (object content) { RemoveNodes (); - Add (item); + Add (content); } - public void ReplaceAll (params object [] items) + public void ReplaceAll (params object [] content) { RemoveNodes (); - Add (items); + Add (content); } - public void ReplaceAttributes (object item) + public void ReplaceAttributes (object content) { RemoveAttributes (); - Add (item); + Add (content); } - public void ReplaceAttributes (params object [] items) + public void ReplaceAttributes (params object [] content) { RemoveAttributes (); - Add (items); + Add (content); } public void SetElementValue (XName name, object value) diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs index 1559ee75575..80d0e7b09cb 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XName.cs @@ -130,25 +130,25 @@ namespace System.Xml.Linq return local.GetHashCode () ^ ns.GetHashCode (); } - public static bool operator == (XName n1, XName n2) + public static bool operator == (XName left, XName right) { - if ((object) n1 == null) - return (object) n2 == null; - else if ((object) n2 == null) + if ((object) left == null) + return (object) right == null; + else if ((object) right == null) return false; - return object.ReferenceEquals (n1, n2) || - n1.local == n2.local && n1.ns == n2.ns; + return object.ReferenceEquals (left, right) || + left.local == right.local && left.ns == right.ns; } [CLSCompliant (false)] - public static implicit operator XName (string s) + public static implicit operator XName (string expandedName) { - return s == null ? null : Get (s); + return expandedName == null ? null : Get (expandedName); } - public static bool operator != (XName n1, XName n2) + public static bool operator != (XName left, XName right) { - return ! (n1 == n2); + return ! (left == right); } public override string ToString () diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNamespace.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNamespace.cs index 0b0fc39076b..6b953e6abd7 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNamespace.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNamespace.cs @@ -58,13 +58,13 @@ namespace System.Xml.Linq get { return xmlns; } } - public static XNamespace Get (string uri) + public static XNamespace Get (string namespaceName) { lock (nstable) { XNamespace ret; - if (!nstable.TryGetValue (uri, out ret)) { - ret = new XNamespace (uri); - nstable [uri] = ret; + if (!nstable.TryGetValue (namespaceName, out ret)) { + ret = new XNamespace (namespaceName); + nstable [namespaceName] = ret; } return ret; } @@ -98,22 +98,22 @@ namespace System.Xml.Linq get { return uri; } } - public override bool Equals (object other) + public override bool Equals (object obj) { - if (Object.ReferenceEquals (this, other)) + if (Object.ReferenceEquals (this, obj)) return true; - XNamespace ns = other as XNamespace; + XNamespace ns = obj as XNamespace; return ns != null && uri == ns.uri; } - public static bool operator == (XNamespace o1, XNamespace o2) + public static bool operator == (XNamespace left, XNamespace right) { - return (object) o1 != null ? o1.Equals (o2) : (object) o2 == null; + return (object) left != null ? left.Equals (right) : (object) right == null; } - public static bool operator != (XNamespace o1, XNamespace o2) + public static bool operator != (XNamespace left, XNamespace right) { - return ! (o1 == o2); + return ! (left == right); } public static XName operator + (XNamespace ns, string localName) @@ -122,9 +122,9 @@ namespace System.Xml.Linq } [CLSCompliant (false)] - public static implicit operator XNamespace (string s) + public static implicit operator XNamespace (string namespaceName) { - return s != null ? XNamespace.Get (s) : null; + return namespaceName != null ? XNamespace.Get (namespaceName) : null; } public override int GetHashCode () diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNode.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNode.cs index ecec65afeed..11c5eca1fdf 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNode.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNode.cs @@ -146,9 +146,9 @@ namespace System.Xml.Linq AddBeforeSelf ((object) content); } - public static XNode ReadFrom (XmlReader r) + public static XNode ReadFrom (XmlReader reader) { - return ReadFrom (r, LoadOptions.None); + return ReadFrom (reader, LoadOptions.None); } internal static XNode ReadFrom (XmlReader r, LoadOptions options) @@ -214,7 +214,7 @@ namespace System.Xml.Linq return ToString (SaveOptions.None); } - public abstract void WriteTo (XmlWriter w); + public abstract void WriteTo (XmlWriter writer); public IEnumerable Ancestors () { @@ -234,6 +234,17 @@ namespace System.Xml.Linq return new XNodeReader (this); } +#if NET_4_0 + public XmlReader CreateReader (ReaderOptions readerOptions) + { + var r = new XNodeReader (this); + if ((readerOptions & ReaderOptions.OmitDuplicateNamespaces) != 0) + r.OmitDuplicateNamespaces = true; + + return r; + } +#endif + public IEnumerable ElementsAfterSelf () { foreach (XNode n in NodesAfterSelf ()) @@ -262,14 +273,14 @@ namespace System.Xml.Linq yield return el; } - public bool IsAfter (XNode other) + public bool IsAfter (XNode node) { - return XNode.DocumentOrderComparer.Compare (this, other) > 0; + return XNode.DocumentOrderComparer.Compare (this, node) > 0; } - public bool IsBefore (XNode other) + public bool IsBefore (XNode node) { - return XNode.DocumentOrderComparer.Compare (this, other) < 0; + return XNode.DocumentOrderComparer.Compare (this, node) < 0; } public IEnumerable NodesAfterSelf () diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeDocumentOrderComparer.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeDocumentOrderComparer.cs index 8391649bd16..296d4a261d8 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeDocumentOrderComparer.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeDocumentOrderComparer.cs @@ -48,9 +48,9 @@ namespace System.Xml.Linq Following } - public int Compare (XNode n1, XNode n2) + public int Compare (XNode x, XNode y) { - switch (CompareCore (n1, n2)) { + switch (CompareCore (x,y)) { case CompareResult.Same: return 0; case CompareResult.Random: diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeEqualityComparer.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeEqualityComparer.cs index ccfa7e236d2..aa6603292f6 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeEqualityComparer.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeEqualityComparer.cs @@ -38,19 +38,19 @@ namespace System.Xml.Linq { } - public bool Equals (XNode n1, XNode n2) + public bool Equals (XNode x, XNode y) { - if (n1 == null) - return n2 == null; - else if (n2 == null) + if (x == null) + return y == null; + else if (y == null) return false; //throw new NotImplementedException (); - if (n1.NodeType != n2.NodeType) + if (x.NodeType != y.NodeType) return false; - switch (n1.NodeType) { + switch (x.NodeType) { case XmlNodeType.Document: - XDocument doc1 = (XDocument) n1; - XDocument doc2 = (XDocument) n2; + XDocument doc1 = (XDocument) x; + XDocument doc2 = (XDocument) y; if (!Equals (doc1.Declaration, doc2.Declaration)) return false; IEnumerator id2 = doc2.Nodes ().GetEnumerator (); @@ -62,8 +62,8 @@ namespace System.Xml.Linq } return !id2.MoveNext (); case XmlNodeType.Element: - XElement e1 = (XElement) n1; - XElement e2 = (XElement) n2; + XElement e1 = (XElement) x; + XElement e2 = (XElement) y; if (e1.Name != e2.Name) return false; IEnumerator ia2 = e2.Attributes ().GetEnumerator (); @@ -84,22 +84,22 @@ namespace System.Xml.Linq } return !ie2.MoveNext (); case XmlNodeType.Comment: - XComment c1 = (XComment) n1; - XComment c2 = (XComment) n2; + XComment c1 = (XComment) x; + XComment c2 = (XComment) y; return c1.Value == c2.Value; case XmlNodeType.ProcessingInstruction: - XPI p1 = (XPI) n1; - XPI p2 = (XPI) n2; + XPI p1 = (XPI) x; + XPI p2 = (XPI) y; return p1.Target == p2.Target && p1.Data == p2.Data; case XmlNodeType.DocumentType: - XDocumentType d1 = (XDocumentType) n1; - XDocumentType d2 = (XDocumentType) n2; + XDocumentType d1 = (XDocumentType) x; + XDocumentType d2 = (XDocumentType) y; return d1.Name == d2.Name && d1.PublicId == d2.PublicId && d1.SystemId == d2.SystemId && d1.InternalSubset == d2.InternalSubset; case XmlNodeType.Text: - return ((XText) n1).Value == ((XText) n2).Value; + return ((XText) x).Value == ((XText) y).Value; } throw new Exception ("INTERNAL ERROR: should not happen"); } @@ -138,20 +138,20 @@ namespace System.Xml.Linq d.Standalone.GetHashCode (); } - public int GetHashCode (XNode node) + public int GetHashCode (XNode obj) { - if (node == null) + if (obj == null) return 0; - int h = ((int) node.NodeType << 6); - switch (node.NodeType) { + int h = ((int) obj.NodeType << 6); + switch (obj.NodeType) { case XmlNodeType.Document: - XDocument doc = (XDocument) node; + XDocument doc = (XDocument) obj; h = h ^ GetHashCode (doc.Declaration); foreach (XNode n in doc.Nodes ()) h = h ^ (n.GetHashCode () << 5); break; case XmlNodeType.Element: - XElement el = (XElement) node; + XElement el = (XElement) obj; h = h ^ (el.Name.GetHashCode () << 3); foreach (XAttribute a in el.Attributes ()) h = h ^ (a.GetHashCode () << 7); @@ -159,29 +159,29 @@ namespace System.Xml.Linq h = h ^ (n.GetHashCode () << 6); break; case XmlNodeType.Comment: - h = h ^ ((XComment) node).Value.GetHashCode (); + h = h ^ ((XComment) obj).Value.GetHashCode (); break; case XmlNodeType.ProcessingInstruction: - XPI pi = (XPI) node; + XPI pi = (XPI) obj; h = h ^ ((pi.Target.GetHashCode () << 6) + pi.Data.GetHashCode ()); break; case XmlNodeType.DocumentType: - XDocumentType dtd = (XDocumentType) node; + XDocumentType dtd = (XDocumentType) obj; h = h ^ (dtd.Name.GetHashCode () << 7) ^ (dtd.PublicId.GetHashCode () << 6) ^ (dtd.SystemId.GetHashCode () << 5) ^ (dtd.InternalSubset.GetHashCode () << 4); break; case XmlNodeType.Text: - h = h ^ (((XText) node).GetHashCode ()); + h = h ^ (((XText) obj).GetHashCode ()); break; } return h; } - int IEqualityComparer.GetHashCode (object node) + int IEqualityComparer.GetHashCode (object obj) { - return GetHashCode ((XNode) node); + return GetHashCode ((XNode) obj); } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeNavigator.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeNavigator.cs index b79d362a772..84cb492334c 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeNavigator.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeNavigator.cs @@ -336,7 +336,7 @@ namespace System.Xml.Linq public override bool MoveToNext () { XNode xn = node.NextNode; - if (node is XText) + if (xn is XText) for (; xn != null; xn = xn.NextNode) if (!(xn.NextNode is XText)) break; @@ -413,8 +413,12 @@ namespace System.Xml.Linq public override void MoveToRoot () { - node = node.Document ?? node; attr = null; + if (node.Document != null) + node = node.Document; + else + while (node.Owner != null) + node = node.Owner; } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeReader.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeReader.cs index 4a0a3254b80..95631f1bbaa 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeReader.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeReader.cs @@ -46,6 +46,10 @@ namespace System.Xml.Linq this.node = node; start = node; } + +#if NET_4_0 + internal bool OmitDuplicateNamespaces { get; set; } +#endif int IXmlLineInfo.LineNumber { get { diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XObjectChangeEventArgs.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XObjectChangeEventArgs.cs index 980f45d0e69..97dd0ed8d20 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XObjectChangeEventArgs.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XObjectChangeEventArgs.cs @@ -31,9 +31,9 @@ namespace System.Xml.Linq { public class XObjectChangeEventArgs : EventArgs { - public XObjectChangeEventArgs (XObjectChange change) + public XObjectChangeEventArgs (XObjectChange objectChange) { - this.type = change; + this.type = objectChange; } // Note that those fields cannot be directly referenced in diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XProcessingInstruction.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XProcessingInstruction.cs index 8a4d399249a..ab7409bfb59 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XProcessingInstruction.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XProcessingInstruction.cs @@ -34,13 +34,13 @@ namespace System.Xml.Linq string name; string data; - public XProcessingInstruction (string name, string data) + public XProcessingInstruction (string target, string data) { - if (name == null) - throw new ArgumentNullException ("name"); + if (target == null) + throw new ArgumentNullException ("target"); if (data == null) throw new ArgumentNullException ("data"); - this.name = name; + this.name = target; this.data = data; } @@ -74,9 +74,9 @@ namespace System.Xml.Linq } } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { - w.WriteProcessingInstruction (name, data); + writer.WriteProcessingInstruction (name, data); } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq/XText.cs b/mcs/class/System.Xml.Linq/System.Xml.Linq/XText.cs index 4ad1b25bf6a..e8c6ada5c73 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq/XText.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq/XText.cs @@ -59,12 +59,12 @@ namespace System.Xml.Linq } } - public override void WriteTo (XmlWriter w) + public override void WriteTo (XmlWriter writer) { if (Value.Length > 0 && Value.All (c => c == ' ' || c == '\t' || c == '\r' || c == '\n')) - w.WriteWhitespace (value); + writer.WriteWhitespace (value); else - w.WriteString (value); + writer.WriteString (value); } } } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs b/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs index 086257dbcbb..83bee5fe7e8 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs @@ -34,62 +34,62 @@ namespace System.Xml.Schema { public static class Extensions { - public static IXmlSchemaInfo GetSchemaInfo (this XAttribute attribute) + public static IXmlSchemaInfo GetSchemaInfo (this XAttribute source) { - return attribute.Annotation (); + return source.Annotation (); } - public static IXmlSchemaInfo GetSchemaInfo (this XElement element) + public static IXmlSchemaInfo GetSchemaInfo (this XElement source) { - return element.Annotation (); + return source.Annotation (); } - public static void Validate (this XAttribute attribute, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler handler) + public static void Validate (this XAttribute source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler) { - Validate (attribute, partialValidationType, schemas, handler, false); + Validate (source, partialValidationType, schemas, validationEventHandler, false); } - public static void Validate (this XAttribute attribute, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler handler, bool addSchemaInfo) + public static void Validate (this XAttribute source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) { - if (attribute == null) - throw new ArgumentNullException ("attribute"); + if (source == null) + throw new ArgumentNullException ("source"); if (schemas == null) throw new ArgumentNullException ("schemas"); var nsmgr = new XmlNamespaceManager (new NameTable ()); var v = new XmlSchemaValidator (nsmgr.NameTable, schemas, nsmgr, XmlSchemaValidationFlags.None); - if (handler != null) - v.ValidationEventHandler += handler; + if (validationEventHandler != null) + v.ValidationEventHandler += validationEventHandler; if (partialValidationType != null) v.Initialize (partialValidationType); else v.Initialize (); var xi = addSchemaInfo ? new XmlSchemaInfo () : null; - v.ValidateAttribute (attribute.Name.LocalName, attribute.Name.NamespaceName, attribute.Value, xi); + v.ValidateAttribute (source.Name.LocalName, source.Name.NamespaceName, source.Value, xi); } - public static void Validate (this XDocument document, XmlSchemaSet schemas, ValidationEventHandler handler) + public static void Validate (this XDocument source, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler) { - Validate (document, schemas, handler, false); + Validate (source, schemas, validationEventHandler, false); } - public static void Validate (this XDocument document, XmlSchemaSet schemas, ValidationEventHandler handler, bool addSchemaInfo) + public static void Validate (this XDocument source, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) { - if (document == null) - throw new ArgumentNullException ("document"); + if (source == null) + throw new ArgumentNullException ("source"); if (schemas == null) throw new ArgumentNullException ("schemas"); var xrs = new XmlReaderSettings () { ValidationType = ValidationType.Schema }; xrs.Schemas = schemas; - xrs.ValidationEventHandler += handler; - var source = new XNodeReader (document); - var xr = XmlReader.Create (source, xrs); + xrs.ValidationEventHandler += validationEventHandler; + var xsource = new XNodeReader (source); + var xr = XmlReader.Create (xsource, xrs); while (xr.Read ()) { if (addSchemaInfo) { if (xr.NodeType == XmlNodeType.Element) { - source.CurrentNode.AddAnnotation (xr.SchemaInfo); + xsource.CurrentNode.AddAnnotation (xr.SchemaInfo); while (xr.MoveToNextAttribute ()) if (xr.NamespaceURI != XUtil.XmlnsNamespace) - source.GetCurrentAttribute ().AddAnnotation (xr.SchemaInfo); + xsource.GetCurrentAttribute ().AddAnnotation (xr.SchemaInfo); xr.MoveToElement (); } } @@ -97,13 +97,13 @@ namespace System.Xml.Schema } [MonoTODO] - public static void Validate (this XElement element, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler handler) + public static void Validate (this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler) { throw new NotImplementedException (); } [MonoTODO] - public static void Validate (this XElement element, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler handler, bool addSchemaInfo) + public static void Validate (this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) { throw new NotImplementedException (); } diff --git a/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs b/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs index 7090cea9af7..0f2bdeee6d5 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs +++ b/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs @@ -51,9 +51,9 @@ namespace System.Xml.XPath return XPathEvaluate (node, expression, null); } - public static object XPathEvaluate (this XNode node, string expression, IXmlNamespaceResolver nsResolver) + public static object XPathEvaluate (this XNode node, string expression, IXmlNamespaceResolver resolver) { - object navigationResult = CreateNavigator (node).Evaluate (expression, nsResolver); + object navigationResult = CreateNavigator (node).Evaluate (expression, resolver); if (!(navigationResult is XPathNodeIterator)) return navigationResult; return GetUnderlyingXObjects((XPathNodeIterator) navigationResult); @@ -67,27 +67,27 @@ namespace System.Xml.XPath } } - public static XElement XPathSelectElement (this XNode node, string xpath) + public static XElement XPathSelectElement (this XNode node, string expression) { - return XPathSelectElement (node, xpath, null); + return XPathSelectElement (node, expression, null); } - public static XElement XPathSelectElement (this XNode node, string xpath, IXmlNamespaceResolver nsResolver) + public static XElement XPathSelectElement (this XNode node, string expression, IXmlNamespaceResolver resolver) { - XPathNavigator nav = CreateNavigator (node).SelectSingleNode (xpath, nsResolver); + XPathNavigator nav = CreateNavigator (node).SelectSingleNode (expression, resolver); if (nav == null) return null; return nav.UnderlyingObject as XElement; } - public static IEnumerable XPathSelectElements (this XNode node, string xpath) + public static IEnumerable XPathSelectElements (this XNode node, string expression) { - return XPathSelectElements (node, xpath, null); + return XPathSelectElements (node, expression, null); } - public static IEnumerable XPathSelectElements (this XNode node, string xpath, IXmlNamespaceResolver nsResolver) + public static IEnumerable XPathSelectElements (this XNode node, string expression, IXmlNamespaceResolver resolver) { - XPathNodeIterator iter = CreateNavigator (node).Select (xpath, nsResolver); + XPathNodeIterator iter = CreateNavigator (node).Select (expression, resolver); foreach (XPathNavigator nav in iter){ if (nav.UnderlyingObject is XElement) yield return (XElement) nav.UnderlyingObject; diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XDocumentTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XDocumentTest.cs index 5d5a843df4e..7a1fbcb06b5 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XDocumentTest.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XDocumentTest.cs @@ -112,5 +112,19 @@ namespace MonoTests.System.Xml.Linq var doc = new XDocument (); doc.Add (new XAttribute ("foo", " ")); } + + [Test] // bug #4850 + public void AddXmlDeclarationEvenForDecllessDoc () + { + var doc = new XDocument ( + new XElement ("resources", + new XElement ("string", + new XAttribute ("name", "whatever"), + "This is sparta"))); + var sw = new StringWriter (); + using (var writer = new XmlTextWriter (sw)) + doc.WriteTo (writer); + Assert.IsTrue (sw.ToString ().StartsWith (" + + "; + var e = XElement.Parse (xml); + string expected = @"".Replace ('\'', '"'); + Assert.AreEqual (expected, e.Nodes ().First ().ToString (), "#1"); + } + + [Test] // bug #5519 + public void DoUseEmptyNamespacePrefixWhenApplicable () + { + XNamespace ns = "http://jabber.org/protocol/geoloc"; + XElement newElement = new XElement(ns + "geoloc"); + Assert.AreEqual ("", newElement.ToString (), "#1"); + } } } diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeNavigatorTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeNavigatorTest.cs index c0694df42d1..329abee447a 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeNavigatorTest.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeNavigatorTest.cs @@ -74,5 +74,28 @@ namespace MonoTests.System.Xml.Linq XElement xeOldRef = xeOldOwner.XPathSelectElement(xpathOld); Assert.AreEqual ("".Replace ('\'', '"'), xeOldRef.ToString (), "#1"); } + + [Test] + public void Bug4739 () + { + string data = "ABC"; + XElement doc = XElement.Parse (data); + var iterator = doc.CreateNavigator ().Select ("//parent/child"); + iterator.MoveNext (); + var element = iterator.Current; + Assert.AreEqual ("B", element.InnerXml); + } + + [Test] + public void MoveToRoot_Bug4690 () + { + string data = ""; + XElement doc = XElement.Parse (data); + var iterator = doc.CreateNavigator ().Select ("//child"); + iterator.MoveNext (); + var element = iterator.Current; + element.MoveToRoot (); + Assert.AreEqual ("root", element.Name); + } } } diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs index ad8d0168f1f..f099ef433de 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs @@ -416,7 +416,6 @@ namespace MonoTests.System.Xml Assert.IsTrue (i.MoveNext (), "#2"); } -#if NET_2_0 [Test] public void ValueAsBoolean () { @@ -687,6 +686,5 @@ namespace MonoTests.System.Xml return; Assert.Fail ("no selection"); } -#endif } } diff --git a/mcs/class/System.Xml.Serialization/Assembly/AssemblyInfo.cs b/mcs/class/System.Xml.Serialization/Assembly/AssemblyInfo.cs index cb21ac91649..57a517db630 100644 --- a/mcs/class/System.Xml.Serialization/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Xml.Serialization/Assembly/AssemblyInfo.cs @@ -58,5 +58,3 @@ using System.Runtime.InteropServices; [assembly: AssemblyKeyFile ("../winfx.pub")] [assembly: AssemblyFileVersion (Consts.FxFileVersion)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] diff --git a/mcs/class/System/Makefile b/mcs/class/System/Makefile index c366874de7c..9633852e233 100644 --- a/mcs/class/System/Makefile +++ b/mcs/class/System/Makefile @@ -20,7 +20,7 @@ TEST_RESOURCES = \ Test/System/test-uri-props-manual.txt \ Test/System/test-uri-relative-props.txt -TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:1595 -nowarn:0618 -nowarn:219 -nowarn:67 -nowarn:169 -nowarn:612 \ +TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:0618 -nowarn:219 -nowarn:67 -nowarn:169 -nowarn:612 \ $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f))) ifneq (1, $(FRAMEWORK_VERSION_MAJOR)) diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs index 1423cbda1b4..716beaaa851 100644 --- a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs +++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs @@ -78,7 +78,7 @@ namespace Mono.CSharp if (!File.Exists (windowsMonoPath)) throw new FileNotFoundException ("Windows mono path not found: " + windowsMonoPath); - windowsMcsPath = Path.Combine (p, "4.0\\mcs.exe"); + windowsMcsPath = Path.Combine (p, "4.5\\mcs.exe"); if (!File.Exists (windowsMcsPath)) windowsMcsPath = Path.Combine(Path.GetDirectoryName (p), "lib\\build\\mcs.exe"); @@ -281,7 +281,7 @@ namespace Mono.CSharp using (FileStream fs = File.OpenRead(options.OutputAssembly)) { byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); - results.CompiledAssembly = Assembly.Load(buffer, null, options.Evidence); + results.CompiledAssembly = Assembly.Load(buffer, null); fs.Close(); } } else { diff --git a/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs b/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs index 6f77a60f22e..0b278a99fef 100644 --- a/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs +++ b/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs @@ -295,7 +295,7 @@ namespace Microsoft.VisualBasic using (FileStream fs = File.OpenRead (options.OutputAssembly)) { byte[] buffer = new byte[fs.Length]; fs.Read (buffer, 0, buffer.Length); - results.CompiledAssembly = Assembly.Load (buffer, null, options.Evidence); + results.CompiledAssembly = Assembly.Load (buffer, null); fs.Close (); } } else { diff --git a/mcs/class/System/Microsoft.VisualBasic/VBCodeGenerator.cs b/mcs/class/System/Microsoft.VisualBasic/VBCodeGenerator.cs index 68238ee1518..db1e087e442 100644 --- a/mcs/class/System/Microsoft.VisualBasic/VBCodeGenerator.cs +++ b/mcs/class/System/Microsoft.VisualBasic/VBCodeGenerator.cs @@ -338,13 +338,8 @@ namespace Microsoft.VisualBasic { CodeEventReferenceExpression ev = expression.TargetObject as CodeEventReferenceExpression; -#if ONLY_1_1 - Output.Write ("RaiseEvent "); -#endif if (ev != null) { -#if NET_2_0 Output.Write ("RaiseEvent "); -#endif if (ev.TargetObject != null && !(ev.TargetObject is CodeThisReferenceExpression)) { GenerateExpression (ev.TargetObject); Output.Write ("."); diff --git a/mcs/class/System/Microsoft.Win32/SystemEvents.cs b/mcs/class/System/Microsoft.Win32/SystemEvents.cs index 2496edeecdf..92f4e4e9fa9 100644 --- a/mcs/class/System/Microsoft.Win32/SystemEvents.cs +++ b/mcs/class/System/Microsoft.Win32/SystemEvents.cs @@ -108,11 +108,9 @@ namespace Microsoft.Win32 { } [MonoTODO("Currently does nothing on Mono")] -#if NET_2_0 [Browsable (false)] [EditorBrowsable (EditorBrowsableState.Never)] [Obsolete ("")] -#endif public static event System.EventHandler LowMemory { add { } @@ -146,13 +144,12 @@ namespace Microsoft.Win32 { add { } remove { } } -#if NET_2_0 [MonoTODO("Currently does nothing on Mono")] public static event SessionSwitchEventHandler SessionSwitch { add { } remove { } } -#endif + [MonoTODO("Currently does nothing on Mono")] public static event System.EventHandler TimeChanged { diff --git a/mcs/class/System/System-build.csproj b/mcs/class/System/System-build.csproj index dceff2462e8..b2b1bb748ac 100644 --- a/mcs/class/System/System-build.csproj +++ b/mcs/class/System/System-build.csproj @@ -803,6 +803,7 @@ + diff --git a/mcs/class/System/System-net_2_0.csproj b/mcs/class/System/System-net_2_0.csproj index d98f03de7e3..680ca7ca9ae 100644 --- a/mcs/class/System/System-net_2_0.csproj +++ b/mcs/class/System/System-net_2_0.csproj @@ -803,6 +803,7 @@ + diff --git a/mcs/class/System/System-net_4_0.csproj b/mcs/class/System/System-net_4_0.csproj index 3f939ec494f..1fc575f20a2 100644 --- a/mcs/class/System/System-net_4_0.csproj +++ b/mcs/class/System/System-net_4_0.csproj @@ -803,6 +803,7 @@ + diff --git a/mcs/class/System/System-net_4_5.csproj b/mcs/class/System/System-net_4_5.csproj index 8ac37329071..d9232f0e551 100644 --- a/mcs/class/System/System-net_4_5.csproj +++ b/mcs/class/System/System-net_4_5.csproj @@ -803,6 +803,7 @@ + diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs b/mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs index f9b70f8325b..bfc7990c13d 100644 --- a/mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs +++ b/mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs @@ -90,5 +90,5 @@ namespace System.CodeDom.Compiler } } } -#endif // NET_2_0 +#endif diff --git a/mcs/class/System/System.CodeDom/CodeRegionMode.cs b/mcs/class/System/System.CodeDom/CodeRegionMode.cs index 9141c9d500b..87691387be3 100644 --- a/mcs/class/System/System.CodeDom/CodeRegionMode.cs +++ b/mcs/class/System/System.CodeDom/CodeRegionMode.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.InteropServices; namespace System.CodeDom @@ -42,5 +40,3 @@ namespace System.CodeDom End = 1 << 1 } } - -#endif diff --git a/mcs/class/System/System.Collections.Generic/SortedList.cs b/mcs/class/System/System.Collections.Generic/SortedList.cs index d91ce2ecf77..259d0f8236f 100644 --- a/mcs/class/System/System.Collections.Generic/SortedList.cs +++ b/mcs/class/System/System.Collections.Generic/SortedList.cs @@ -197,13 +197,6 @@ namespace System.Collections.Generic Array.Copy (table, newTable, inUse); this.table = newTable; } -#if NET_1_0 - else if (current > defaultCapacity && value < current) { - KeyValuePair [] newTable = new KeyValuePair [defaultCapacity]; - Array.Copy (table, newTable, inUse); - this.table = newTable; - } -#endif else if (value > inUse) { KeyValuePair [] newTable = new KeyValuePair [value]; Array.Copy (table, newTable, inUse); @@ -475,12 +468,7 @@ namespace System.Collections.Generic if (key == null) throw new ArgumentNullException ("key"); - int indx = 0; - try { - indx = Find (key); - } catch (Exception) { - throw new InvalidOperationException(); - } + int indx = Find (key); return (indx | (indx >> 31)); } @@ -570,13 +558,7 @@ namespace System.Collections.Generic KeyValuePair [] table = this.table; - int freeIndx = -1; - - try { - freeIndx = Find (key); - } catch (Exception) { - throw new InvalidOperationException(); - } + int freeIndx = Find (key); if (freeIndx >= 0) { if (!overwrite) @@ -631,6 +613,15 @@ namespace System.Collections.Generic } } + private int Compare (TKey a, TKey b) + { + try { + return comparer.Compare (a, b); + } catch (Exception ex) { + throw new InvalidOperationException ("Failed to compare two elements.", ex); + } + } + private int Find (TKey key) { KeyValuePair [] table = this.table; @@ -644,7 +635,7 @@ namespace System.Collections.Generic while (left <= right) { int guess = (left + right) >> 1; - int cmp = comparer.Compare (table[guess].Key, key); + int cmp = Compare (table[guess].Key, key); if (cmp == 0) return guess; if (cmp < 0) left = guess+1; diff --git a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs b/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs index ae157d4faec..a1a377da08f 100644 --- a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs +++ b/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs @@ -195,13 +195,8 @@ namespace System.Collections.Specialized protected NameObjectCollectionBase () { m_readonly = false; -#if NET_1_0 - m_hashprovider = CaseInsensitiveHashCodeProvider.Default; - m_comparer = CaseInsensitiveComparer.Default; -#else m_hashprovider = CaseInsensitiveHashCodeProvider.DefaultInvariant; m_comparer = CaseInsensitiveComparer.DefaultInvariant; -#endif m_defCapacity = 0; Init(); } @@ -209,13 +204,8 @@ namespace System.Collections.Specialized protected NameObjectCollectionBase( int capacity ) { m_readonly = false; -#if NET_1_0 - m_hashprovider = CaseInsensitiveHashCodeProvider.Default; - m_comparer = CaseInsensitiveComparer.Default; -#else m_hashprovider = CaseInsensitiveHashCodeProvider.DefaultInvariant; m_comparer = CaseInsensitiveComparer.DefaultInvariant; -#endif m_defCapacity = capacity; Init(); } diff --git a/mcs/class/System/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs b/mcs/class/System/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs index c7fb28c0c4d..a1babca0384 100644 --- a/mcs/class/System/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs +++ b/mcs/class/System/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs @@ -29,8 +29,5 @@ namespace System.ComponentModel.Design.Serialization { -#if !NET_2_0 - [Serializable] -#endif public delegate void ResolveNameEventHandler (object sender, ResolveNameEventArgs e); } diff --git a/mcs/class/System/System.ComponentModel.Design/ActiveDesignerEventHandler.cs b/mcs/class/System/System.ComponentModel.Design/ActiveDesignerEventHandler.cs index be9010788a6..93970b0ff12 100644 --- a/mcs/class/System/System.ComponentModel.Design/ActiveDesignerEventHandler.cs +++ b/mcs/class/System/System.ComponentModel.Design/ActiveDesignerEventHandler.cs @@ -31,8 +31,5 @@ using System.Runtime.Serialization; namespace System.ComponentModel.Design { -#if !NET_2_0 - [Serializable] -#endif public delegate void ActiveDesignerEventHandler (object sender, ActiveDesignerEventArgs e); } diff --git a/mcs/class/System/System.ComponentModel.Design/ComponentChangedEventHandler.cs b/mcs/class/System/System.ComponentModel.Design/ComponentChangedEventHandler.cs index 33274ceb5e1..b870c4451e7 100644 --- a/mcs/class/System/System.ComponentModel.Design/ComponentChangedEventHandler.cs +++ b/mcs/class/System/System.ComponentModel.Design/ComponentChangedEventHandler.cs @@ -32,9 +32,6 @@ using System.Runtime.InteropServices; namespace System.ComponentModel.Design { -#if !NET_2_0 - [Serializable] -#endif [ComVisible(true)] public delegate void ComponentChangedEventHandler (object sender, ComponentChangedEventArgs e); diff --git a/mcs/class/System/System.ComponentModel.Design/ComponentChangingEventHandler.cs b/mcs/class/System/System.ComponentModel.Design/ComponentChangingEventHandler.cs index 641db4fb148..af75ac8a366 100644 --- a/mcs/class/System/System.ComponentModel.Design/ComponentChangingEventHandler.cs +++ b/mcs/class/System/System.ComponentModel.Design/ComponentChangingEventHandler.cs @@ -32,9 +32,6 @@ using System.Runtime.InteropServices; namespace System.ComponentModel.Design { -#if !NET_2_0 - [Serializable] -#endif [ComVisible(true)] public delegate void ComponentChangingEventHandler (object sender, ComponentChangingEventArgs e); diff --git a/mcs/class/System/System.ComponentModel/DoWorkEventArgs.cs b/mcs/class/System/System.ComponentModel/DoWorkEventArgs.cs index 79e9aa11f41..0f72b95be51 100644 --- a/mcs/class/System/System.ComponentModel/DoWorkEventArgs.cs +++ b/mcs/class/System/System.ComponentModel/DoWorkEventArgs.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public class DoWorkEventArgs @@ -65,5 +63,3 @@ namespace System.ComponentModel #endif } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/DoWorkEventHandler.cs b/mcs/class/System/System.ComponentModel/DoWorkEventHandler.cs index 8face463ada..6263bed82f8 100644 --- a/mcs/class/System/System.ComponentModel/DoWorkEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/DoWorkEventHandler.cs @@ -26,11 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public delegate void DoWorkEventHandler (object sender, DoWorkEventArgs e); } - -#endif diff --git a/mcs/class/System/System.ComponentModel/EnumConverter.cs b/mcs/class/System/System.ComponentModel/EnumConverter.cs index a986b22f23a..9b82920b150 100644 --- a/mcs/class/System/System.ComponentModel/EnumConverter.cs +++ b/mcs/class/System/System.ComponentModel/EnumConverter.cs @@ -54,10 +54,8 @@ namespace System.ComponentModel if (destinationType == typeof (InstanceDescriptor)) return true; -#if NET_2_0 if (destinationType == typeof (Enum[])) return true; -#endif return base.CanConvertTo (context, destinationType); } @@ -97,7 +95,6 @@ namespace System.ComponentModel if (f != null) return new InstanceDescriptor (f, null); } -#if NET_2_0 } else if (destinationType == typeof (Enum[]) && value != null) { if (!IsFlags) { return new Enum[] { (Enum) Enum.ToObject (type, value) }; @@ -132,7 +129,6 @@ namespace System.ComponentModel return enums.ToArray (typeof(Enum)); } -#endif } return base.ConvertTo (context, culture, value, destinationType); @@ -143,10 +139,8 @@ namespace System.ComponentModel if (sourceType == typeof (string)) return true; -#if NET_2_0 if (sourceType == typeof (Enum[])) return true; -#endif return base.CanConvertFrom (context, sourceType); } @@ -157,9 +151,7 @@ namespace System.ComponentModel { if (value is string) { string name = value as string; -#if NET_2_0 try { -#endif if (name.IndexOf (',') == -1) return Enum.Parse (type, name, true); @@ -170,20 +162,16 @@ namespace System.ComponentModel val |= Convert.ToInt64 (e, culture); } return Enum.ToObject (type, val); -#if NET_2_0 } catch (Exception ex) { throw new FormatException (name + " is " + "not a valid value for " + type.Name, ex); } -#endif -#if NET_2_0 } else if (value is Enum[]) { long val = 0; foreach (Enum e in (Enum[])value) val |= Convert.ToInt64 (e, culture); return Enum.ToObject (type, val); -#endif } return base.ConvertFrom (context, culture, value); diff --git a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs index bd15e720453..693f308a5e2 100644 --- a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs +++ b/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs @@ -57,10 +57,7 @@ namespace System.ComponentModel { } -#if NET_2_0 - public -#endif - EventDescriptorCollection (EventDescriptor[] events, bool readOnly) + public EventDescriptorCollection (EventDescriptor[] events, bool readOnly) { this.isReadOnly = readOnly; if (events == null) @@ -96,7 +93,6 @@ namespace System.ComponentModel public virtual EventDescriptor Find (string name, bool ignoreCase) { foreach (EventDescriptor e in eventList) { -#if NET_2_0 if (ignoreCase) { if (0 == String.Compare (name, e.Name, StringComparison.OrdinalIgnoreCase)) return e; @@ -104,10 +100,6 @@ namespace System.ComponentModel if (0 == String.Compare (name, e.Name, StringComparison.Ordinal)) return e; } -#else - if (0 == String.Compare (name, e.Name, ignoreCase, CultureInfo.InvariantCulture)) - return e; -#endif } return null; } @@ -279,11 +271,7 @@ namespace System.ComponentModel bool IList.IsFixedSize { get { -#if NET_2_0 return isReadOnly; -#else - return !isReadOnly; -#endif } } diff --git a/mcs/class/System/System.ComponentModel/EventHandlerList.cs b/mcs/class/System/System.ComponentModel/EventHandlerList.cs index 901191004b5..ec0cb33f5d6 100644 --- a/mcs/class/System/System.ComponentModel/EventHandlerList.cs +++ b/mcs/class/System/System.ComponentModel/EventHandlerList.cs @@ -31,10 +31,7 @@ using System; using System.Collections; - -#if NET_2_0 using System.Collections.Generic; -#endif namespace System.ComponentModel { @@ -96,7 +93,6 @@ namespace System.ComponentModel { entry.value = Delegate.Combine (entry.value, value); } -#if NET_2_0 public void AddHandlers (EventHandlerList listToAddFrom) { if (listToAddFrom == null) @@ -108,7 +104,6 @@ namespace System.ComponentModel { entry = entry.next; } } -#endif public void RemoveHandler (object key, Delegate value) { diff --git a/mcs/class/System/System.ComponentModel/HandledEventArgs.cs b/mcs/class/System/System.ComponentModel/HandledEventArgs.cs index d4adb0ef16f..1d1993115f8 100644 --- a/mcs/class/System/System.ComponentModel/HandledEventArgs.cs +++ b/mcs/class/System/System.ComponentModel/HandledEventArgs.cs @@ -24,8 +24,6 @@ // -#if NET_2_0 - namespace System.ComponentModel { public class HandledEventArgs : EventArgs { @@ -49,4 +47,3 @@ namespace System.ComponentModel { } -#endif diff --git a/mcs/class/System/System.ComponentModel/HandledEventHandler.cs b/mcs/class/System/System.ComponentModel/HandledEventHandler.cs index 2dd92446502..74428d0c7fe 100644 --- a/mcs/class/System/System.ComponentModel/HandledEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/HandledEventHandler.cs @@ -23,13 +23,9 @@ // Pedro Martínez Juliá // - -#if NET_2_0 - namespace System.ComponentModel { public delegate void HandledEventHandler (object sender, HandledEventArgs e); } -#endif diff --git a/mcs/class/System/System.ComponentModel/IBindingListView.cs b/mcs/class/System/System.ComponentModel/IBindingListView.cs index 9b50f39d1fc..c4d65b65946 100644 --- a/mcs/class/System/System.ComponentModel/IBindingListView.cs +++ b/mcs/class/System/System.ComponentModel/IBindingListView.cs @@ -24,8 +24,6 @@ // -#if NET_2_0 - using System.Collections; namespace System.ComponentModel { @@ -48,4 +46,3 @@ namespace System.ComponentModel { } -#endif diff --git a/mcs/class/System/System.ComponentModel/ICancelAddNew.cs b/mcs/class/System/System.ComponentModel/ICancelAddNew.cs index d39618bb72a..be426f3bb87 100644 --- a/mcs/class/System/System.ComponentModel/ICancelAddNew.cs +++ b/mcs/class/System/System.ComponentModel/ICancelAddNew.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public interface ICancelAddNew @@ -39,4 +37,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/IChangeTracking.cs b/mcs/class/System/System.ComponentModel/IChangeTracking.cs index f17024a42be..156d715e84a 100644 --- a/mcs/class/System/System.ComponentModel/IChangeTracking.cs +++ b/mcs/class/System/System.ComponentModel/IChangeTracking.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.ComponentModel { public interface IChangeTracking @@ -37,4 +36,3 @@ namespace System.ComponentModel { void AcceptChanges (); } } -#endif diff --git a/mcs/class/System/System.ComponentModel/IComNativeDescriptorHandler.cs b/mcs/class/System/System.ComponentModel/IComNativeDescriptorHandler.cs index bbe9bed1fa3..da311e7a324 100644 --- a/mcs/class/System/System.ComponentModel/IComNativeDescriptorHandler.cs +++ b/mcs/class/System/System.ComponentModel/IComNativeDescriptorHandler.cs @@ -32,9 +32,7 @@ using System; namespace System.ComponentModel { -#if NET_2_0 [Obsolete ("Use TypeDescriptionProvider and TypeDescriptor.ComObjectType instead")] -#endif public interface IComNativeDescriptorHandler { AttributeCollection GetAttributes(object component); diff --git a/mcs/class/System/System.ComponentModel/IIntellisenseBuilder.cs b/mcs/class/System/System.ComponentModel/IIntellisenseBuilder.cs index a9e3da85c5b..c2a9d589ecf 100644 --- a/mcs/class/System/System.ComponentModel/IIntellisenseBuilder.cs +++ b/mcs/class/System/System.ComponentModel/IIntellisenseBuilder.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public interface IIntellisenseBuilder @@ -38,5 +36,3 @@ namespace System.ComponentModel bool Show (string language, string value, ref string newValue); } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/IListSource.cs b/mcs/class/System/System.ComponentModel/IListSource.cs index f8f646a16e6..25bc82cabb6 100644 --- a/mcs/class/System/System.ComponentModel/IListSource.cs +++ b/mcs/class/System/System.ComponentModel/IListSource.cs @@ -35,13 +35,11 @@ namespace System.ComponentModel /// /// Provides functionality to an object to return a list that can be bound to a data source. /// -#if NET_2_0 [MergableProperty (false)] [TypeConverter ("System.Windows.Forms.Design.DataSourceConverter, " + Consts.AssemblySystem_Design)] // disable it until winforms guys have this internal class or some alternatives implemented. // [Editor (EditorTypeName = "System.Windows.Forms.Design.DataSourceListEditor, " + AssemblySystem_Design, // EditorBaseTypeName = "System.Drawing.Design.UITypeEditor, " + AssemblySystem_Drawing)] -#endif public interface IListSource { IList GetList (); diff --git a/mcs/class/System/System.ComponentModel/INestedContainer.cs b/mcs/class/System/System.ComponentModel/INestedContainer.cs index 0f9d648561e..a03238f28cd 100644 --- a/mcs/class/System/System.ComponentModel/INestedContainer.cs +++ b/mcs/class/System/System.ComponentModel/INestedContainer.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.ComponentModel @@ -39,5 +37,3 @@ namespace System.ComponentModel IComponent Owner { get; } } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/INestedSite.cs b/mcs/class/System/System.ComponentModel/INestedSite.cs index 189fae05584..7ce2d3e6834 100644 --- a/mcs/class/System/System.ComponentModel/INestedSite.cs +++ b/mcs/class/System/System.ComponentModel/INestedSite.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.ComponentModel @@ -40,4 +38,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/INotifyPropertyChanged.cs b/mcs/class/System/System.ComponentModel/INotifyPropertyChanged.cs index 1102a5e81fa..f7d71c45917 100644 --- a/mcs/class/System/System.ComponentModel/INotifyPropertyChanged.cs +++ b/mcs/class/System/System.ComponentModel/INotifyPropertyChanged.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.ComponentModel @@ -38,4 +37,3 @@ namespace System.ComponentModel } -#endif diff --git a/mcs/class/System/System.ComponentModel/INotifyPropertyChanging.cs b/mcs/class/System/System.ComponentModel/INotifyPropertyChanging.cs index 948bcd78792..b6248be90e3 100644 --- a/mcs/class/System/System.ComponentModel/INotifyPropertyChanging.cs +++ b/mcs/class/System/System.ComponentModel/INotifyPropertyChanging.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 // SP1 - using System; namespace System.ComponentModel @@ -37,5 +35,3 @@ namespace System.ComponentModel event PropertyChangingEventHandler PropertyChanging; } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/IRaiseItemChangedEvents.cs b/mcs/class/System/System.ComponentModel/IRaiseItemChangedEvents.cs index 010a1f6dcba..1cc33d9c9d9 100644 --- a/mcs/class/System/System.ComponentModel/IRaiseItemChangedEvents.cs +++ b/mcs/class/System/System.ComponentModel/IRaiseItemChangedEvents.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { /// @@ -40,5 +38,3 @@ namespace System.ComponentModel bool RaisesItemChangedEvents { get; } } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/IRevertibleChangeTracking.cs b/mcs/class/System/System.ComponentModel/IRevertibleChangeTracking.cs index 3c111d26df2..e5fc0ff66c3 100644 --- a/mcs/class/System/System.ComponentModel/IRevertibleChangeTracking.cs +++ b/mcs/class/System/System.ComponentModel/IRevertibleChangeTracking.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.ComponentModel { public interface IRevertibleChangeTracking : IChangeTracking @@ -35,4 +34,3 @@ namespace System.ComponentModel { void RejectChanges (); } } -#endif diff --git a/mcs/class/System/System.ComponentModel/ISupportInitializeNotification.cs b/mcs/class/System/System.ComponentModel/ISupportInitializeNotification.cs index 56fdc7d4698..a7d61093fa0 100644 --- a/mcs/class/System/System.ComponentModel/ISupportInitializeNotification.cs +++ b/mcs/class/System/System.ComponentModel/ISupportInitializeNotification.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { /// @@ -41,4 +39,3 @@ namespace System.ComponentModel event EventHandler Initialized; } } -#endif diff --git a/mcs/class/System/System.ComponentModel/InheritanceLevel.cs b/mcs/class/System/System.ComponentModel/InheritanceLevel.cs index a85b9a0dd40..39f3414be47 100644 --- a/mcs/class/System/System.ComponentModel/InheritanceLevel.cs +++ b/mcs/class/System/System.ComponentModel/InheritanceLevel.cs @@ -32,9 +32,6 @@ namespace System.ComponentModel { -#if !NET_2_0 - [Serializable] -#endif public enum InheritanceLevel { Inherited = 1, diff --git a/mcs/class/System/System.ComponentModel/InitializationEventAttribute.cs b/mcs/class/System/System.ComponentModel/InitializationEventAttribute.cs index 3bc2c09b951..3e4e3445b60 100644 --- a/mcs/class/System/System.ComponentModel/InitializationEventAttribute.cs +++ b/mcs/class/System/System.ComponentModel/InitializationEventAttribute.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { [AttributeUsage (AttributeTargets.Class)] @@ -48,4 +46,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/InstanceCreationEditor.cs b/mcs/class/System/System.ComponentModel/InstanceCreationEditor.cs index ee8aab92335..04baca87ece 100644 --- a/mcs/class/System/System.ComponentModel/InstanceCreationEditor.cs +++ b/mcs/class/System/System.ComponentModel/InstanceCreationEditor.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.ComponentModel @@ -44,4 +42,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/InvalidAsynchronousStateException.cs b/mcs/class/System/System.ComponentModel/InvalidAsynchronousStateException.cs index 8032acd1dfd..fa580662409 100644 --- a/mcs/class/System/System.ComponentModel/InvalidAsynchronousStateException.cs +++ b/mcs/class/System/System.ComponentModel/InvalidAsynchronousStateException.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Runtime.Serialization; @@ -60,4 +58,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/InvalidEnumArgumentException.cs b/mcs/class/System/System.ComponentModel/InvalidEnumArgumentException.cs index fb5d43f9f6b..a4ac4ac28ce 100644 --- a/mcs/class/System/System.ComponentModel/InvalidEnumArgumentException.cs +++ b/mcs/class/System/System.ComponentModel/InvalidEnumArgumentException.cs @@ -35,9 +35,7 @@ using System.Security.Permissions; namespace System.ComponentModel { -#if NET_2_0 [Serializable] -#endif public class InvalidEnumArgumentException : ArgumentException { @@ -50,19 +48,13 @@ namespace System.ComponentModel } public InvalidEnumArgumentException (string argumentName, int invalidValue, Type enumClass) : -#if NET_2_0 base (string.Format (CultureInfo.CurrentCulture, "The value " + "of argument '{0}' ({1}) is invalid for " + "Enum type '{2}'.", argumentName, invalidValue, enumClass.Name), argumentName) -#else - base (string.Format (CultureInfo.CurrentCulture, "Enum argument value" - + " {0} is not valid for {1}. {1} should be a value from {2}.", - invalidValue, argumentName, enumClass.Name), argumentName) -#endif { } -#if NET_2_0 + public InvalidEnumArgumentException (string message, Exception innerException) : base (message, innerException) { @@ -72,6 +64,5 @@ namespace System.ComponentModel : base (info, context) { } -#endif } } diff --git a/mcs/class/System/System.ComponentModel/LicenseException.cs b/mcs/class/System/System.ComponentModel/LicenseException.cs index 629bb27d32f..c1231aa6a9a 100644 --- a/mcs/class/System/System.ComponentModel/LicenseException.cs +++ b/mcs/class/System/System.ComponentModel/LicenseException.cs @@ -34,9 +34,7 @@ using System.Security.Permissions; namespace System.ComponentModel { -#if NET_2_0 [Serializable] -#endif public class LicenseException : SystemException { @@ -67,7 +65,7 @@ namespace System.ComponentModel { // LAMESPEC what should we do with instance? this.type = type; } -#if NET_2_0 + protected LicenseException (SerializationInfo info, StreamingContext context) : base (info, context) { @@ -83,7 +81,7 @@ namespace System.ComponentModel { info.AddValue ("LicensedType", type); base.GetObjectData (info, context); } -#endif + public Type LicensedType { get { return type; } } diff --git a/mcs/class/System/System.ComponentModel/LicenseUsageMode.cs b/mcs/class/System/System.ComponentModel/LicenseUsageMode.cs index 05928a160d2..11b0ccec082 100644 --- a/mcs/class/System/System.ComponentModel/LicenseUsageMode.cs +++ b/mcs/class/System/System.ComponentModel/LicenseUsageMode.cs @@ -32,9 +32,7 @@ using System.Reflection; namespace System.ComponentModel { -#if !NET_2_0 [Serializable] -#endif public enum LicenseUsageMode { Designtime = 1, diff --git a/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs b/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs index 61d04a6eba7..6799bd461d4 100644 --- a/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs +++ b/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs @@ -36,9 +36,7 @@ namespace System.ComponentModel { ListChangedType changedType; int oldIndex; int newIndex; -#if NET_2_0 PropertyDescriptor propDesc; -#endif public ListChangedEventArgs (ListChangedType listChangedType, int newIndex) @@ -50,9 +48,7 @@ namespace System.ComponentModel { PropertyDescriptor propDesc) { this.changedType = listChangedType; -#if NET_2_0 this.propDesc = propDesc; -#endif } public ListChangedEventArgs (ListChangedType listChangedType, @@ -63,7 +59,6 @@ namespace System.ComponentModel { this.oldIndex = oldIndex; } -#if NET_2_0 public ListChangedEventArgs (ListChangedType listChangedType, int newIndex, PropertyDescriptor propDesc) @@ -73,7 +68,6 @@ namespace System.ComponentModel { this.oldIndex = newIndex; this.propDesc = propDesc; } -#endif public ListChangedType ListChangedType { get { return changedType; } @@ -87,10 +81,8 @@ namespace System.ComponentModel { get { return newIndex; } } -#if NET_2_0 public PropertyDescriptor PropertyDescriptor { get { return propDesc; } } -#endif } } diff --git a/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs b/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs index c410bf3ce88..bf4196748fc 100644 --- a/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs @@ -30,9 +30,6 @@ using System; namespace System.ComponentModel { -#if !NET_2_0 - [Serializable] -#endif public delegate void ListChangedEventHandler(object sender, ListChangedEventArgs e); } diff --git a/mcs/class/System/System.ComponentModel/ListSortDescription.cs b/mcs/class/System/System.ComponentModel/ListSortDescription.cs index 3d7e74ec6af..eb1f501f935 100644 --- a/mcs/class/System/System.ComponentModel/ListSortDescription.cs +++ b/mcs/class/System/System.ComponentModel/ListSortDescription.cs @@ -24,8 +24,6 @@ // -#if NET_2_0 - namespace System.ComponentModel { public class ListSortDescription { @@ -52,4 +50,3 @@ namespace System.ComponentModel { } -#endif diff --git a/mcs/class/System/System.ComponentModel/ListSortDescriptionCollection.cs b/mcs/class/System/System.ComponentModel/ListSortDescriptionCollection.cs index 5eeb77d5fcd..6077866b314 100644 --- a/mcs/class/System/System.ComponentModel/ListSortDescriptionCollection.cs +++ b/mcs/class/System/System.ComponentModel/ListSortDescriptionCollection.cs @@ -25,8 +25,6 @@ // -#if NET_2_0 - using System.Collections; namespace System.ComponentModel { @@ -114,5 +112,3 @@ namespace System.ComponentModel { } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/ListSortDirection.cs b/mcs/class/System/System.ComponentModel/ListSortDirection.cs index 14ab81d8d15..49f12054204 100644 --- a/mcs/class/System/System.ComponentModel/ListSortDirection.cs +++ b/mcs/class/System/System.ComponentModel/ListSortDirection.cs @@ -33,9 +33,6 @@ namespace System.ComponentModel /// /// Specifies the direction of a sort operation. /// -#if !NET_2_0 - [Serializable] -#endif public enum ListSortDirection { Ascending = 0, Descending = 1 diff --git a/mcs/class/System/System.ComponentModel/LookupBindingPropertiesAttribute.cs b/mcs/class/System/System.ComponentModel/LookupBindingPropertiesAttribute.cs index ebdcdbad191..d54507fa055 100644 --- a/mcs/class/System/System.ComponentModel/LookupBindingPropertiesAttribute.cs +++ b/mcs/class/System/System.ComponentModel/LookupBindingPropertiesAttribute.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.ComponentModel @@ -110,5 +108,4 @@ namespace System.ComponentModel } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs b/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs index ef9ffa74587..08c0a14832e 100644 --- a/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs +++ b/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs @@ -42,9 +42,7 @@ namespace System.ComponentModel /// [DesignerCategory ("Component"), TypeConverter (typeof (ComponentConverter))] [Designer ("System.Windows.Forms.Design.ComponentDocumentDesigner, " + Consts.AssemblySystem_Design, typeof (IRootDesigner))] -#if NET_2_0 [ComVisible (true)] -#endif public class MarshalByValueComponent : IComponent, IDisposable, IServiceProvider { private EventHandlerList eventList; diff --git a/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs b/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs index 483d25df765..412843e6ed2 100644 --- a/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs +++ b/mcs/class/System/System.ComponentModel/MaskedTextProvider.cs @@ -50,7 +50,6 @@ $ Currency symbol. The actual character displayed will be the currency symbol ap * */ -#if NET_2_0 using System.Globalization; using System.Collections; using System.Diagnostics; @@ -2016,4 +2015,3 @@ namespace System.ComponentModel { } } -#endif diff --git a/mcs/class/System/System.ComponentModel/MaskedTextResultHint.cs b/mcs/class/System/System.ComponentModel/MaskedTextResultHint.cs index 1ad4208b6c2..1aa031be3d5 100644 --- a/mcs/class/System/System.ComponentModel/MaskedTextResultHint.cs +++ b/mcs/class/System/System.ComponentModel/MaskedTextResultHint.cs @@ -24,7 +24,6 @@ // // -#if NET_2_0 namespace System.ComponentModel { public enum MaskedTextResultHint { PositionOutOfRange = -55, @@ -44,4 +43,3 @@ namespace System.ComponentModel { Success = 4 } } -#endif diff --git a/mcs/class/System/System.ComponentModel/MemberDescriptor.cs b/mcs/class/System/System.ComponentModel/MemberDescriptor.cs index aa2f089a640..9f99fe35245 100644 --- a/mcs/class/System/System.ComponentModel/MemberDescriptor.cs +++ b/mcs/class/System/System.ComponentModel/MemberDescriptor.cs @@ -134,11 +134,9 @@ namespace System.ComponentModel public virtual string DisplayName { get { -#if NET_2_0 foreach (Attribute attr in AttributeArray) if (attr is DisplayNameAttribute) return ((DisplayNameAttribute) attr).DisplayName; -#endif return name; } } @@ -185,9 +183,7 @@ namespace System.ComponentModel return null; } -#if NET_2_0 [Obsolete ("Use GetInvocationTarget")] -#endif protected static object GetInvokee (Type componentClass, object component) { if (component is IComponent) { @@ -205,7 +201,6 @@ namespace System.ComponentModel return component; } -#if NET_2_0 protected virtual object GetInvocationTarget (Type type, object instance) { if (type == null) @@ -215,7 +210,6 @@ namespace System.ComponentModel return GetInvokee (type, instance); } -#endif protected static MethodInfo FindMethod(Type componentClass, string name, Type[] args, Type returnType) { diff --git a/mcs/class/System/System.ComponentModel/MultilineStringConverter.cs b/mcs/class/System/System.ComponentModel/MultilineStringConverter.cs index 19c10fa33fd..c1a445310f5 100644 --- a/mcs/class/System/System.ComponentModel/MultilineStringConverter.cs +++ b/mcs/class/System/System.ComponentModel/MultilineStringConverter.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Globalization; @@ -61,4 +59,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/NestedContainer.cs b/mcs/class/System/System.ComponentModel/NestedContainer.cs index 9dcaddbbf1b..a21374f537a 100644 --- a/mcs/class/System/System.ComponentModel/NestedContainer.cs +++ b/mcs/class/System/System.ComponentModel/NestedContainer.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; using System.ComponentModel; @@ -176,5 +174,3 @@ namespace System.ComponentModel } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/NullableConverter.cs b/mcs/class/System/System.ComponentModel/NullableConverter.cs index 3bc6d3805a6..830805c6e9d 100644 --- a/mcs/class/System/System.ComponentModel/NullableConverter.cs +++ b/mcs/class/System/System.ComponentModel/NullableConverter.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; using System.Globalization; @@ -199,4 +197,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/PasswordPropertyTextAttribute.cs b/mcs/class/System/System.ComponentModel/PasswordPropertyTextAttribute.cs index b8bc3624f84..bf6dccac941 100644 --- a/mcs/class/System/System.ComponentModel/PasswordPropertyTextAttribute.cs +++ b/mcs/class/System/System.ComponentModel/PasswordPropertyTextAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.ComponentModel { [AttributeUsageAttribute(AttributeTargets.All)] @@ -76,4 +75,3 @@ namespace System.ComponentModel } } } -#endif diff --git a/mcs/class/System/System.ComponentModel/ProgressChangedEventArgs.cs b/mcs/class/System/System.ComponentModel/ProgressChangedEventArgs.cs index 394e3bcf83e..8e18f60deda 100644 --- a/mcs/class/System/System.ComponentModel/ProgressChangedEventArgs.cs +++ b/mcs/class/System/System.ComponentModel/ProgressChangedEventArgs.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public class ProgressChangedEventArgs : EventArgs @@ -53,4 +51,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/ProgressChangedEventHandler.cs b/mcs/class/System/System.ComponentModel/ProgressChangedEventHandler.cs index dff26549532..6c76de4259b 100644 --- a/mcs/class/System/System.ComponentModel/ProgressChangedEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/ProgressChangedEventHandler.cs @@ -26,11 +26,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public delegate void ProgressChangedEventHandler (object sender, ProgressChangedEventArgs e); } -#endif diff --git a/mcs/class/System/System.ComponentModel/PropertyChangedEventHandler.cs b/mcs/class/System/System.ComponentModel/PropertyChangedEventHandler.cs index c0582b12529..c42047e9467 100644 --- a/mcs/class/System/System.ComponentModel/PropertyChangedEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/PropertyChangedEventHandler.cs @@ -30,9 +30,6 @@ using System; namespace System.ComponentModel { -#if !NET_2_0 - [Serializable] -#endif public delegate void PropertyChangedEventHandler( object sender, PropertyChangedEventArgs e ); } diff --git a/mcs/class/System/System.ComponentModel/PropertyChangingEventArgs.cs b/mcs/class/System/System.ComponentModel/PropertyChangingEventArgs.cs index 5aaf397b21f..ea25900c022 100644 --- a/mcs/class/System/System.ComponentModel/PropertyChangingEventArgs.cs +++ b/mcs/class/System/System.ComponentModel/PropertyChangingEventArgs.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 // SP1 - namespace System.ComponentModel { public class PropertyChangingEventArgs : EventArgs @@ -47,4 +45,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/PropertyChangingEventHandler.cs b/mcs/class/System/System.ComponentModel/PropertyChangingEventHandler.cs index 50d15b0a732..7f9b8f1f878 100644 --- a/mcs/class/System/System.ComponentModel/PropertyChangingEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/PropertyChangingEventHandler.cs @@ -26,13 +26,9 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 // SP1 - using System; namespace System.ComponentModel { public delegate void PropertyChangingEventHandler (object sender, PropertyChangingEventArgs e); } - -#endif diff --git a/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs b/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs index 74940e0787d..9a24e161b9a 100644 --- a/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs +++ b/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs @@ -97,11 +97,9 @@ namespace System.ComponentModel public abstract Type PropertyType { get; } -#if NET_2_0 public virtual bool SupportsChangeEvents { get { return false; } } -#endif public DesignerSerializationVisibility SerializationVisibility { get { @@ -165,7 +163,6 @@ namespace System.ComponentModel notifiers [component] = component_notifiers; } -#if NET_2_0 protected override void FillAttributes (IList attributeList) { base.FillAttributes (attributeList); @@ -193,7 +190,6 @@ namespace System.ComponentModel return (EventHandler) notifiers [component]; } -#endif protected virtual void OnValueChanged (object component, EventArgs e) { @@ -228,17 +224,9 @@ namespace System.ComponentModel ConstructorInfo ctor = type.GetConstructor (paramTypes); if (ctor != null) { object[] parameters = new object[] { PropertyType }; -#if NET_2_0 instance = TypeDescriptor.CreateInstance (null, type, paramTypes, parameters); -#else - instance = ctor.Invoke (parameters); -#endif } else { -#if NET_2_0 instance = TypeDescriptor.CreateInstance (null, type, null, null); -#else - instance = Activator.CreateInstance (type); -#endif } return instance; } diff --git a/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs index 07d3b71c996..b7fa48ad0ad 100644 --- a/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs +++ b/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs @@ -52,12 +52,7 @@ namespace System.ComponentModel this.properties.AddRange (properties); } -#if NET_2_0 - public -#else - internal -#endif - PropertyDescriptorCollection (PropertyDescriptor[] properties, bool readOnly) : this (properties) + public PropertyDescriptorCollection (PropertyDescriptor[] properties, bool readOnly) : this (properties) { this.readOnly = readOnly; } @@ -144,7 +139,6 @@ namespace System.ComponentModel for (int i = 0; i < properties.Count; ++i) { PropertyDescriptor p = (PropertyDescriptor)properties [i]; -#if NET_2_0 if (ignoreCase) { if (0 == String.Compare (name, p.Name, StringComparison.OrdinalIgnoreCase)) return p; @@ -153,17 +147,6 @@ namespace System.ComponentModel if (0 == String.Compare (name, p.Name, StringComparison.Ordinal)) return p; } -#else - if (ignoreCase) { - if (0 == String.CompareOrdinal (name.ToLower (System.Globalization.CultureInfo.InvariantCulture), - p.Name.ToLower (System.Globalization.CultureInfo.InvariantCulture))) - return p; - } - else { - if (0 == String.CompareOrdinal (name, p.Name)) - return p; - } -#endif } return null; } @@ -351,11 +334,7 @@ namespace System.ComponentModel { get { -#if NET_2_0 return readOnly; -#else - return !readOnly; -#endif } } #if TARGET_JVM //DUAL_IFACE_CONFLICT diff --git a/mcs/class/System/System.ComponentModel/RecommendedAsConfigurableAttribute.cs b/mcs/class/System/System.ComponentModel/RecommendedAsConfigurableAttribute.cs index bab33341dec..5ab1737f095 100644 --- a/mcs/class/System/System.ComponentModel/RecommendedAsConfigurableAttribute.cs +++ b/mcs/class/System/System.ComponentModel/RecommendedAsConfigurableAttribute.cs @@ -35,9 +35,7 @@ using System; namespace System.ComponentModel { [AttributeUsage (AttributeTargets.Property)] -#if NET_2_0 [Obsolete ("Use SettingsBindableAttribute instead of RecommendedAsConfigurableAttribute")] -#endif public class RecommendedAsConfigurableAttribute : Attribute { #region Fields diff --git a/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs b/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs index 1b46293da62..e1995311370 100644 --- a/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs +++ b/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs @@ -331,10 +331,9 @@ namespace System.ComponentModel return !attrib.Value.Equals (current); } else { -#if NET_2_0 if (!_member.CanWrite) return false; -#endif + MethodInfo mi = FindPropertyMethod (component, "ShouldPersist"); if (mi != null) return (bool) mi.Invoke (component, null); diff --git a/mcs/class/System/System.ComponentModel/RefreshProperties.cs b/mcs/class/System/System.ComponentModel/RefreshProperties.cs index a16860284dd..91076e60761 100644 --- a/mcs/class/System/System.ComponentModel/RefreshProperties.cs +++ b/mcs/class/System/System.ComponentModel/RefreshProperties.cs @@ -30,9 +30,6 @@ namespace System.ComponentModel { -#if !NET_2_0 - [Serializable] -#endif public enum RefreshProperties { All = 1, None = 0, diff --git a/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventArgs.cs b/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventArgs.cs index 1a7813c284f..8fd10357f16 100644 --- a/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventArgs.cs +++ b/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventArgs.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public class RunWorkerCompletedEventArgs : AsyncCompletedEventArgs @@ -63,4 +61,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventHandler.cs b/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventHandler.cs index 42ad92e00c4..fe15cb89d43 100644 --- a/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventHandler.cs +++ b/mcs/class/System/System.ComponentModel/RunWorkerCompletedEventHandler.cs @@ -26,12 +26,9 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { public delegate void RunWorkerCompletedEventHandler ( object sender, RunWorkerCompletedEventArgs e); } -#endif diff --git a/mcs/class/System/System.ComponentModel/SettingsBindableAttribute.cs b/mcs/class/System/System.ComponentModel/SettingsBindableAttribute.cs index 6c693a96de0..9833d7d277d 100644 --- a/mcs/class/System/System.ComponentModel/SettingsBindableAttribute.cs +++ b/mcs/class/System/System.ComponentModel/SettingsBindableAttribute.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { [AttributeUsage (AttributeTargets.Property, AllowMultiple = false, Inherited = true)] @@ -62,5 +60,3 @@ namespace System.ComponentModel } } } - -#endif diff --git a/mcs/class/System/System.ComponentModel/SyntaxCheck.cs b/mcs/class/System/System.ComponentModel/SyntaxCheck.cs index 8330f1e402f..d6a1d445a52 100644 --- a/mcs/class/System/System.ComponentModel/SyntaxCheck.cs +++ b/mcs/class/System/System.ComponentModel/SyntaxCheck.cs @@ -32,17 +32,8 @@ using System.IO; namespace System.ComponentModel { -#if NET_2_0 - static -#endif - public class SyntaxCheck + static public class SyntaxCheck { -#if !NET_2_0 - private SyntaxCheck () - { - } -#endif - public static bool CheckMachineName (string value) { if (value == null || value.Trim ().Length == 0) diff --git a/mcs/class/System/System.ComponentModel/ToolboxItemFilterAttribute.cs b/mcs/class/System/System.ComponentModel/ToolboxItemFilterAttribute.cs index d533197e078..122e3ac61ac 100644 --- a/mcs/class/System/System.ComponentModel/ToolboxItemFilterAttribute.cs +++ b/mcs/class/System/System.ComponentModel/ToolboxItemFilterAttribute.cs @@ -85,11 +85,9 @@ namespace System.ComponentModel return ((ToolboxItemFilterAttribute) obj).FilterString == Filter; } -#if NET_2_0 public override string ToString () { return String.Format ("{0},{1}", Filter, ItemFilterType); } -#endif } } diff --git a/mcs/class/System/System.ComponentModel/ToolboxItemFilterType.cs b/mcs/class/System/System.ComponentModel/ToolboxItemFilterType.cs index cee008144d6..c2db110f112 100644 --- a/mcs/class/System/System.ComponentModel/ToolboxItemFilterType.cs +++ b/mcs/class/System/System.ComponentModel/ToolboxItemFilterType.cs @@ -30,9 +30,6 @@ namespace System.ComponentModel { -#if !NET_2_0 - [Serializable] -#endif public enum ToolboxItemFilterType { Allow, diff --git a/mcs/class/System/System.ComponentModel/TypeDescriptionProviderAttribute.cs b/mcs/class/System/System.ComponentModel/TypeDescriptionProviderAttribute.cs index ed3d21e2900..61c16cb1b9f 100644 --- a/mcs/class/System/System.ComponentModel/TypeDescriptionProviderAttribute.cs +++ b/mcs/class/System/System.ComponentModel/TypeDescriptionProviderAttribute.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.ComponentModel { [AttributeUsage(AttributeTargets.Class, Inherited=true)] @@ -59,4 +57,3 @@ namespace System.ComponentModel } } -#endif diff --git a/mcs/class/System/System.ComponentModel/TypeDescriptor.cs b/mcs/class/System/System.ComponentModel/TypeDescriptor.cs index 15bab7b4868..9ebeeddd36d 100644 --- a/mcs/class/System/System.ComponentModel/TypeDescriptor.cs +++ b/mcs/class/System/System.ComponentModel/TypeDescriptor.cs @@ -1281,19 +1281,6 @@ public sealed class TypeDescriptor else { EventDescriptorCollection events = GetEvents (); _defaultEvent = events [attr.Name]; -#if !NET_2_0 - // In our test case (TypeDescriptorTest.TestGetDefaultEvent), we have - // a scenario where a custom filter adds the DefaultEventAttribute, - // but its FilterEvents method removes the event the - // DefaultEventAttribute applied to. .NET 1.x accepts this and returns - // the *other* event defined in the class. - // - // Consequently, we know we have a DefaultEvent, but we need to check - // and ensure that the requested event is unfiltered. If it is, just - // grab the first element in the collection. - if (_defaultEvent == null && events.Count > 0) - _defaultEvent = events [0]; -#endif } _gotDefaultEvent = true; return _defaultEvent; diff --git a/mcs/class/System/System.ComponentModel/WarningException.cs b/mcs/class/System/System.ComponentModel/WarningException.cs index 22e20fc5b03..e524884d84e 100644 --- a/mcs/class/System/System.ComponentModel/WarningException.cs +++ b/mcs/class/System/System.ComponentModel/WarningException.cs @@ -32,9 +32,7 @@ using System.Security.Permissions; namespace System.ComponentModel { -#if NET_2_0 [Serializable] -#endif public class WarningException : SystemException { private string helpUrl; @@ -58,7 +56,6 @@ namespace System.ComponentModel { this.helpTopic = helpTopic; } -#if NET_2_0 public WarningException () : base (Locale.GetText ("Warning")) { @@ -93,7 +90,6 @@ namespace System.ComponentModel { info.AddValue ("helpTopic", helpTopic); info.AddValue ("helpUrl", helpUrl); } -#endif public string HelpTopic { get { diff --git a/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs b/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs index 8bf426906f8..bef424ccde7 100644 --- a/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs +++ b/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.Collections.Generic; @@ -48,4 +47,3 @@ namespace System.ComponentModel } } } -#endif \ No newline at end of file diff --git a/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs b/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs index 830ced2a920..0d5f8732c21 100644 --- a/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs +++ b/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.Collections.Generic; @@ -64,4 +63,3 @@ namespace System.ComponentModel } } } -#endif diff --git a/mcs/class/System/System.ComponentModel/Win32Exception.cs b/mcs/class/System/System.ComponentModel/Win32Exception.cs index fb1cff377b9..10f0fedaa87 100644 --- a/mcs/class/System/System.ComponentModel/Win32Exception.cs +++ b/mcs/class/System/System.ComponentModel/Win32Exception.cs @@ -65,7 +65,6 @@ namespace System.ComponentModel { native_error_code = error; } -#if NET_2_0 [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)] #if TARGET_JVM [MonoNotSupported ("")] @@ -85,7 +84,7 @@ namespace System.ComponentModel { native_error_code = Marshal.GetLastWin32Error (); } -#endif + protected Win32Exception(SerializationInfo info, StreamingContext context) : base (info, context) { diff --git a/mcs/class/System/System.Configuration/ApplicationScopedSettingAttribute.cs b/mcs/class/System/System.Configuration/ApplicationScopedSettingAttribute.cs index 5bc9efae37b..17475fe91f1 100644 --- a/mcs/class/System/System.Configuration/ApplicationScopedSettingAttribute.cs +++ b/mcs/class/System/System.Configuration/ApplicationScopedSettingAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -38,4 +37,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs b/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs index 6061a55cb42..79b3308feb6 100644 --- a/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs +++ b/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs @@ -20,7 +20,6 @@ // Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 #if CONFIGURATION_DEP && !TARGET_JVM extern alias PrebuiltSystem; using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection; @@ -440,5 +439,4 @@ namespace System.Configuration { } } -#endif diff --git a/mcs/class/System/System.Configuration/ApplicationSettingsGroup.cs b/mcs/class/System/System.Configuration/ApplicationSettingsGroup.cs index b8a9fb9efe5..b00a7e39142 100644 --- a/mcs/class/System/System.Configuration/ApplicationSettingsGroup.cs +++ b/mcs/class/System/System.Configuration/ApplicationSettingsGroup.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Configuration/ClientSettingsSection.cs b/mcs/class/System/System.Configuration/ClientSettingsSection.cs index c85026d4af8..5f986bfaa1b 100644 --- a/mcs/class/System/System.Configuration/ClientSettingsSection.cs +++ b/mcs/class/System/System.Configuration/ClientSettingsSection.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Configuration/ConfigXmlDocument.cs b/mcs/class/System/System.Configuration/ConfigXmlDocument.cs index db6f6c76312..1ab98591990 100644 --- a/mcs/class/System/System.Configuration/ConfigXmlDocument.cs +++ b/mcs/class/System/System.Configuration/ConfigXmlDocument.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration.Internal; #endif using System.IO; @@ -41,7 +41,7 @@ namespace System.Configuration { [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)] public sealed class ConfigXmlDocument : XmlDocument, IConfigXmlNode -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP , IConfigErrorInfo #endif { @@ -124,7 +124,7 @@ namespace System.Configuration } } -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP string System.Configuration.Internal.IConfigErrorInfo.Filename { get { return Filename; } } @@ -146,7 +146,7 @@ namespace System.Configuration // Wrappers for Xml* that just provide file name and line number addition // class ConfigXmlAttribute : XmlAttribute, IConfigXmlNode -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP , IConfigErrorInfo #endif { @@ -182,7 +182,7 @@ namespace System.Configuration } class ConfigXmlCDataSection : XmlCDataSection, IConfigXmlNode -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP , IConfigErrorInfo #endif { @@ -245,7 +245,7 @@ namespace System.Configuration } class ConfigXmlElement : XmlElement, IConfigXmlNode -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP , IConfigErrorInfo #endif { @@ -281,7 +281,7 @@ namespace System.Configuration } class ConfigXmlText : XmlText, IConfigXmlNode -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP , IConfigErrorInfo #endif { diff --git a/mcs/class/System/System.Configuration/ConfigurationException.cs b/mcs/class/System/System.Configuration/ConfigurationException.cs index b995d8d5c64..6f36e97bc08 100644 --- a/mcs/class/System/System.Configuration/ConfigurationException.cs +++ b/mcs/class/System/System.Configuration/ConfigurationException.cs @@ -48,18 +48,14 @@ namespace System.Configuration // // Constructors // -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException () : this (null) { filename = null; line = 0; } -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException (string message) : base (message) { @@ -72,18 +68,14 @@ namespace System.Configuration line = info.GetInt32 ("line"); } -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException (string message, Exception inner) : base (message, inner) { } #if (XML_DEP) -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException (string message, XmlNode node) : base (message) { @@ -91,9 +83,7 @@ namespace System.Configuration line = GetXmlNodeLineNumber(node); } -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException (string message, Exception inner, XmlNode node) : base (message, inner) { @@ -101,9 +91,7 @@ namespace System.Configuration line = GetXmlNodeLineNumber (node); } #endif -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException (string message, string filename, int line) : base (message) { @@ -111,9 +99,7 @@ namespace System.Configuration this.line= line; } -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public ConfigurationException (string message, Exception inner, string filename, int line) : base (message, inner) { @@ -123,27 +109,15 @@ namespace System.Configuration // // Properties // - public -#if NET_2_0 - virtual -#endif - string BareMessage { + public virtual string BareMessage { get { return base.Message; } } - public -#if NET_2_0 - virtual -#endif - string Filename { + public virtual string Filename { get { return filename; } } - public -#if NET_2_0 - virtual -#endif - int Line { + public virtual int Line { get { return line; } } @@ -169,9 +143,7 @@ namespace System.Configuration // Methods // #if (XML_DEP) -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public static string GetXmlNodeFilename (XmlNode node) { if (!(node is IConfigXmlNode)) @@ -180,9 +152,7 @@ namespace System.Configuration return ((IConfigXmlNode) node).Filename; } -#if NET_2_0 [Obsolete ("This class is obsolete. Use System.Configuration.ConfigurationErrorsException")] -#endif public static int GetXmlNodeLineNumber (XmlNode node) { if (!(node is IConfigXmlNode)) diff --git a/mcs/class/System/System.Configuration/ConfigurationSettings.cs b/mcs/class/System/System.Configuration/ConfigurationSettings.cs index 551a263b731..84995699644 100644 --- a/mcs/class/System/System.Configuration/ConfigurationSettings.cs +++ b/mcs/class/System/System.Configuration/ConfigurationSettings.cs @@ -78,25 +78,21 @@ namespace System.Configuration { } -#if NET_2_0 [Obsolete ("This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection")] -#endif public static object GetConfig (string sectionName) { -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP return ConfigurationManager.GetSection (sectionName); #else return config.GetConfig (sectionName); #endif } -#if NET_2_0 [Obsolete ("This property is obsolete. Please use System.Configuration.ConfigurationManager.AppSettings")] -#endif public static NameValueCollection AppSettings { get { -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP object appSettings = ConfigurationManager.GetSection ("appSettings"); #else object appSettings = GetConfig ("appSettings"); @@ -155,9 +151,7 @@ namespace System.Configuration return instance; } -#if NET_2_0 [Obsolete ("This method is obsolete. Please use System.Configuration.ConfigurationManager.GetConfig")] -#endif public object GetConfig (string sectionName) { Init (); @@ -662,9 +656,7 @@ namespace System.Configuration value = reader.Value; } else -#if NET_2_0 if (reader.Name != "type") -#endif ThrowException ("Unrecognized attribute.", reader); } while (reader.MoveToNextAttribute ()); diff --git a/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs b/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs index ddf742a1c16..7d70eefabbc 100644 --- a/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs +++ b/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP #if !TARGET_JVM extern alias PrebuiltSystem; @@ -80,7 +80,9 @@ namespace System.Configuration // MachineConfigFilename will be used to set the ExeConfigFilename. // // This is necessary to fix bug #491531 +#pragma warning disable 649 private static Type webConfigurationFileMapType; +#pragma warning restore 649 private static string userRoamingPath = ""; private static string userLocalPath = ""; diff --git a/mcs/class/System/System.Configuration/DefaultSettingValueAttribute.cs b/mcs/class/System/System.Configuration/DefaultSettingValueAttribute.cs index d57876f1302..cf97777028e 100644 --- a/mcs/class/System/System.Configuration/DefaultSettingValueAttribute.cs +++ b/mcs/class/System/System.Configuration/DefaultSettingValueAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -50,5 +49,3 @@ namespace System.Configuration } } - -#endif diff --git a/mcs/class/System/System.Configuration/IApplicationSettingsProvider.cs b/mcs/class/System/System.Configuration/IApplicationSettingsProvider.cs index 0e3e1805aab..55901b191f5 100644 --- a/mcs/class/System/System.Configuration/IApplicationSettingsProvider.cs +++ b/mcs/class/System/System.Configuration/IApplicationSettingsProvider.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -45,5 +44,3 @@ namespace System.Configuration } } - -#endif diff --git a/mcs/class/System/System.Configuration/IConfigurationSystem.cs b/mcs/class/System/System.Configuration/IConfigurationSystem.cs index 9bc4aee4de0..d0d93491264 100644 --- a/mcs/class/System/System.Configuration/IConfigurationSystem.cs +++ b/mcs/class/System/System.Configuration/IConfigurationSystem.cs @@ -32,9 +32,7 @@ using System.Runtime.InteropServices; namespace System.Configuration { -#if NET_2_0 [ComVisible (false)] -#endif public interface IConfigurationSystem { object GetConfig (string configKey); diff --git a/mcs/class/System/System.Configuration/IPersistComponentSettings.cs b/mcs/class/System/System.Configuration/IPersistComponentSettings.cs index 117bb02e451..0e07bf0a598 100644 --- a/mcs/class/System/System.Configuration/IPersistComponentSettings.cs +++ b/mcs/class/System/System.Configuration/IPersistComponentSettings.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Configuration { public interface IPersistComponentSettings @@ -42,5 +40,3 @@ namespace System.Configuration void SaveComponentSettings (); } } - -#endif diff --git a/mcs/class/System/System.Configuration/ISettingsProviderService.cs b/mcs/class/System/System.Configuration/ISettingsProviderService.cs index 92ef1dd6fbc..19b367a9fa4 100644 --- a/mcs/class/System/System.Configuration/ISettingsProviderService.cs +++ b/mcs/class/System/System.Configuration/ISettingsProviderService.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -37,5 +36,3 @@ namespace System.Configuration } } - -#endif diff --git a/mcs/class/System/System.Configuration/IdnElement.cs b/mcs/class/System/System.Configuration/IdnElement.cs index eaef8fb9e5f..84287ebf822 100644 --- a/mcs/class/System/System.Configuration/IdnElement.cs +++ b/mcs/class/System/System.Configuration/IdnElement.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; namespace System.Configuration diff --git a/mcs/class/System/System.Configuration/IriParsingElement.cs b/mcs/class/System/System.Configuration/IriParsingElement.cs index 38dddbf523c..da5d8e0b380 100644 --- a/mcs/class/System/System.Configuration/IriParsingElement.cs +++ b/mcs/class/System/System.Configuration/IriParsingElement.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; namespace System.Configuration diff --git a/mcs/class/System/System.Configuration/LocalFileSettingsProvider.cs b/mcs/class/System/System.Configuration/LocalFileSettingsProvider.cs index 51b792f375a..14358d1f262 100644 --- a/mcs/class/System/System.Configuration/LocalFileSettingsProvider.cs +++ b/mcs/class/System/System.Configuration/LocalFileSettingsProvider.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP #if CONFIGURATION_DEP && !TARGET_JVM extern alias PrebuiltSystem; using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection; diff --git a/mcs/class/System/System.Configuration/NoSettingsVersionUpgradeAttribute.cs b/mcs/class/System/System.Configuration/NoSettingsVersionUpgradeAttribute.cs index 5850cf23df3..5205a173cb8 100644 --- a/mcs/class/System/System.Configuration/NoSettingsVersionUpgradeAttribute.cs +++ b/mcs/class/System/System.Configuration/NoSettingsVersionUpgradeAttribute.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -39,5 +38,3 @@ namespace System.Configuration } } } - -#endif diff --git a/mcs/class/System/System.Configuration/SettingAttribute.cs b/mcs/class/System/System.Configuration/SettingAttribute.cs index 1c2b2a37369..cec694af68a 100644 --- a/mcs/class/System/System.Configuration/SettingAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -38,4 +37,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingChangingEventArgs.cs b/mcs/class/System/System.Configuration/SettingChangingEventArgs.cs index a0977d26d94..8fca4090921 100644 --- a/mcs/class/System/System.Configuration/SettingChangingEventArgs.cs +++ b/mcs/class/System/System.Configuration/SettingChangingEventArgs.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.ComponentModel; @@ -79,4 +78,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingChangingEventHandler.cs b/mcs/class/System/System.Configuration/SettingChangingEventHandler.cs index eac24821f8a..b9b206b22de 100644 --- a/mcs/class/System/System.Configuration/SettingChangingEventHandler.cs +++ b/mcs/class/System/System.Configuration/SettingChangingEventHandler.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.ComponentModel; @@ -35,4 +34,3 @@ namespace System.Configuration public delegate void SettingChangingEventHandler (object sender, SettingChangingEventArgs e); } -#endif diff --git a/mcs/class/System/System.Configuration/SettingElement.cs b/mcs/class/System/System.Configuration/SettingElement.cs index f8914f95e58..2a711689493 100644 --- a/mcs/class/System/System.Configuration/SettingElement.cs +++ b/mcs/class/System/System.Configuration/SettingElement.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -117,4 +116,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingElementCollection.cs b/mcs/class/System/System.Configuration/SettingElementCollection.cs index 91785330114..c6789e9183d 100644 --- a/mcs/class/System/System.Configuration/SettingElementCollection.cs +++ b/mcs/class/System/System.Configuration/SettingElementCollection.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; namespace System.Configuration diff --git a/mcs/class/System/System.Configuration/SettingValueElement.cs b/mcs/class/System/System.Configuration/SettingValueElement.cs index 93f05a5466d..f6c5b54e93f 100644 --- a/mcs/class/System/System.Configuration/SettingValueElement.cs +++ b/mcs/class/System/System.Configuration/SettingValueElement.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; #if (XML_DEP) using System.Xml; @@ -119,4 +118,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsAttributeDictionary.cs b/mcs/class/System/System.Configuration/SettingsAttributeDictionary.cs index a9cbd2d850d..1088d66403d 100644 --- a/mcs/class/System/System.Configuration/SettingsAttributeDictionary.cs +++ b/mcs/class/System/System.Configuration/SettingsAttributeDictionary.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; @@ -47,4 +46,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsBase.cs b/mcs/class/System/System.Configuration/SettingsBase.cs index 75200fbae88..05a802a36ae 100644 --- a/mcs/class/System/System.Configuration/SettingsBase.cs +++ b/mcs/class/System/System.Configuration/SettingsBase.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.ComponentModel; @@ -182,4 +181,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsContext.cs b/mcs/class/System/System.Configuration/SettingsContext.cs index c28c14d9471..5cc36bc23fe 100644 --- a/mcs/class/System/System.Configuration/SettingsContext.cs +++ b/mcs/class/System/System.Configuration/SettingsContext.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; @@ -47,4 +46,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsDescriptionAttribute.cs b/mcs/class/System/System.Configuration/SettingsDescriptionAttribute.cs index c751b4135d9..8983fffaef3 100644 --- a/mcs/class/System/System.Configuration/SettingsDescriptionAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingsDescriptionAttribute.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -46,5 +45,3 @@ namespace System.Configuration } } } - -#endif diff --git a/mcs/class/System/System.Configuration/SettingsGroupDescriptionAttribute.cs b/mcs/class/System/System.Configuration/SettingsGroupDescriptionAttribute.cs index 451c6eb134f..ed90c1018a9 100644 --- a/mcs/class/System/System.Configuration/SettingsGroupDescriptionAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingsGroupDescriptionAttribute.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -47,4 +46,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsGroupNameAttribute.cs b/mcs/class/System/System.Configuration/SettingsGroupNameAttribute.cs index 832a4b8030c..4d16a2fa896 100644 --- a/mcs/class/System/System.Configuration/SettingsGroupNameAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingsGroupNameAttribute.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -47,4 +46,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsLoadedEventArgs.cs b/mcs/class/System/System.Configuration/SettingsLoadedEventArgs.cs index ef9f56c7642..32a51c56df2 100644 --- a/mcs/class/System/System.Configuration/SettingsLoadedEventArgs.cs +++ b/mcs/class/System/System.Configuration/SettingsLoadedEventArgs.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -49,4 +48,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsLoadedEventHandler.cs b/mcs/class/System/System.Configuration/SettingsLoadedEventHandler.cs index d644774c78b..3a6130672da 100644 --- a/mcs/class/System/System.Configuration/SettingsLoadedEventHandler.cs +++ b/mcs/class/System/System.Configuration/SettingsLoadedEventHandler.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -34,4 +33,3 @@ namespace System.Configuration public delegate void SettingsLoadedEventHandler (object sender, SettingsLoadedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsManageability.cs b/mcs/class/System/System.Configuration/SettingsManageability.cs index 975533d755a..b0a9c0b058c 100644 --- a/mcs/class/System/System.Configuration/SettingsManageability.cs +++ b/mcs/class/System/System.Configuration/SettingsManageability.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -37,4 +36,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsManageabilityAttribute.cs b/mcs/class/System/System.Configuration/SettingsManageabilityAttribute.cs index fd40e4c19b2..111a80cfef0 100644 --- a/mcs/class/System/System.Configuration/SettingsManageabilityAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingsManageabilityAttribute.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -48,4 +47,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsProperty.cs b/mcs/class/System/System.Configuration/SettingsProperty.cs index 31c444072a8..12617e8ab55 100644 --- a/mcs/class/System/System.Configuration/SettingsProperty.cs +++ b/mcs/class/System/System.Configuration/SettingsProperty.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -171,4 +170,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsPropertyCollection.cs b/mcs/class/System/System.Configuration/SettingsPropertyCollection.cs index 1e894f5bff4..d203b089549 100644 --- a/mcs/class/System/System.Configuration/SettingsPropertyCollection.cs +++ b/mcs/class/System/System.Configuration/SettingsPropertyCollection.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; @@ -154,4 +153,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsPropertyIsReadOnlyException.cs b/mcs/class/System/System.Configuration/SettingsPropertyIsReadOnlyException.cs index 0a9496ebd2d..930a46a6844 100644 --- a/mcs/class/System/System.Configuration/SettingsPropertyIsReadOnlyException.cs +++ b/mcs/class/System/System.Configuration/SettingsPropertyIsReadOnlyException.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Runtime.Serialization; @@ -54,4 +53,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsPropertyNotFoundException.cs b/mcs/class/System/System.Configuration/SettingsPropertyNotFoundException.cs index 6cc1e63c307..8fcd0eb0601 100644 --- a/mcs/class/System/System.Configuration/SettingsPropertyNotFoundException.cs +++ b/mcs/class/System/System.Configuration/SettingsPropertyNotFoundException.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Runtime.Serialization; @@ -54,4 +53,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsPropertyValue.cs b/mcs/class/System/System.Configuration/SettingsPropertyValue.cs index 90e79734850..2d554cc7571 100644 --- a/mcs/class/System/System.Configuration/SettingsPropertyValue.cs +++ b/mcs/class/System/System.Configuration/SettingsPropertyValue.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Globalization; using System.IO; @@ -244,4 +243,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsPropertyValueCollection.cs b/mcs/class/System/System.Configuration/SettingsPropertyValueCollection.cs index 74c9259fd2c..169b72af740 100644 --- a/mcs/class/System/System.Configuration/SettingsPropertyValueCollection.cs +++ b/mcs/class/System/System.Configuration/SettingsPropertyValueCollection.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; @@ -125,4 +124,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsPropertyWrongTypeException.cs b/mcs/class/System/System.Configuration/SettingsPropertyWrongTypeException.cs index 33562ea173f..b72e1242c64 100644 --- a/mcs/class/System/System.Configuration/SettingsPropertyWrongTypeException.cs +++ b/mcs/class/System/System.Configuration/SettingsPropertyWrongTypeException.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Runtime.Serialization; @@ -54,4 +53,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsProvider.cs b/mcs/class/System/System.Configuration/SettingsProvider.cs index 28e32a98868..e73c686fce2 100644 --- a/mcs/class/System/System.Configuration/SettingsProvider.cs +++ b/mcs/class/System/System.Configuration/SettingsProvider.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; #if (CONFIGURATION_DEP) @@ -55,4 +54,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsProviderAttribute.cs b/mcs/class/System/System.Configuration/SettingsProviderAttribute.cs index 283d6f92369..1cec2cd25b7 100644 --- a/mcs/class/System/System.Configuration/SettingsProviderAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingsProviderAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -61,4 +60,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsProviderCollection.cs b/mcs/class/System/System.Configuration/SettingsProviderCollection.cs index ffde95cbd3b..8f5548d6580 100644 --- a/mcs/class/System/System.Configuration/SettingsProviderCollection.cs +++ b/mcs/class/System/System.Configuration/SettingsProviderCollection.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; #if (CONFIGURATION_DEP) @@ -63,4 +62,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsSavingEventHandler.cs b/mcs/class/System/System.Configuration/SettingsSavingEventHandler.cs index 87a7f4c4d5e..9f5fd053980 100644 --- a/mcs/class/System/System.Configuration/SettingsSavingEventHandler.cs +++ b/mcs/class/System/System.Configuration/SettingsSavingEventHandler.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.ComponentModel; @@ -35,4 +34,3 @@ namespace System.Configuration public delegate void SettingsSavingEventHandler (object sender, CancelEventArgs e); } -#endif diff --git a/mcs/class/System/System.Configuration/SettingsSerializeAs.cs b/mcs/class/System/System.Configuration/SettingsSerializeAs.cs index 2dc4944ee3a..cab60fa846b 100644 --- a/mcs/class/System/System.Configuration/SettingsSerializeAs.cs +++ b/mcs/class/System/System.Configuration/SettingsSerializeAs.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -39,5 +38,3 @@ namespace System.Configuration ProviderSpecific = 3 } } - -#endif diff --git a/mcs/class/System/System.Configuration/SettingsSerializeAsAttribute.cs b/mcs/class/System/System.Configuration/SettingsSerializeAsAttribute.cs index e7a32397f37..381c53db93c 100644 --- a/mcs/class/System/System.Configuration/SettingsSerializeAsAttribute.cs +++ b/mcs/class/System/System.Configuration/SettingsSerializeAsAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -51,4 +50,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/SpecialSetting.cs b/mcs/class/System/System.Configuration/SpecialSetting.cs index 654aebadac3..474894894af 100644 --- a/mcs/class/System/System.Configuration/SpecialSetting.cs +++ b/mcs/class/System/System.Configuration/SpecialSetting.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -38,4 +37,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/SpecialSettingAttribute.cs b/mcs/class/System/System.Configuration/SpecialSettingAttribute.cs index e15ad399a99..b47afa3cc43 100644 --- a/mcs/class/System/System.Configuration/SpecialSettingAttribute.cs +++ b/mcs/class/System/System.Configuration/SpecialSettingAttribute.cs @@ -26,7 +26,6 @@ // Copyright (C) 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 using System.Collections; namespace System.Configuration @@ -47,4 +46,3 @@ namespace System.Configuration } } -#endif diff --git a/mcs/class/System/System.Configuration/UriSection.cs b/mcs/class/System/System.Configuration/UriSection.cs index ab9ac841945..8cafd8bf6b3 100644 --- a/mcs/class/System/System.Configuration/UriSection.cs +++ b/mcs/class/System/System.Configuration/UriSection.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; @@ -79,5 +79,4 @@ namespace System.Configuration #endregion // Properties } } - #endif diff --git a/mcs/class/System/System.Configuration/UserScopedSettingAttribute.cs b/mcs/class/System/System.Configuration/UserScopedSettingAttribute.cs index 608e1b5b542..e0066cc86bb 100644 --- a/mcs/class/System/System.Configuration/UserScopedSettingAttribute.cs +++ b/mcs/class/System/System.Configuration/UserScopedSettingAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Configuration @@ -38,4 +37,3 @@ namespace System.Configuration } -#endif diff --git a/mcs/class/System/System.Configuration/UserSettingsGroup.cs b/mcs/class/System/System.Configuration/UserSettingsGroup.cs index bc9a3cf4e4c..369d6c8ab97 100644 --- a/mcs/class/System/System.Configuration/UserSettingsGroup.cs +++ b/mcs/class/System/System.Configuration/UserSettingsGroup.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Diagnostics/BooleanSwitch.cs b/mcs/class/System/System.Diagnostics/BooleanSwitch.cs index 30c7614775f..699d8ce41ab 100644 --- a/mcs/class/System/System.Diagnostics/BooleanSwitch.cs +++ b/mcs/class/System/System.Diagnostics/BooleanSwitch.cs @@ -36,9 +36,7 @@ namespace System.Diagnostics /// Provides a simple on/off switch that controls debugging /// and tracing output /// -#if NET_2_0 [SwitchLevel (typeof (bool))] -#endif public class BooleanSwitch : Switch { /// @@ -49,7 +47,6 @@ namespace System.Diagnostics { } -#if NET_2_0 /// /// Initializes a new instance /// @@ -57,7 +54,6 @@ namespace System.Diagnostics : base(displayName, description, defaultSwitchValue) { } -#endif /// /// Specifies whether the switch is enabled or disabled @@ -70,7 +66,6 @@ namespace System.Diagnostics } } -#if NET_2_0 protected override void OnValueChanged () { int i; @@ -79,7 +74,6 @@ namespace System.Diagnostics else Enabled = Convert.ToBoolean (Value); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/ConsoleTraceListener.cs b/mcs/class/System/System.Diagnostics/ConsoleTraceListener.cs index 3c523b27583..7233c13f451 100644 --- a/mcs/class/System/System.Diagnostics/ConsoleTraceListener.cs +++ b/mcs/class/System/System.Diagnostics/ConsoleTraceListener.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Diagnostics { @@ -39,4 +38,3 @@ namespace System.Diagnostics { } } -#endif diff --git a/mcs/class/System/System.Diagnostics/CorrelationManager.cs b/mcs/class/System/System.Diagnostics/CorrelationManager.cs index 5ba06e4ec8e..1b298cfe005 100644 --- a/mcs/class/System/System.Diagnostics/CorrelationManager.cs +++ b/mcs/class/System/System.Diagnostics/CorrelationManager.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; @@ -69,4 +67,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/CounterCreationDataCollection.cs b/mcs/class/System/System.Diagnostics/CounterCreationDataCollection.cs index f830e7bbc03..10a73ba08ee 100644 --- a/mcs/class/System/System.Diagnostics/CounterCreationDataCollection.cs +++ b/mcs/class/System/System.Diagnostics/CounterCreationDataCollection.cs @@ -100,11 +100,7 @@ namespace System.Diagnostics { InnerList.Insert (index, value); } -#if NET_2_0 protected override void OnValidate (object value) -#else - protected override void OnInsert (int index, object value) -#endif { if (!(value is CounterCreationData)) throw new NotSupportedException (Locale.GetText( diff --git a/mcs/class/System/System.Diagnostics/CounterSample.cs b/mcs/class/System/System.Diagnostics/CounterSample.cs index b357c17c8c2..64ecf29d541 100644 --- a/mcs/class/System/System.Diagnostics/CounterSample.cs +++ b/mcs/class/System/System.Diagnostics/CounterSample.cs @@ -125,7 +125,6 @@ namespace System.Diagnostics { return CounterSampleCalculator.ComputeCounterValue (counterSample, nextCounterSample); } -#if NET_2_0 public override bool Equals (object obj) { if (!(obj is CounterSample)) @@ -167,7 +166,6 @@ namespace System.Diagnostics { (counterTimeStamp ^ (int) counterType))))))); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/CounterSampleCalculator.cs b/mcs/class/System/System.Diagnostics/CounterSampleCalculator.cs index ca9a5f07be4..58861d1ba2b 100644 --- a/mcs/class/System/System.Diagnostics/CounterSampleCalculator.cs +++ b/mcs/class/System/System.Diagnostics/CounterSampleCalculator.cs @@ -34,15 +34,7 @@ using System; namespace System.Diagnostics { -#if NET_2_0 public static class CounterSampleCalculator { -#else - public sealed class CounterSampleCalculator { - - private CounterSampleCalculator () - { - } -#endif public static float ComputeCounterValue (CounterSample newSample) { diff --git a/mcs/class/System/System.Diagnostics/DataReceivedEventArgs.cs b/mcs/class/System/System.Diagnostics/DataReceivedEventArgs.cs index 33329eec650..29e0b882b85 100644 --- a/mcs/class/System/System.Diagnostics/DataReceivedEventArgs.cs +++ b/mcs/class/System/System.Diagnostics/DataReceivedEventArgs.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Diagnostics { public class DataReceivedEventArgs : EventArgs @@ -45,4 +43,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/DataReceivedEventHandler.cs b/mcs/class/System/System.Diagnostics/DataReceivedEventHandler.cs index c867ea44b9b..f9261a6a17a 100644 --- a/mcs/class/System/System.Diagnostics/DataReceivedEventHandler.cs +++ b/mcs/class/System/System.Diagnostics/DataReceivedEventHandler.cs @@ -26,12 +26,9 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Diagnostics { public delegate void DataReceivedEventHandler ( object sender, DataReceivedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Diagnostics/Debug.cs b/mcs/class/System/System.Diagnostics/Debug.cs index 9bb3a500e8e..d414d7169f8 100644 --- a/mcs/class/System/System.Diagnostics/Debug.cs +++ b/mcs/class/System/System.Diagnostics/Debug.cs @@ -231,7 +231,6 @@ namespace System.Diagnostics { TraceImpl.WriteLineIf (condition, message, category); } -#if NET_2_0 || MOBILE [Conditional("DEBUG")] public static void Print (string message) { @@ -243,7 +242,6 @@ namespace System.Diagnostics { { TraceImpl.WriteLine (String.Format (format, args)); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs b/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs index 42dce1ffe26..5d56d24b447 100644 --- a/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs +++ b/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs @@ -43,10 +43,6 @@ using System.Runtime.InteropServices; using System.Threading; namespace System.Diagnostics { -#if NET_2_0 -#else - [ComVisible(false)] -#endif public class DefaultTraceListener : TraceListener { private static readonly bool OnWin32; diff --git a/mcs/class/System/System.Diagnostics/DelimitedListTraceListener.cs b/mcs/class/System/System.Diagnostics/DelimitedListTraceListener.cs index e37be03dcf9..55914c09ae6 100644 --- a/mcs/class/System/System.Diagnostics/DelimitedListTraceListener.cs +++ b/mcs/class/System/System.Diagnostics/DelimitedListTraceListener.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.IO; @@ -155,4 +154,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs b/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs index 1db8b0957a7..49c2b04f6e1 100644 --- a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs +++ b/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs @@ -82,9 +82,7 @@ namespace System.Diagnostics } } #if (XML_DEP) -#if NET_2_0 [Obsolete ("This class is obsoleted")] -#endif public class DiagnosticsConfigurationHandler : IConfigurationSectionHandler { TraceImplSettings configValues; @@ -98,9 +96,7 @@ namespace System.Diagnostics elementHandlers ["assert"] = new ElementHandler (AddAssertNode); elementHandlers ["switches"] = new ElementHandler (AddSwitchesNode); elementHandlers ["trace"] = new ElementHandler (AddTraceNode); -#if NET_2_0 elementHandlers ["sources"] = new ElementHandler (AddSourcesNode); -#endif } public virtual object Create (object parent, object configContext, XmlNode section) @@ -116,7 +112,6 @@ namespace System.Diagnostics else d.Add (TraceImplSettings.Key, configValues = new TraceImplSettings ()); -#if NET_2_0 // process first foreach (XmlNode child in section.ChildNodes) { switch (child.NodeType) { @@ -127,7 +122,6 @@ namespace System.Diagnostics break; } } -#endif foreach (XmlNode child in section.ChildNodes) { XmlNodeType type = child.NodeType; @@ -138,10 +132,8 @@ namespace System.Diagnostics case XmlNodeType.Comment: continue; case XmlNodeType.Element: -#if NET_2_0 if (child.LocalName == "sharedListeners") continue; -#endif ElementHandler eh = (ElementHandler) elementHandlers [child.Name]; if (eh != null) eh (d, child); @@ -237,18 +229,7 @@ namespace System.Diagnostics private static object GetSwitchValue (string name, string value) { -#if NET_2_0 return value; -#else - try { - return int.Parse (value); - } catch { - throw new ConfigurationException (string.Format ( - "Error in trace switch '{0}': " + - "The value of a switch must be integral", - name)); - } -#endif } private void AddTraceNode (IDictionary d, XmlNode node) @@ -302,7 +283,6 @@ namespace System.Diagnostics } } -#if NET_2_0 private TraceListenerCollection GetSharedListeners (IDictionary d) { TraceListenerCollection shared_listeners = d ["sharedListeners"] as TraceListenerCollection; @@ -382,7 +362,6 @@ namespace System.Diagnostics ThrowUnrecognizedNode (child); } } -#endif // only defines "add" and "remove", but "clear" also works // for add, "name" is required; initializeData is optional; "type" is required in 1.x, optional in 2.0. @@ -427,7 +406,7 @@ namespace System.Diagnostics string name = GetAttribute (attributes, "name", true, child); string type = null; -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP type = GetAttribute (attributes, "type", false, child); if (type == null) { // indicated by name. @@ -473,7 +452,7 @@ namespace System.Diagnostics TraceListener l = (TraceListener) ctor.Invoke (args); l.Name = name; -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP string trace = GetAttribute (attributes, "traceOutputOptions", false, child); if (trace != null) { if (trace != trace.Trim ()) diff --git a/mcs/class/System/System.Diagnostics/EventInstance.cs b/mcs/class/System/System.Diagnostics/EventInstance.cs index 53feca436c2..b720d7bbfca 100644 --- a/mcs/class/System/System.Diagnostics/EventInstance.cs +++ b/mcs/class/System/System.Diagnostics/EventInstance.cs @@ -27,7 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.ComponentModel; namespace System.Diagnostics @@ -82,4 +81,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/EventLog.cs b/mcs/class/System/System.Diagnostics/EventLog.cs index 2c88565e580..cecf7de61f4 100644 --- a/mcs/class/System/System.Diagnostics/EventLog.cs +++ b/mcs/class/System/System.Diagnostics/EventLog.cs @@ -44,11 +44,7 @@ namespace System.Diagnostics { [DefaultEvent ("EntryWritten")] [InstallerType (typeof (EventLogInstaller))] -#if NET_2_0 [MonitoringDescription ("Represents an event log")] -#else - [Designer ("Microsoft.VisualStudio.Install.EventLogInstallableComponentDesigner, " + Consts.AssemblyMicrosoft_VisualStudio)] -#endif public class EventLog : Component, ISupportInitialize { private string source; @@ -85,15 +81,9 @@ namespace System.Diagnostics throw new ArgumentNullException ("logName"); } if (machineName == null || machineName.Trim ().Length == 0) -#if NET_2_0 throw new ArgumentException (string.Format ( CultureInfo.InvariantCulture, "Invalid value '{0}' for" + " parameter 'machineName'.", machineName)); -#else - throw new ArgumentException (string.Format ( - CultureInfo.InvariantCulture, "Invalid value {0} for" - + " parameter MachineName.", machineName)); -#endif this.source = source; this.machineName = machineName; @@ -194,7 +184,6 @@ namespace System.Diagnostics set {synchronizingObject = value;} } -#if NET_2_0 [MonoTODO] [ComVisibleAttribute (false)] [Browsable (false)] @@ -231,7 +220,6 @@ namespace System.Diagnostics { Impl.RegisterDisplayName (resourceFile, resourceId); } -#endif public void BeginInit () { @@ -272,9 +260,7 @@ namespace System.Diagnostics CreateEventSource (source, logName, "."); } -#if NET_2_0 [Obsolete ("use CreateEventSource(EventSourceCreationData) instead")] -#endif public static void CreateEventSource (string source, string logName, string machineName) @@ -283,13 +269,8 @@ namespace System.Diagnostics machineName)); } -#if NET_2_0 [MonoNotSupported ("remote machine is not supported")] - public -#else - private -#endif - static void CreateEventSource (EventSourceCreationData sourceData) + public static void CreateEventSource (EventSourceCreationData sourceData) { if (sourceData.Source == null || sourceData.Source.Length == 0) throw new ArgumentException ("Source property value has not been specified."); @@ -336,15 +317,9 @@ namespace System.Diagnostics public static void DeleteEventSource (string source, string machineName) { if (machineName == null || machineName.Trim ().Length == 0) -#if NET_2_0 throw new ArgumentException (string.Format ( CultureInfo.InvariantCulture, "Invalid value '{0}' for" + " parameter 'machineName'.", machineName)); -#else - throw new ArgumentException (string.Format ( - CultureInfo.InvariantCulture, "Invalid value {0} for" - + " parameter machineName.", machineName)); -#endif EventLogImpl impl = CreateEventLogImpl (string.Empty, machineName, source); @@ -397,15 +372,9 @@ namespace System.Diagnostics public static string LogNameFromSourceName (string source, string machineName) { if (machineName == null || machineName.Trim ().Length == 0) -#if NET_2_0 throw new ArgumentException (string.Format ( CultureInfo.InvariantCulture, "Invalid value '{0}' for" + " parameter 'MachineName'.", machineName)); -#else - throw new ArgumentException (string.Format ( - CultureInfo.InvariantCulture, "Invalid value {0} for" - + " parameter MachineName.", machineName)); -#endif EventLogImpl impl = CreateEventLogImpl (string.Empty, machineName, source); @@ -421,15 +390,9 @@ namespace System.Diagnostics public static bool SourceExists (string source, string machineName) { if (machineName == null || machineName.Trim ().Length == 0) -#if NET_2_0 throw new ArgumentException (string.Format ( CultureInfo.InvariantCulture, "Invalid value '{0}' for" + " parameter 'machineName'.", machineName)); -#else - throw new ArgumentException (string.Format ( - CultureInfo.InvariantCulture, "Invalid value {0} for" - + " parameter machineName.", machineName)); -#endif EventLogImpl impl = CreateEventLogImpl (string.Empty, machineName, source); @@ -500,7 +463,6 @@ namespace System.Diagnostics } } -#if NET_2_0 [ComVisible (false)] public void WriteEvent (EventInstance instance, params object [] values) { @@ -543,7 +505,6 @@ namespace System.Diagnostics eventLog.WriteEvent (instance, data, values); } } -#endif internal void OnEntryWritten (EventLogEntry newEntry) { @@ -627,9 +588,7 @@ namespace System.Diagnostics throw new InvalidEnumArgumentException ("type", (int) type, typeof (EventLogEntryType)); -#if NET_2_0 ValidateEventID (instanceID); -#endif if (!SourceExists (Source, MachineName)) { if (Log == null || Log.Length == 0) { @@ -637,13 +596,7 @@ namespace System.Diagnostics } CreateEventSource (Source, Log, MachineName); -#if ONLY_1_1 - ValidateEventID (instanceID); -#endif } else if (logName != null && logName.Length != 0) { -#if ONLY_1_1 - ValidateEventID (instanceID); -#endif string actualLog = LogNameFromSourceName (Source, MachineName); if (string.Compare (logName, actualLog, true, CultureInfo.InvariantCulture) != 0) throw new ArgumentException (string.Format ( @@ -655,9 +608,6 @@ namespace System.Diagnostics + " property.", Source, logName, actualLog)); } -#if ONLY_1_1 - ValidateEventID (instanceID); -#endif if (rawData == null) rawData = new byte [0]; diff --git a/mcs/class/System/System.Diagnostics/EventLogEntry.cs b/mcs/class/System/System.Diagnostics/EventLogEntry.cs index 5dd34c9f99a..8f922215cf1 100644 --- a/mcs/class/System/System.Diagnostics/EventLogEntry.cs +++ b/mcs/class/System/System.Diagnostics/EventLogEntry.cs @@ -31,9 +31,7 @@ // using System.ComponentModel; -#if NET_2_0 using System.Runtime.InteropServices; -#endif using System.Runtime.Serialization; using System.Security.Permissions; @@ -59,9 +57,7 @@ namespace System.Diagnostics private DateTime timeGenerated; private DateTime timeWritten; private string userName; -#if NET_2_0 private long instanceId; -#endif internal EventLogEntry (string category, short categoryNumber, int index, int eventID, string source, string message, string userName, @@ -82,9 +78,7 @@ namespace System.Diagnostics this.timeGenerated = timeGenerated; this.timeWritten = timeWritten; this.userName = userName; -#if NET_2_0 this.instanceId = instanceId; -#endif } [MonoTODO] @@ -112,9 +106,7 @@ namespace System.Diagnostics get { return entryType; } } -#if NET_2_0 [Obsolete ("Use InstanceId")] -#endif [MonitoringDescription ("An ID number for this event entry.")] public int EventID { get { return eventID; } @@ -125,13 +117,11 @@ namespace System.Diagnostics get { return index; } } -#if NET_2_0 [ComVisible (false)] [MonitoringDescription ("The instance ID for this event entry.")] public long InstanceId { get { return instanceId; } } -#endif [MonitoringDescription ("The Computer on which this event entry occured.")] public string MachineName { diff --git a/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs b/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs index 7c73d4264d7..c79752dffe7 100644 --- a/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs +++ b/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs @@ -90,13 +90,8 @@ namespace System.Diagnostics { public EventLogEntry Current { get { -#if NET_2_0 if (_currentEntry != null) return _currentEntry; -#else - if (_currentIndex >= 0 && _currentIndex < _impl.EntryCount) - return _impl [_currentIndex]; -#endif throw new InvalidOperationException ("No current EventLog" + " entry available, cursor is located before the first" @@ -107,16 +102,12 @@ namespace System.Diagnostics { public bool MoveNext () { _currentIndex++; -#if NET_2_0 if (_currentIndex >= _impl.EntryCount) { _currentEntry = null; return false; } _currentEntry = _impl [_currentIndex]; return true; -#else - return (_currentIndex < _impl.EntryCount); -#endif } public void Reset () @@ -126,9 +117,7 @@ namespace System.Diagnostics { readonly EventLogImpl _impl; int _currentIndex = -1; -#if NET_2_0 EventLogEntry _currentEntry; -#endif } } } diff --git a/mcs/class/System/System.Diagnostics/EventLogEntryType.cs b/mcs/class/System/System.Diagnostics/EventLogEntryType.cs index be4b7c9f44c..282b1471165 100644 --- a/mcs/class/System/System.Diagnostics/EventLogEntryType.cs +++ b/mcs/class/System/System.Diagnostics/EventLogEntryType.cs @@ -32,9 +32,6 @@ using System; using System.Diagnostics; namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif public enum EventLogEntryType { Error = 0x01, Warning = 0x02, diff --git a/mcs/class/System/System.Diagnostics/EventLogImpl.cs b/mcs/class/System/System.Diagnostics/EventLogImpl.cs index 936abe79471..5a4b3e77445 100644 --- a/mcs/class/System/System.Diagnostics/EventLogImpl.cs +++ b/mcs/class/System/System.Diagnostics/EventLogImpl.cs @@ -92,14 +92,12 @@ namespace System.Diagnostics public string LogDisplayName { get { -#if NET_2_0 // to-do perform valid character checks if (_coreEventLog.Log != null && _coreEventLog.Log.Length == 0) { throw new InvalidOperationException ("Event log names must" + " consist of printable characters and cannot contain" + " \\, *, ?, or spaces."); } -#endif if (_coreEventLog.Log != null) { if (_coreEventLog.Log.Length == 0) return string.Empty; @@ -230,7 +228,6 @@ namespace System.Diagnostics } } -#if NET_2_0 public abstract OverflowAction OverflowAction { get; } public abstract int MinimumRetentionDays { get; } @@ -240,6 +237,5 @@ namespace System.Diagnostics public abstract void ModifyOverflowPolicy (OverflowAction action, int retentionDays); public abstract void RegisterDisplayName (string resourceFile, long resourceId); -#endif } } diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs index 67c6a422c08..0fd2f227b75 100644 --- a/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs +++ b/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs @@ -31,12 +31,8 @@ namespace System.Diagnostics { [Flags] -#if !NET_2_0 - [Serializable] -#endif public enum EventLogPermissionAccess { None=0, -#if NET_2_0 [Obsolete ()] Browse=0x2, [Obsolete ()] @@ -45,11 +41,6 @@ namespace System.Diagnostics { Audit=0xA, Write = 16, Administer = 48, -#else - Browse=0x2, - Instrument=0x6, - Audit=0xA, -#endif } } diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs index e35c04109c9..b84a9287e59 100644 --- a/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs +++ b/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs @@ -50,11 +50,7 @@ namespace System.Diagnostics { : base (action) { machineName = ResourcePermissionBase.Local; -#if NET_2_0 permissionAccess = EventLogPermissionAccess.Write; -#else - permissionAccess = EventLogPermissionAccess.Browse; -#endif } public string MachineName { diff --git a/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs b/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs index e6ce4a3de18..d7eeb046977 100644 --- a/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs +++ b/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs @@ -84,12 +84,8 @@ namespace System.Diagnostics public override void Write (string message) { -#if NET_2_0 TraceData (new TraceEventCache (), event_log.Source, TraceEventType.Information, 0, message); -#else - event_log.WriteEntry (message); -#endif } public override void WriteLine (string message) @@ -97,7 +93,6 @@ namespace System.Diagnostics Write (message); } -#if NET_2_0 [ComVisible (false)] public override void TraceData (TraceEventCache eventCache, string source, TraceEventType eventType, @@ -149,7 +144,6 @@ namespace System.Diagnostics { TraceEvent (eventCache, source, eventType, id, format != null ? String.Format (format, args) : null); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/EventSourceCreationData.cs b/mcs/class/System/System.Diagnostics/EventSourceCreationData.cs index 477e75ae567..66c776d7989 100644 --- a/mcs/class/System/System.Diagnostics/EventSourceCreationData.cs +++ b/mcs/class/System/System.Diagnostics/EventSourceCreationData.cs @@ -29,12 +29,7 @@ namespace System.Diagnostics { -#if NET_2_0 - public -#else - internal -#endif - class EventSourceCreationData + public class EventSourceCreationData { string _source; string _logName; diff --git a/mcs/class/System/System.Diagnostics/EventTypeFilter.cs b/mcs/class/System/System.Diagnostics/EventTypeFilter.cs index 627c91a9b2d..a11630bbc7f 100644 --- a/mcs/class/System/System.Diagnostics/EventTypeFilter.cs +++ b/mcs/class/System/System.Diagnostics/EventTypeFilter.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.IO; using System.Collections; @@ -80,4 +78,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs index 8a292f9cf64..cf38a5e1125 100644 --- a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs +++ b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs @@ -73,7 +73,6 @@ namespace System.Diagnostics { private FileVersionInfo () { -#if NET_2_0 // no nulls (for unavailable items) comments = null; companyname = null; @@ -89,23 +88,7 @@ namespace System.Diagnostics { productname = null; productversion = null; specialbuild = null; -#else - // no nulls (for unavailable items) - comments = String.Empty; - companyname = String.Empty; - filedescription = String.Empty; - filename = String.Empty; - fileversion = String.Empty; - internalname = String.Empty; - language = String.Empty; - legalcopyright = String.Empty; - legaltrademarks = String.Empty; - originalfilename = String.Empty; - privatebuild = String.Empty; - productname = String.Empty; - productversion = String.Empty; - specialbuild = String.Empty; -#endif + // This is here just to shut the compiler up isdebug=false; ispatched=false; diff --git a/mcs/class/System/System.Diagnostics/ICollectData.cs b/mcs/class/System/System.Diagnostics/ICollectData.cs index c52f9871589..4e154e58c96 100644 --- a/mcs/class/System/System.Diagnostics/ICollectData.cs +++ b/mcs/class/System/System.Diagnostics/ICollectData.cs @@ -36,9 +36,7 @@ namespace System.Diagnostics { [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("73386977-D6FD-11D2-BED5-00C04F79E3AE")] -#if NET_2_0 [ComImport] -#endif public interface ICollectData { void CloseData (); [return: MarshalAs(UnmanagedType.I4)] diff --git a/mcs/class/System/System.Diagnostics/InstanceDataCollection.cs b/mcs/class/System/System.Diagnostics/InstanceDataCollection.cs index f50923f3819..6563a7cfe2c 100644 --- a/mcs/class/System/System.Diagnostics/InstanceDataCollection.cs +++ b/mcs/class/System/System.Diagnostics/InstanceDataCollection.cs @@ -45,9 +45,7 @@ namespace System.Diagnostics { } // may throw ArgumentNullException -#if NET_2_0 [Obsolete ("Use InstanceDataCollectionCollection indexer instead.")] -#endif public InstanceDataCollection (string counterName) { CheckNull (counterName, "counterName"); diff --git a/mcs/class/System/System.Diagnostics/InstanceDataCollectionCollection.cs b/mcs/class/System/System.Diagnostics/InstanceDataCollectionCollection.cs index 909fed6edc9..0466c66d0eb 100644 --- a/mcs/class/System/System.Diagnostics/InstanceDataCollectionCollection.cs +++ b/mcs/class/System/System.Diagnostics/InstanceDataCollectionCollection.cs @@ -43,9 +43,7 @@ namespace System.Diagnostics { } // may throw ArgumentNullException -#if NET_2_0 [Obsolete ("Use PerformanceCounterCategory.ReadCategory()")] -#endif public InstanceDataCollectionCollection () { } diff --git a/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs b/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs index 62563821fe6..e5a34ff1a41 100644 --- a/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs +++ b/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs @@ -299,11 +299,7 @@ namespace System.Diagnostics string logPath = Path.Combine (logDir, index.ToString (CultureInfo.InvariantCulture) + ".log"); try { using (TextWriter w = File.CreateText (logPath)) { -#if NET_2_0 w.WriteLine ("InstanceID: {0}", instanceID.ToString (CultureInfo.InvariantCulture)); -#else - w.WriteLine ("InstanceID: {0}", instanceID.ToString (CultureInfo.InvariantCulture)); -#endif w.WriteLine ("EntryType: {0}", (int) type); w.WriteLine ("Source: {0}", CoreEventLog.Source); w.WriteLine ("Category: {0}", category.ToString (CultureInfo.InvariantCulture)); @@ -432,7 +428,6 @@ namespace System.Diagnostics p.Close (); } -#if NET_2_0 public override OverflowAction OverflowAction { get { return OverflowAction.DoNotOverwrite; } } @@ -455,6 +450,5 @@ namespace System.Diagnostics { throw new NotSupportedException ("This EventLog implementation does not support registering display name"); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/NullEventLog.cs b/mcs/class/System/System.Diagnostics/NullEventLog.cs index bcb713be8e0..d49aac37133 100644 --- a/mcs/class/System/System.Diagnostics/NullEventLog.cs +++ b/mcs/class/System/System.Diagnostics/NullEventLog.cs @@ -127,7 +127,6 @@ namespace System.Diagnostics { } -#if NET_2_0 public override OverflowAction OverflowAction { get { return OverflowAction.DoNotOverwrite; } } @@ -150,6 +149,5 @@ namespace System.Diagnostics { throw new NotSupportedException ("This EventLog implementation does not support registering display name"); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/OverflowAction.cs b/mcs/class/System/System.Diagnostics/OverflowAction.cs index 5dbf89153ac..1d16dde8c52 100644 --- a/mcs/class/System/System.Diagnostics/OverflowAction.cs +++ b/mcs/class/System/System.Diagnostics/OverflowAction.cs @@ -27,7 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Diagnostics { public enum OverflowAction @@ -37,4 +36,3 @@ namespace System.Diagnostics OverwriteOlder = 1 } } -#endif diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounter.cs b/mcs/class/System/System.Diagnostics/PerformanceCounter.cs index d29edfc7d94..f76f0950f45 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounter.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounter.cs @@ -36,16 +36,11 @@ using System.ComponentModel.Design; using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; -#if NET_2_0 using System.Runtime.ConstrainedExecution; -#endif namespace System.Diagnostics { // must be safe for multithreaded operations -#if !NET_2_0 - [Designer ("Microsoft.VisualStudio.Install.PerformanceCounterDesigner, " + Consts.AssemblyMicrosoft_VisualStudio)] -#endif [InstallerType (typeof (PerformanceCounterInstaller))] public sealed class PerformanceCounter : Component, ISupportInitialize { @@ -61,13 +56,9 @@ namespace System.Diagnostics { bool valid_old; bool changed; bool is_custom; -#if NET_2_0 private PerformanceCounterInstanceLifetime lifetime; -#endif -#if NET_2_0 [Obsolete] -#endif public static int DefaultFileMappingSize = 524288; // set catname, countname, instname to "", machname to "." @@ -214,14 +205,12 @@ namespace System.Diagnostics { } } -#if NET_2_0 [MonoTODO] [DefaultValue (PerformanceCounterInstanceLifetime.Global)] public PerformanceCounterInstanceLifetime InstanceLifetime { get { return lifetime; } set { lifetime = value; } } -#endif [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)] [TypeConverter ("System.Diagnostics.Design.InstanceNameConverter, " + Consts.AssemblySystem_Design)] @@ -323,9 +312,7 @@ namespace System.Diagnostics { } // may throw InvalidOperationException, Win32Exception -#if NET_2_0 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)] -#endif public long IncrementBy (long value) { if (changed) @@ -369,9 +356,7 @@ namespace System.Diagnostics { // may throw InvalidOperationException, Win32Exception [MonoTODO] -#if NET_2_0 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)] -#endif public void RemoveInstance () { throw new NotImplementedException (); diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterCategory.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterCategory.cs index fb927dda6df..3f8a88f1147 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterCategory.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterCategory.cs @@ -38,9 +38,7 @@ namespace System.Diagnostics { private string categoryName; private string machineName; -#if NET_2_0 private PerformanceCounterCategoryType type = PerformanceCounterCategoryType.Unknown; -#endif [MethodImplAttribute (MethodImplOptions.InternalCall)] static extern bool CategoryDelete (string name); @@ -131,13 +129,11 @@ namespace System.Diagnostics } } -#if NET_2_0 public PerformanceCounterCategoryType CategoryType { get { return type; } } -#endif public bool CounterExists (string counterName) { @@ -161,9 +157,7 @@ namespace System.Diagnostics return CounterCategoryExists (counterName, categoryName, machineName); } -#if NET_2_0 [Obsolete ("Use another overload that uses PerformanceCounterCategoryType instead")] -#endif public static PerformanceCounterCategory Create ( string categoryName, string categoryHelp, @@ -173,9 +167,7 @@ namespace System.Diagnostics PerformanceCounterCategoryType.Unknown, counterData); } -#if NET_2_0 [Obsolete ("Use another overload that uses PerformanceCounterCategoryType instead")] -#endif public static PerformanceCounterCategory Create ( string categoryName, string categoryHelp, @@ -186,10 +178,7 @@ namespace System.Diagnostics PerformanceCounterCategoryType.Unknown, counterName, counterHelp); } -#if NET_2_0 - public -#endif - static PerformanceCounterCategory Create ( + public static PerformanceCounterCategory Create ( string categoryName, string categoryHelp, PerformanceCounterCategoryType categoryType, @@ -207,10 +196,7 @@ namespace System.Diagnostics return new PerformanceCounterCategory (categoryName, categoryHelp); } -#if NET_2_0 - public -#endif - static PerformanceCounterCategory Create ( + public static PerformanceCounterCategory Create ( string categoryName, string categoryHelp, PerformanceCounterCategoryType categoryType, diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs index 2476875ea05..4fa8fb907f6 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs @@ -28,10 +28,7 @@ namespace System.Diagnostics { -#if NET_2_0 - public -#endif - enum PerformanceCounterCategoryType + public enum PerformanceCounterCategoryType { SingleInstance, MultiInstance, diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs index ffc6488c21a..a9dfab3a9db 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs @@ -25,8 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Diagnostics { public enum PerformanceCounterInstanceLifetime @@ -36,4 +34,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterManager.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterManager.cs index 5a0c7f4e152..eb163c1a984 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterManager.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterManager.cs @@ -36,15 +36,11 @@ namespace System.Diagnostics { [ComVisible(true)] [Guid("82840be1-d273-11d2-b94a-00600893b17a")] [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)] -#if NET_2_0 [Obsolete ("use PerformanceCounter")] -#endif [MonoTODO ("not implemented")] public sealed class PerformanceCounterManager : ICollectData { -#if NET_2_0 [Obsolete ("use PerformanceCounter")] -#endif public PerformanceCounterManager () { } diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAccess.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAccess.cs index f4f62853d35..71f999554f4 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAccess.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAccess.cs @@ -35,7 +35,6 @@ namespace System.Diagnostics { [Flags] public enum PerformanceCounterPermissionAccess { None=0x00, -#if NET_2_0 [Obsolete ()] Browse=1, Read=1, @@ -43,11 +42,6 @@ namespace System.Diagnostics { [Obsolete ()] Instrument=3, Administer=7, -#else - Browse=0x02, - Instrument=0x06, - Administer=0x0E, -#endif } } diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAttribute.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAttribute.cs index 66a709819f1..4dbea2a838e 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAttribute.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAttribute.cs @@ -54,11 +54,7 @@ namespace System.Diagnostics { { categoryName = ResourcePermissionBase.Any; machineName = ResourcePermissionBase.Local; -#if NET_2_0 permissionAccess = PerformanceCounterPermissionAccess.Write; -#else - permissionAccess = PerformanceCounterPermissionAccess.Browse; -#endif } public string CategoryName { diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionEntry.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionEntry.cs index 5edc07ee794..e600568400b 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionEntry.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterPermissionEntry.cs @@ -36,9 +36,7 @@ namespace System.Diagnostics { [Serializable] public class PerformanceCounterPermissionEntry { -#if NET_2_0 private const PerformanceCounterPermissionAccess All = (PerformanceCounterPermissionAccess) 0x07; -#endif private PerformanceCounterPermissionAccess permissionAccess; private string machineName; private string categoryName; @@ -46,12 +44,10 @@ namespace System.Diagnostics { public PerformanceCounterPermissionEntry (PerformanceCounterPermissionAccess permissionAccess, string machineName, string categoryName) { -#if NET_2_0 if (machineName == null) throw new ArgumentNullException ("machineName"); if ((permissionAccess | All) != All) throw new ArgumentException ("permissionAccess"); -#endif ResourcePermissionBase.ValidateMachineName (machineName); if (categoryName == null) throw new ArgumentNullException ("categoryName"); diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterType.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterType.cs index 4925b016079..3f13578758f 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounterType.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounterType.cs @@ -32,9 +32,6 @@ using System; using System.ComponentModel; namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif [TypeConverter (typeof (AlphabeticalEnumConverter))] public enum PerformanceCounterType { NumberOfItemsHEX32=0x00000000, diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index 4b0911045d8..d22a75dd76e 100644 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -49,9 +49,7 @@ namespace System.Diagnostics { [Designer ("System.Diagnostics.Design.ProcessDesigner, " + Consts.AssemblySystem_Design)] [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)] [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)] -#if NET_2_0 [MonitoringDescription ("Represents a system process")] -#endif public class Process : Component { [StructLayout(LayoutKind.Sequential)] @@ -339,9 +337,7 @@ namespace System.Diagnostics { private extern static long GetProcessData (int pid, int data_type, out int error); [MonoTODO] -#if NET_2_0 [Obsolete ("Use NonpagedSystemMemorySize64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The number of bytes that are not pageable.")] public int NonpagedSystemMemorySize { @@ -351,9 +347,7 @@ namespace System.Diagnostics { } [MonoTODO] -#if NET_2_0 [Obsolete ("Use PagedMemorySize64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The number of bytes that are paged.")] public int PagedMemorySize { @@ -363,9 +357,7 @@ namespace System.Diagnostics { } [MonoTODO] -#if NET_2_0 [Obsolete ("Use PagedSystemMemorySize64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of paged system memory in bytes.")] public int PagedSystemMemorySize { @@ -375,9 +367,7 @@ namespace System.Diagnostics { } [MonoTODO] -#if NET_2_0 [Obsolete ("Use PeakPagedMemorySize64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The maximum amount of paged memory used by this process.")] public int PeakPagedMemorySize { @@ -386,9 +376,7 @@ namespace System.Diagnostics { } } -#if NET_2_0 [Obsolete ("Use PeakVirtualMemorySize64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The maximum amount of virtual memory used by this process.")] public int PeakVirtualMemorySize { @@ -398,9 +386,7 @@ namespace System.Diagnostics { } } -#if NET_2_0 [Obsolete ("Use PeakWorkingSet64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The maximum amount of system memory used by this process.")] public int PeakWorkingSet { @@ -410,7 +396,6 @@ namespace System.Diagnostics { } } -#if NET_2_0 [MonoTODO] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The number of bytes that are not pageable.")] @@ -470,7 +455,6 @@ namespace System.Diagnostics { return GetProcessData (pid, 5, out error); } } -#endif [MonoTODO] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] @@ -527,9 +511,7 @@ namespace System.Diagnostics { [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of memory exclusively used by this process.")] -#if NET_2_0 [Obsolete ("Use PrivateMemorySize64")] -#endif public int PrivateMemorySize { get { int error; @@ -537,14 +519,12 @@ namespace System.Diagnostics { } } -#if NET_2_0 [MonoNotSupported ("")] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The session ID for this process.")] public int SessionId { get { throw new NotImplementedException (); } } -#endif /* the meaning of type is as follows: 0: user, 1: system, 2: total */ [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -626,12 +606,10 @@ namespace System.Diagnostics { if (error_stream == null) throw new InvalidOperationException("Standard error has not been redirected"); -#if NET_2_0 if ((async_mode & AsyncModes.AsyncError) != 0) throw new InvalidOperationException ("Cannot mix asynchronous and synchonous reads."); async_mode |= AsyncModes.SyncError; -#endif return(error_stream); } @@ -659,12 +637,10 @@ namespace System.Diagnostics { if (output_stream == null) throw new InvalidOperationException("Standard output has not been redirected"); -#if NET_2_0 if ((async_mode & AsyncModes.AsyncOutput) != 0) throw new InvalidOperationException ("Cannot mix asynchronous and synchonous reads."); async_mode |= AsyncModes.SyncOutput; -#endif return(output_stream); } @@ -733,9 +709,7 @@ namespace System.Diagnostics { } } -#if NET_2_0 [Obsolete ("Use VirtualMemorySize64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of virtual memory currently used for this process.")] public int VirtualMemorySize { @@ -745,9 +719,7 @@ namespace System.Diagnostics { } } -#if NET_2_0 [Obsolete ("Use WorkingSet64")] -#endif [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of physical memory currently used for this process.")] public int WorkingSet { @@ -757,7 +729,6 @@ namespace System.Diagnostics { } } -#if NET_2_0 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of memory exclusively used by this process.")] [ComVisible (false)] @@ -787,7 +758,6 @@ namespace System.Diagnostics { return GetProcessData (pid, 4, out error); } } -#endif public void Close() { @@ -1146,13 +1116,8 @@ namespace System.Diagnostics { process.input_stream.AutoFlush = true; } -#if NET_2_0 Encoding stdoutEncoding = startInfo.StandardOutputEncoding ?? Console.Out.Encoding; Encoding stderrEncoding = startInfo.StandardErrorEncoding ?? Console.Out.Encoding; -#else - Encoding stdoutEncoding = Console.Out.Encoding; - Encoding stderrEncoding = stdoutEncoding; -#endif if (startInfo.RedirectStandardOutput == true) { MonoIO.Close (stdout_wr, out error); @@ -1172,7 +1137,6 @@ namespace System.Diagnostics { // Note that ProcInfo.Password must be freed. private static void FillUserInfo (ProcessStartInfo startInfo, ref ProcInfo proc_info) { -#if NET_2_0 if (startInfo.UserName != null) { proc_info.UserName = startInfo.UserName; proc_info.Domain = startInfo.Domain; @@ -1182,7 +1146,6 @@ namespace System.Diagnostics { proc_info.Password = IntPtr.Zero; proc_info.LoadUserProfile = startInfo.LoadUserProfile; } -#endif } private static bool Start_common (ProcessStartInfo startInfo, @@ -1191,18 +1154,14 @@ namespace System.Diagnostics { if (startInfo.FileName == null || startInfo.FileName.Length == 0) throw new InvalidOperationException("File name has not been set"); -#if NET_2_0 if (startInfo.StandardErrorEncoding != null && !startInfo.RedirectStandardError) throw new InvalidOperationException ("StandardErrorEncoding is only supported when standard error is redirected"); if (startInfo.StandardOutputEncoding != null && !startInfo.RedirectStandardOutput) throw new InvalidOperationException ("StandardOutputEncoding is only supported when standard output is redirected"); -#endif if (startInfo.UseShellExecute) { -#if NET_2_0 if (!String.IsNullOrEmpty (startInfo.UserName)) throw new InvalidOperationException ("UserShellExecute must be false if an explicit UserName is specified when starting a process"); -#endif return (Start_shell (startInfo, process)); } else { return (Start_noshell (startInfo, process)); @@ -1240,7 +1199,6 @@ namespace System.Diagnostics { return Start (new ProcessStartInfo (fileName, arguments)); } -#if NET_2_0 public static Process Start(string fileName, string username, SecureString password, string domain) { return Start(fileName, null, username, password, domain); } @@ -1253,7 +1211,6 @@ namespace System.Diagnostics { psi.UseShellExecute = false; return Start(psi); } -#endif public override string ToString() { @@ -1276,7 +1233,6 @@ namespace System.Diagnostics { if (ms == int.MaxValue) ms = -1; -#if NET_2_0 DateTime start = DateTime.UtcNow; if (async_output != null && !async_output.IsCompleted) { if (false == async_output.WaitHandle.WaitOne (ms, false)) @@ -1301,7 +1257,6 @@ namespace System.Diagnostics { return false; } } -#endif return WaitForExit_internal (process_handle, ms); } @@ -1331,7 +1286,6 @@ namespace System.Diagnostics { return (string.Compare (machineName, Environment.MachineName, true) == 0); } -#if NET_2_0 [Browsable (true)] [MonitoringDescription ("Raised when it receives output data")] public event DataReceivedEventHandler OutputDataReceived; @@ -1574,7 +1528,6 @@ namespace System.Diagnostics { error_canceled = true; } -#endif [Category ("Behavior")] [MonitoringDescription ("Raised when this process exits.")] diff --git a/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs b/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs index 1e58a8c6384..e932402322f 100644 --- a/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs +++ b/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs @@ -29,9 +29,7 @@ // namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif + public enum ProcessPriorityClass { AboveNormal=0x08000, BelowNormal=0x04000, diff --git a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs index 34dd4f5218e..1586f613753 100644 --- a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs +++ b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs @@ -62,11 +62,7 @@ namespace System.Diagnostics private ProcessWindowStyle window_style = ProcessWindowStyle.Normal; private Encoding encoding_stderr, encoding_stdout; private string username, domain; -#if NET_2_0 private SecureString password; -#else - private object password; // dummy -#endif private bool load_user_profile; public ProcessStartInfo() @@ -88,9 +84,7 @@ namespace System.Diagnostics [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)] [MonitoringDescription ("Command line agruments for this process.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public string Arguments { get { return(arguments); @@ -102,9 +96,7 @@ namespace System.Diagnostics [DefaultValue (false)] [MonitoringDescription ("Start this process with a new window.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public bool CreateNoWindow { get { return(create_no_window); @@ -117,9 +109,7 @@ namespace System.Diagnostics [DesignerSerializationVisibility (DesignerSerializationVisibility.Content), DefaultValue (null)] [Editor ("System.Diagnostics.Design.StringDictionaryEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)] [MonitoringDescription ("Environment variables used for this process.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public StringDictionary EnvironmentVariables { get { if (envVars == null) { @@ -138,9 +128,7 @@ namespace System.Diagnostics [DefaultValue (false)] [MonitoringDescription ("Thread shows dialogboxes for errors.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public bool ErrorDialog { get { return(error_dialog); @@ -164,9 +152,7 @@ namespace System.Diagnostics [Editor ("System.Diagnostics.Design.StartFileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)] [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)] [MonitoringDescription ("The name of the resource to start this process.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public string FileName { get { return(filename); @@ -178,9 +164,7 @@ namespace System.Diagnostics [DefaultValue (false)] [MonitoringDescription ("Errors of this process are redirected.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public bool RedirectStandardError { get { return(redirect_standard_error); @@ -192,9 +176,7 @@ namespace System.Diagnostics [DefaultValue (false)] [MonitoringDescription ("Standard input of this process is redirected.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public bool RedirectStandardInput { get { return(redirect_standard_input); @@ -206,9 +188,7 @@ namespace System.Diagnostics [DefaultValue (false)] [MonitoringDescription ("Standart output of this process is redirected.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public bool RedirectStandardOutput { get { return(redirect_standard_output); @@ -218,7 +198,6 @@ namespace System.Diagnostics } } -#if NET_2_0 public Encoding StandardErrorEncoding { get { return encoding_stderr; } set { encoding_stderr = value; } @@ -228,13 +207,10 @@ namespace System.Diagnostics get { return encoding_stdout; } set { encoding_stdout = value; } } -#endif [DefaultValue (true)] [MonitoringDescription ("Use the shell to start this process.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public bool UseShellExecute { get { return(use_shell_execute); @@ -247,9 +223,7 @@ namespace System.Diagnostics [DefaultValue ("")] [TypeConverter ("System.Diagnostics.Design.VerbConverter, " + Consts.AssemblySystem_Design)] [MonitoringDescription ("The verb to apply to a used document.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public string Verb { get { return(verb); @@ -301,9 +275,7 @@ namespace System.Diagnostics [DefaultValue (typeof (ProcessWindowStyle), "Normal")] [MonitoringDescription ("The window style used to start this process.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public ProcessWindowStyle WindowStyle { get { return(window_style); @@ -317,9 +289,7 @@ namespace System.Diagnostics [Editor ("System.Diagnostics.Design.WorkingDirectoryEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)] [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)] [MonitoringDescription ("The initial directory for this process.")] -#if NET_2_0 [NotifyParentPropertyAttribute (true)] -#endif public string WorkingDirectory { get { return(working_directory); @@ -329,7 +299,6 @@ namespace System.Diagnostics } } -#if NET_2_0 [NotifyParentPropertyAttribute (true)] public bool LoadUserProfile { get { return load_user_profile; } @@ -352,6 +321,5 @@ namespace System.Diagnostics get { return password; } set { password = value; } } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs b/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs index e5685e62945..888736404d8 100644 --- a/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs +++ b/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs @@ -29,9 +29,6 @@ // namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif public enum ProcessWindowStyle { Hidden=1, Maximized=3, diff --git a/mcs/class/System/System.Diagnostics/SourceFilter.cs b/mcs/class/System/System.Diagnostics/SourceFilter.cs index e420c8060d1..0e05ec73033 100644 --- a/mcs/class/System/System.Diagnostics/SourceFilter.cs +++ b/mcs/class/System/System.Diagnostics/SourceFilter.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.IO; using System.Collections; @@ -68,4 +66,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/SourceLevels.cs b/mcs/class/System/System.Diagnostics/SourceLevels.cs index 778ba84b2eb..20b4acf146d 100644 --- a/mcs/class/System/System.Diagnostics/SourceLevels.cs +++ b/mcs/class/System/System.Diagnostics/SourceLevels.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.ComponentModel; @@ -50,4 +49,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/SourceSwitch.cs b/mcs/class/System/System.Diagnostics/SourceSwitch.cs index 60c0e153232..d991271478e 100644 --- a/mcs/class/System/System.Diagnostics/SourceSwitch.cs +++ b/mcs/class/System/System.Diagnostics/SourceSwitch.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; @@ -86,4 +85,4 @@ namespace System.Diagnostics } } } -#endif + diff --git a/mcs/class/System/System.Diagnostics/Stopwatch.cs b/mcs/class/System/System.Diagnostics/Stopwatch.cs index 72d3cef3f06..e0efe160429 100644 --- a/mcs/class/System/System.Diagnostics/Stopwatch.cs +++ b/mcs/class/System/System.Diagnostics/Stopwatch.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.ComponentModel; using System.Runtime.InteropServices; @@ -129,4 +127,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/Switch.cs b/mcs/class/System/System.Diagnostics/Switch.cs index 3f9e61c1aa2..14540ba084d 100644 --- a/mcs/class/System/System.Diagnostics/Switch.cs +++ b/mcs/class/System/System.Diagnostics/Switch.cs @@ -34,7 +34,7 @@ using System.Collections; using System.Collections.Specialized; -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; #endif @@ -45,10 +45,8 @@ namespace System.Diagnostics private string name; private string description; private int switchSetting; -#if NET_2_0 private string value; private string defaultSwitchValue; -#endif // MS Behavior is that (quoting from MSDN for OnSwitchSettingChanged()): // "...It is invoked the first time a switch reads its value from the // configuration file..." @@ -70,13 +68,11 @@ namespace System.Diagnostics this.description = description; } -#if NET_2_0 protected Switch(string displayName, string description, string defaultSwitchValue) : this (displayName, description) { this.defaultSwitchValue = defaultSwitchValue; } -#endif public string Description { get {return description;} @@ -104,7 +100,6 @@ namespace System.Diagnostics } } -#if NET_2_0 StringDictionary attributes = new StringDictionary (); #if XML_DEP @@ -118,7 +113,7 @@ namespace System.Diagnostics get { return value; } set { this.value = value; -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP try { OnValueChanged (); } catch (Exception ex) { @@ -143,7 +138,6 @@ namespace System.Diagnostics protected virtual void OnValueChanged () { } -#endif private void GetConfigFileSetting () { @@ -152,7 +146,7 @@ namespace System.Diagnostics // Load up the specified switch if (d != null) { if (d.Contains (name)) { -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP Value = d [name] as string; #else switchSetting = (int) d [name]; @@ -161,12 +155,10 @@ namespace System.Diagnostics } } -#if NET_2_0 if (defaultSwitchValue != null) { value = defaultSwitchValue; OnValueChanged (); } -#endif } protected virtual void OnSwitchSettingChanged() diff --git a/mcs/class/System/System.Diagnostics/SwitchAttribute.cs b/mcs/class/System/System.Diagnostics/SwitchAttribute.cs index 0c843755bda..ebb3e194dbc 100644 --- a/mcs/class/System/System.Diagnostics/SwitchAttribute.cs +++ b/mcs/class/System/System.Diagnostics/SwitchAttribute.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Diagnostics; using System.Reflection; @@ -95,4 +93,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/SwitchLevelAttribute.cs b/mcs/class/System/System.Diagnostics/SwitchLevelAttribute.cs index cad3735f255..450fe9c67c9 100644 --- a/mcs/class/System/System.Diagnostics/SwitchLevelAttribute.cs +++ b/mcs/class/System/System.Diagnostics/SwitchLevelAttribute.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.IO; using System.Collections; @@ -61,4 +59,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs b/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs index 7d8f9200f12..05602eb3451 100644 --- a/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs +++ b/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs @@ -29,9 +29,6 @@ // namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif public enum ThreadPriorityLevel { AboveNormal=1, BelowNormal=-1, diff --git a/mcs/class/System/System.Diagnostics/ThreadState.cs b/mcs/class/System/System.Diagnostics/ThreadState.cs index 8c8a6a6f43e..f1dc15a5c92 100644 --- a/mcs/class/System/System.Diagnostics/ThreadState.cs +++ b/mcs/class/System/System.Diagnostics/ThreadState.cs @@ -29,9 +29,6 @@ // namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif public enum ThreadState { Initialized=0, Ready=1, diff --git a/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs b/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs index 51b59f9f188..56b2e918aeb 100644 --- a/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs +++ b/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs @@ -29,9 +29,6 @@ // namespace System.Diagnostics { -#if !NET_2_0 - [Serializable] -#endif public enum ThreadWaitReason { EventPairHigh=7, EventPairLow=8, diff --git a/mcs/class/System/System.Diagnostics/Trace.cs b/mcs/class/System/System.Diagnostics/Trace.cs index 4cc9b033156..d4bdca0b664 100644 --- a/mcs/class/System/System.Diagnostics/Trace.cs +++ b/mcs/class/System/System.Diagnostics/Trace.cs @@ -41,13 +41,11 @@ namespace System.Diagnostics { private Trace () {} -#if NET_2_0 [MonoNotSupported ("")] public static void Refresh () { throw new NotImplementedException (); } -#endif public static bool AutoFlush { get {return TraceImpl.AutoFlush;} @@ -68,16 +66,11 @@ namespace System.Diagnostics { get {return TraceImpl.Listeners;} } -#if NET_2_0 public static CorrelationManager CorrelationManager { get { return TraceImpl.CorrelationManager; } } - public -#else - internal -#endif - static bool UseGlobalLock { + public static bool UseGlobalLock { get { return TraceImpl.UseGlobalLock; } set { TraceImpl.UseGlobalLock = value; } } @@ -237,7 +230,6 @@ namespace System.Diagnostics { TraceImpl.WriteLineIf (condition, message, category); } -#if NET_2_0 static void DoTrace (string kind, Assembly report, string message) { TraceImpl.WriteLine (String.Format ("{0} {1} : 0 : {2}", report.Location, kind, message)); @@ -278,7 +270,6 @@ namespace System.Diagnostics { { DoTrace ("Warning", Assembly.GetCallingAssembly (), String.Format (message, args)); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/TraceEventCache.cs b/mcs/class/System/System.Diagnostics/TraceEventCache.cs index 193daf5cd76..b63d6bc5448 100644 --- a/mcs/class/System/System.Diagnostics/TraceEventCache.cs +++ b/mcs/class/System/System.Diagnostics/TraceEventCache.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; using System.Text; @@ -80,4 +78,3 @@ namespace System.Diagnostics } } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceEventCache.jvm.cs b/mcs/class/System/System.Diagnostics/TraceEventCache.jvm.cs index a0f12b5dce7..420876d3ba1 100755 --- a/mcs/class/System/System.Diagnostics/TraceEventCache.jvm.cs +++ b/mcs/class/System/System.Diagnostics/TraceEventCache.jvm.cs @@ -2,8 +2,6 @@ /// Stub class /// -#if NET_2_0 - using System; using System.Collections; using System.Text; @@ -52,4 +50,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceEventType.cs b/mcs/class/System/System.Diagnostics/TraceEventType.cs index c787d5739ac..b4fc6e3c3c7 100644 --- a/mcs/class/System/System.Diagnostics/TraceEventType.cs +++ b/mcs/class/System/System.Diagnostics/TraceEventType.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; namespace System.Diagnostics @@ -54,4 +52,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceFilter.cs b/mcs/class/System/System.Diagnostics/TraceFilter.cs index 188bb7ef2c9..6d515d9130b 100644 --- a/mcs/class/System/System.Diagnostics/TraceFilter.cs +++ b/mcs/class/System/System.Diagnostics/TraceFilter.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.IO; using System.Collections; @@ -47,4 +45,3 @@ namespace System.Diagnostics object [] data); } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceImpl.cs b/mcs/class/System/System.Diagnostics/TraceImpl.cs index 16704571117..83ed38408f6 100644 --- a/mcs/class/System/System.Diagnostics/TraceImpl.cs +++ b/mcs/class/System/System.Diagnostics/TraceImpl.cs @@ -42,7 +42,8 @@ namespace System.Diagnostics { public const string Key = ".__TraceInfoSettingsKey__."; public bool AutoFlush; - public int IndentLevel, IndentSize = 4; + //public int IndentLevel; + public int IndentSize = 4; public TraceListenerCollection Listeners = new TraceListenerCollection (false); public TraceImplSettings () @@ -162,7 +163,7 @@ namespace System.Diagnostics { } static bool use_global_lock; -#if NET_2_0 && !MOBILE +#if !MOBILE static CorrelationManager correlation_manager = new CorrelationManager (); public static CorrelationManager CorrelationManager { @@ -214,7 +215,7 @@ namespace System.Diagnostics { d.Remove (TraceImplSettings.Key); autoFlush = s.AutoFlush; - indentLevel = s.IndentLevel; +// indentLevel = s.IndentLevel; indentSize = s.IndentSize; listeners = s.Listeners; } diff --git a/mcs/class/System/System.Diagnostics/TraceListener.cs b/mcs/class/System/System.Diagnostics/TraceListener.cs index 6ce37000c10..f2d3c766105 100644 --- a/mcs/class/System/System.Diagnostics/TraceListener.cs +++ b/mcs/class/System/System.Diagnostics/TraceListener.cs @@ -70,7 +70,6 @@ namespace System.Diagnostics { set { System.Threading.Thread.SetData (_indentSizeStore, value); } } -#if NET_2_0 private StringDictionary attributes { get { return (StringDictionary) System.Threading.Thread.GetData (_attributesStore); } set { System.Threading.Thread.SetData (_attributesStore, value); } @@ -92,7 +91,6 @@ namespace System.Diagnostics { } set { System.Threading.Thread.SetData (_optionsStore, value); } } -#endif #else [ThreadStatic] private int indentLevel = 0; @@ -100,7 +98,6 @@ namespace System.Diagnostics { [ThreadStatic] private int indentSize = 4; -#if NET_2_0 [ThreadStatic] private StringDictionary attributes = new StringDictionary (); #if !MOBILE @@ -109,7 +106,6 @@ namespace System.Diagnostics { #endif [ThreadStatic] private TraceOptions options; -#endif #endif private string name; @@ -144,12 +140,10 @@ namespace System.Diagnostics { set {needIndent = value;} } -#if NET_2_0 [MonoLimitation ("This property exists but is never considered.")] public virtual bool IsThreadSafe { get { return false; } } -#endif public virtual void Close () { @@ -228,7 +222,6 @@ namespace System.Diagnostics { WriteLine (category + ": " + message); } -#if NET_2_0 internal static string FormatArray (ICollection list, string joiner) { string [] arr = new string [list.Count]; @@ -327,7 +320,6 @@ namespace System.Diagnostics { get { return options; } set { options = value; } } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs b/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs index f2c36d87f9a..d084a6a201d 100644 --- a/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs +++ b/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs @@ -112,7 +112,7 @@ namespace System.Diagnostics { #if !MOBILE internal void Add (TraceListener listener, TraceImplSettings settings) { - listener.IndentLevel = settings.IndentLevel; +// listener.IndentLevel = settings.IndentLevel; listener.IndentSize = settings.IndentSize; listeners.Add (listener); } diff --git a/mcs/class/System/System.Diagnostics/TraceOptions.cs b/mcs/class/System/System.Diagnostics/TraceOptions.cs index e8affecee8a..8dd27d568a1 100644 --- a/mcs/class/System/System.Diagnostics/TraceOptions.cs +++ b/mcs/class/System/System.Diagnostics/TraceOptions.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Diagnostics { [Flags] @@ -42,4 +41,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceSource.cs b/mcs/class/System/System.Diagnostics/TraceSource.cs index 1d9df3a06b6..a99e77a2e6f 100644 --- a/mcs/class/System/System.Diagnostics/TraceSource.cs +++ b/mcs/class/System/System.Diagnostics/TraceSource.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; using System.Collections.Specialized; @@ -190,4 +188,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs b/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs index c907d6046a8..f516579a030 100644 --- a/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs +++ b/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Diagnostics; @@ -69,4 +67,3 @@ namespace System.Diagnostics } } -#endif diff --git a/mcs/class/System/System.Diagnostics/TraceSwitch.cs b/mcs/class/System/System.Diagnostics/TraceSwitch.cs index 82c82d35ec5..c7781af8f08 100644 --- a/mcs/class/System/System.Diagnostics/TraceSwitch.cs +++ b/mcs/class/System/System.Diagnostics/TraceSwitch.cs @@ -34,9 +34,7 @@ namespace System.Diagnostics { -#if NET_2_0 [SwitchLevel (typeof (TraceLevel))] -#endif public class TraceSwitch : Switch { public TraceSwitch(string displayName, string description) @@ -44,13 +42,11 @@ namespace System.Diagnostics { } -#if NET_2_0 public TraceSwitch(string displayName, string description, string defaultSwitchValue) : base(displayName, description) { Value = defaultSwitchValue; } -#endif public TraceLevel Level { get {return (TraceLevel) SwitchSetting;} @@ -90,13 +86,11 @@ namespace System.Diagnostics SwitchSetting = (int) TraceLevel.Verbose; } -#if NET_2_0 protected override void OnValueChanged () { SwitchSetting = (int) Enum.Parse (typeof (TraceLevel), Value, true); } -#endif } } diff --git a/mcs/class/System/System.Diagnostics/Win32EventLog.cs b/mcs/class/System/System.Diagnostics/Win32EventLog.cs index 1422f883936..c3f68c8b789 100644 --- a/mcs/class/System/System.Diagnostics/Win32EventLog.cs +++ b/mcs/class/System/System.Diagnostics/Win32EventLog.cs @@ -760,7 +760,6 @@ namespace System.Diagnostics } } -#if NET_2_0 public override OverflowAction OverflowAction { get { throw new NotImplementedException (); } } @@ -783,7 +782,6 @@ namespace System.Diagnostics { throw new NotImplementedException (); } -#endif private class PInvoke { diff --git a/mcs/class/System/System.Diagnostics/XmlWriterTraceListener.cs b/mcs/class/System/System.Diagnostics/XmlWriterTraceListener.cs index 0da273bed2b..4f330455fd4 100644 --- a/mcs/class/System/System.Diagnostics/XmlWriterTraceListener.cs +++ b/mcs/class/System/System.Diagnostics/XmlWriterTraceListener.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && XML_DEP +#if XML_DEP using System; using System.IO; @@ -177,7 +177,7 @@ namespace System.Diagnostics w.WriteString (level.ToString ()); w.WriteEndElement (); w.WriteStartElement ("TimeCreated", sys_ns); - w.WriteAttributeString ("SystemTime", XmlConvert.ToString (eventCache != null ? eventCache.DateTime : DateTime.Now)); + w.WriteAttributeString ("SystemTime", XmlConvert.ToString (eventCache != null ? eventCache.DateTime : DateTime.Now, XmlDateTimeSerializationMode.Unspecified)); w.WriteEndElement (); w.WriteStartElement ("Source", sys_ns); w.WriteAttributeString ("Name", source); diff --git a/mcs/class/System/System.IO.Compression/CompressionMode.cs b/mcs/class/System/System.IO.Compression/CompressionMode.cs index 64ee64cfa24..60adaa81f54 100644 --- a/mcs/class/System/System.IO.Compression/CompressionMode.cs +++ b/mcs/class/System/System.IO.Compression/CompressionMode.cs @@ -8,8 +8,6 @@ // (c) 2004 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Compression { public enum CompressionMode { Decompress=0, // Decompress the given stream. @@ -17,4 +15,3 @@ namespace System.IO.Compression { }; } -#endif diff --git a/mcs/class/System/System.IO.Compression/DefalteStream.jvm.cs b/mcs/class/System/System.IO.Compression/DefalteStream.jvm.cs index 36be2f4db4b..2c5cc758a7a 100644 --- a/mcs/class/System/System.IO.Compression/DefalteStream.jvm.cs +++ b/mcs/class/System/System.IO.Compression/DefalteStream.jvm.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -//#if NET_2_0 using System; using System.IO; using System.Runtime.InteropServices; @@ -368,4 +367,3 @@ namespace System.IO.Compression #endregion } } -//#endif diff --git a/mcs/class/System/System.IO.Compression/DeflateStream.cs b/mcs/class/System/System.IO.Compression/DeflateStream.cs index 0344db42b12..35167906331 100644 --- a/mcs/class/System/System.IO.Compression/DeflateStream.cs +++ b/mcs/class/System/System.IO.Compression/DeflateStream.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.IO; using System.Runtime.InteropServices; @@ -438,5 +437,4 @@ namespace System.IO.Compression { static extern int WriteZStream (IntPtr stream, IntPtr buffer, int length); } } -#endif diff --git a/mcs/class/System/System.IO.Compression/GZipStream.cs b/mcs/class/System/System.IO.Compression/GZipStream.cs index 7c4cbe02dd1..0fd9a63a265 100644 --- a/mcs/class/System/System.IO.Compression/GZipStream.cs +++ b/mcs/class/System/System.IO.Compression/GZipStream.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.IO; using System.Runtime.InteropServices; @@ -175,5 +174,4 @@ namespace System.IO.Compression { } } -#endif diff --git a/mcs/class/System/System.IO.Ports/Handshake.cs b/mcs/class/System/System.IO.Ports/Handshake.cs index a03cf23f7f0..6e7b5dbff58 100644 --- a/mcs/class/System/System.IO.Ports/Handshake.cs +++ b/mcs/class/System/System.IO.Ports/Handshake.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { public enum Handshake @@ -20,5 +18,4 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/ISerialStream.cs b/mcs/class/System/System.IO.Ports/ISerialStream.cs index c4c7e6f0a24..5f559a02d31 100644 --- a/mcs/class/System/System.IO.Ports/ISerialStream.cs +++ b/mcs/class/System/System.IO.Ports/ISerialStream.cs @@ -9,8 +9,6 @@ using System; -#if NET_2_0 - namespace System.IO.Ports { interface ISerialStream : IDisposable @@ -32,5 +30,4 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/Parity.cs b/mcs/class/System/System.IO.Ports/Parity.cs index 827466eb8da..a4700c7cd7e 100644 --- a/mcs/class/System/System.IO.Ports/Parity.cs +++ b/mcs/class/System/System.IO.Ports/Parity.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { public enum Parity @@ -21,5 +19,4 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialData.cs b/mcs/class/System/System.IO.Ports/SerialData.cs index e978cbbffb0..a89dbf1f6cb 100644 --- a/mcs/class/System/System.IO.Ports/SerialData.cs +++ b/mcs/class/System/System.IO.Ports/SerialData.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { public enum SerialData @@ -18,5 +16,3 @@ namespace System.IO.Ports } } -#endif - diff --git a/mcs/class/System/System.IO.Ports/SerialError.cs b/mcs/class/System/System.IO.Ports/SerialError.cs index beefb188bc3..39b561a21da 100644 --- a/mcs/class/System/System.IO.Ports/SerialError.cs +++ b/mcs/class/System/System.IO.Ports/SerialError.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { public enum SerialError @@ -21,5 +19,4 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialErrorEventArgs.cs b/mcs/class/System/System.IO.Ports/SerialErrorEventArgs.cs index 9eabfc9e961..3b2660958d8 100644 --- a/mcs/class/System/System.IO.Ports/SerialErrorEventArgs.cs +++ b/mcs/class/System/System.IO.Ports/SerialErrorEventArgs.cs @@ -1,7 +1,5 @@ /* -*- Mode: Csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -#if NET_2_0 - namespace System.IO.Ports { public class SerialErrorReceivedEventArgs : EventArgs @@ -24,4 +22,3 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialPinChange.cs b/mcs/class/System/System.IO.Ports/SerialPinChange.cs index bbb735aea6f..255e78d4e84 100644 --- a/mcs/class/System/System.IO.Ports/SerialPinChange.cs +++ b/mcs/class/System/System.IO.Ports/SerialPinChange.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { public enum SerialPinChange @@ -21,5 +19,4 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialPinChangedEventArgs.cs b/mcs/class/System/System.IO.Ports/SerialPinChangedEventArgs.cs index a904b04778c..46824318bf4 100644 --- a/mcs/class/System/System.IO.Ports/SerialPinChangedEventArgs.cs +++ b/mcs/class/System/System.IO.Ports/SerialPinChangedEventArgs.cs @@ -1,7 +1,5 @@ /* -*- Mode: Csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -#if NET_2_0 - namespace System.IO.Ports { public class SerialPinChangedEventArgs : EventArgs @@ -23,4 +21,3 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialPort.cs b/mcs/class/System/System.IO.Ports/SerialPort.cs index 657d4b18726..6d091336989 100644 --- a/mcs/class/System/System.IO.Ports/SerialPort.cs +++ b/mcs/class/System/System.IO.Ports/SerialPort.cs @@ -17,8 +17,6 @@ // reads // -#if NET_2_0 - using System; using System.Collections.Generic; using System.ComponentModel; @@ -601,7 +599,6 @@ namespace System.IO.Ports return stream.Read (buffer, offset, count); } - [MonoTODO("Read of char buffers is currently broken")] public int Read (char[] buffer, int offset, int count) { CheckOpen (); @@ -614,10 +611,11 @@ namespace System.IO.Ports throw new ArgumentException ("offset+count", "The size of the buffer is less than offset + count."); - // The following code does not work, we nee to reintroduce a buffer stream somewhere - // for this to work; In addition the code is broken. - byte [] bytes = encoding.GetBytes (buffer, offset, count); - return stream.Read (bytes, 0, bytes.Length); + int c, i; + for (i = 0; i < count && (c = ReadChar ()) != -1; i++) + buffer[offset + i] = (char) c; + + return i; } internal int read_byte () @@ -807,4 +805,3 @@ namespace System.IO.Ports } -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialPortStream.cs b/mcs/class/System/System.IO.Ports/SerialPortStream.cs index 61ca0498e9e..dd4ac22f98b 100644 --- a/mcs/class/System/System.IO.Ports/SerialPortStream.cs +++ b/mcs/class/System/System.IO.Ports/SerialPortStream.cs @@ -10,8 +10,6 @@ // Slightly modified by Konrad M. Kruczynski (added baud rate value checking) -#if NET_2_0 - using System; using System.IO; using System.Runtime.InteropServices; @@ -331,6 +329,4 @@ namespace System.IO.Ports } } -#endif - diff --git a/mcs/class/System/System.IO.Ports/SerialReceivedEventArgs.cs b/mcs/class/System/System.IO.Ports/SerialReceivedEventArgs.cs index 9896d102aac..de671577037 100644 --- a/mcs/class/System/System.IO.Ports/SerialReceivedEventArgs.cs +++ b/mcs/class/System/System.IO.Ports/SerialReceivedEventArgs.cs @@ -1,7 +1,5 @@ /* -*- Mode: Csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -#if NET_2_0 - namespace System.IO.Ports { public class SerialDataReceivedEventArgs : EventArgs @@ -22,5 +20,3 @@ namespace System.IO.Ports SerialData eventType; } } - -#endif diff --git a/mcs/class/System/System.IO.Ports/SerialSignal.cs b/mcs/class/System/System.IO.Ports/SerialSignal.cs index 4d0de93da36..8874c5decca 100644 --- a/mcs/class/System/System.IO.Ports/SerialSignal.cs +++ b/mcs/class/System/System.IO.Ports/SerialSignal.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { enum SerialSignal { @@ -21,5 +19,3 @@ namespace System.IO.Ports } } -#endif - diff --git a/mcs/class/System/System.IO.Ports/StopBits.cs b/mcs/class/System/System.IO.Ports/StopBits.cs index 66fef341896..e91939ef89c 100644 --- a/mcs/class/System/System.IO.Ports/StopBits.cs +++ b/mcs/class/System/System.IO.Ports/StopBits.cs @@ -7,8 +7,6 @@ // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 - namespace System.IO.Ports { public enum StopBits @@ -20,5 +18,3 @@ namespace System.IO.Ports } } -#endif - diff --git a/mcs/class/System/System.IO.Ports/WinSerialStream.cs b/mcs/class/System/System.IO.Ports/WinSerialStream.cs index 280082a706a..f30973fc346 100644 --- a/mcs/class/System/System.IO.Ports/WinSerialStream.cs +++ b/mcs/class/System/System.IO.Ports/WinSerialStream.cs @@ -14,8 +14,6 @@ using System.Runtime.InteropServices; using System.Threading; using System.ComponentModel; -#if NET_2_0 - namespace System.IO.Ports { class WinSerialStream : Stream, ISerialStream, IDisposable @@ -111,21 +109,13 @@ namespace System.IO.Ports // Init overlapped structures NativeOverlapped wo = new NativeOverlapped (); write_event = new ManualResetEvent (false); -#if NET_2_0 wo.EventHandle = write_event.Handle; -#else - wo.EventHandle = (int) write_event.Handle; -#endif write_overlapped = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (NativeOverlapped))); Marshal.StructureToPtr (wo, write_overlapped, true); NativeOverlapped ro = new NativeOverlapped (); read_event = new ManualResetEvent (false); -#if NET_2_0 ro.EventHandle = read_event.Handle; -#else - ro.EventHandle = (int) read_event.Handle; -#endif read_overlapped = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (NativeOverlapped))); Marshal.StructureToPtr (ro, read_overlapped, true); } @@ -584,5 +574,4 @@ namespace System.IO.Ports } } -#endif diff --git a/mcs/class/System/System.IO/FileSystemWatcher.cs b/mcs/class/System/System.IO/FileSystemWatcher.cs index 88dd5d813dd..d92f827f7fa 100644 --- a/mcs/class/System/System.IO/FileSystemWatcher.cs +++ b/mcs/class/System/System.IO/FileSystemWatcher.cs @@ -40,9 +40,7 @@ using System.Threading; namespace System.IO { [DefaultEvent("Changed")] -#if NET_2_0 [IODescription ("")] -#endif public class FileSystemWatcher : Component, ISupportInitialize { #region Fields @@ -333,9 +331,7 @@ namespace System.IO { [DefaultValue(null)] [IODescription("The object used to marshal the event handler calls resulting from a directory change")] -#if NET_2_0 [Browsable (false)] -#endif public ISynchronizeInvoke SynchronizingObject { get { return synchronizingObject; } set { synchronizingObject = value; } diff --git a/mcs/class/System/System.IO/InotifyWatcher.cs b/mcs/class/System/System.IO/InotifyWatcher.cs index 9dce03ee1f0..fe023429a0c 100644 --- a/mcs/class/System/System.IO/InotifyWatcher.cs +++ b/mcs/class/System/System.IO/InotifyWatcher.cs @@ -555,9 +555,7 @@ namespace System.IO { foreach (InotifyData child in parent.children) { if (child.Directory.StartsWith (renamedOldFullPath -#if NET_2_0 , StringComparison.Ordinal -#endif )) { child.Directory = renamedFullPath + child.Directory.Substring (renamedOldFullPathLength); diff --git a/mcs/class/System/System.IO/InvalidDataException.cs b/mcs/class/System/System.IO/InvalidDataException.cs index d8faf6ecb52..c4c2368d82f 100644 --- a/mcs/class/System/System.IO/InvalidDataException.cs +++ b/mcs/class/System/System.IO/InvalidDataException.cs @@ -8,8 +8,6 @@ // Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com) // -#if NET_2_0 - using System.Globalization; using System.Runtime.Serialization; @@ -46,4 +44,3 @@ namespace System.IO } } -#endif diff --git a/mcs/class/System/System.Media/AudioData.cs b/mcs/class/System/System.Media/AudioData.cs index 17b8a791020..552fc0d92d3 100644 --- a/mcs/class/System/System.Media/AudioData.cs +++ b/mcs/class/System/System.Media/AudioData.cs @@ -1,5 +1,4 @@ -#if NET_2_0 using System; using System.IO; using System.Runtime.InteropServices; @@ -231,5 +230,4 @@ namespace Mono.Audio { } -#endif diff --git a/mcs/class/System/System.Media/AudioDevice.cs b/mcs/class/System/System.Media/AudioDevice.cs index 1beac695bcb..bfc6c0c3f4c 100644 --- a/mcs/class/System/System.Media/AudioDevice.cs +++ b/mcs/class/System/System.Media/AudioDevice.cs @@ -1,5 +1,4 @@ -#if NET_2_0 using System; using System.IO; using System.Runtime.InteropServices; @@ -139,5 +138,4 @@ namespace Mono.Audio { } } -#endif diff --git a/mcs/class/System/System.Media/SoundPlayer.cs b/mcs/class/System/System.Media/SoundPlayer.cs index 28c36903bf7..1166715d905 100644 --- a/mcs/class/System/System.Media/SoundPlayer.cs +++ b/mcs/class/System/System.Media/SoundPlayer.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.IO; using System.Threading; @@ -330,4 +329,3 @@ namespace System.Media { } } -#endif diff --git a/mcs/class/System/System.Media/SystemSound.cs b/mcs/class/System/System.Media/SystemSound.cs index 38341942899..4369fec27d2 100644 --- a/mcs/class/System/System.Media/SystemSound.cs +++ b/mcs/class/System/System.Media/SystemSound.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.IO; @@ -49,5 +48,4 @@ namespace System.Media { } } -#endif diff --git a/mcs/class/System/System.Media/SystemSounds.cs b/mcs/class/System/System.Media/SystemSounds.cs index 4a7fb46c011..abc4728e5f7 100644 --- a/mcs/class/System/System.Media/SystemSounds.cs +++ b/mcs/class/System/System.Media/SystemSounds.cs @@ -25,8 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Media { public sealed class SystemSounds { @@ -68,5 +66,4 @@ namespace System.Media { } } -#endif diff --git a/mcs/class/System/System.Media/Win32SoundPlayer.cs b/mcs/class/System/System.Media/Win32SoundPlayer.cs index ac96af29c30..42aeba7a80d 100644 --- a/mcs/class/System/System.Media/Win32SoundPlayer.cs +++ b/mcs/class/System/System.Media/Win32SoundPlayer.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.IO; using System.Runtime.InteropServices; @@ -121,4 +119,3 @@ namespace Mono.Audio } } -#endif diff --git a/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs b/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs index 0e34ba530bf..f574237ed17 100644 --- a/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs +++ b/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Cache { public enum HttpCacheAgeControl @@ -44,4 +42,3 @@ namespace System.Net.Cache } } -#endif diff --git a/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs b/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs index a9338c77dcf..9aa816dff54 100644 --- a/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs +++ b/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Cache { public enum HttpRequestCacheLevel @@ -47,4 +45,3 @@ namespace System.Net.Cache } } -#endif diff --git a/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs b/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs index 3283efe1e03..d0e28434d25 100644 --- a/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs +++ b/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Net.Cache @@ -140,4 +138,3 @@ namespace System.Net.Cache } } -#endif diff --git a/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs b/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs index 7a20f5517c7..3b78221f39c 100644 --- a/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs +++ b/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Cache { public enum RequestCacheLevel @@ -45,4 +43,3 @@ namespace System.Net.Cache } } -#endif diff --git a/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs b/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs index 0215b50206a..048319261b9 100644 --- a/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs +++ b/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Net.Cache @@ -76,4 +74,3 @@ namespace System.Net.Cache } } -#endif diff --git a/mcs/class/System/System.Net.Configuration/AuthenticationModuleElement.cs b/mcs/class/System/System.Net.Configuration/AuthenticationModuleElement.cs index 62413a1d7c0..abf82f1d619 100644 --- a/mcs/class/System/System.Net.Configuration/AuthenticationModuleElement.cs +++ b/mcs/class/System/System.Net.Configuration/AuthenticationModuleElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/AuthenticationModuleElementCollection.cs b/mcs/class/System/System.Net.Configuration/AuthenticationModuleElementCollection.cs index bd297954381..f866b2ce186 100644 --- a/mcs/class/System/System.Net.Configuration/AuthenticationModuleElementCollection.cs +++ b/mcs/class/System/System.Net.Configuration/AuthenticationModuleElementCollection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/AuthenticationModulesSection.cs b/mcs/class/System/System.Net.Configuration/AuthenticationModulesSection.cs index aded4ba0dbb..470aa20854a 100644 --- a/mcs/class/System/System.Net.Configuration/AuthenticationModulesSection.cs +++ b/mcs/class/System/System.Net.Configuration/AuthenticationModulesSection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/BypassElement.cs b/mcs/class/System/System.Net.Configuration/BypassElement.cs index 2f85be74428..863a5c841e9 100644 --- a/mcs/class/System/System.Net.Configuration/BypassElement.cs +++ b/mcs/class/System/System.Net.Configuration/BypassElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/BypassElementCollection.cs b/mcs/class/System/System.Net.Configuration/BypassElementCollection.cs index 48529a027d9..abc44a2c648 100644 --- a/mcs/class/System/System.Net.Configuration/BypassElementCollection.cs +++ b/mcs/class/System/System.Net.Configuration/BypassElementCollection.cs @@ -29,7 +29,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/ConnectionManagementElement.cs b/mcs/class/System/System.Net.Configuration/ConnectionManagementElement.cs index ed56fc9937a..e44639948bd 100644 --- a/mcs/class/System/System.Net.Configuration/ConnectionManagementElement.cs +++ b/mcs/class/System/System.Net.Configuration/ConnectionManagementElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/ConnectionManagementElementCollection.cs b/mcs/class/System/System.Net.Configuration/ConnectionManagementElementCollection.cs index b4b770534b1..66c34c1b169 100644 --- a/mcs/class/System/System.Net.Configuration/ConnectionManagementElementCollection.cs +++ b/mcs/class/System/System.Net.Configuration/ConnectionManagementElementCollection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/ConnectionManagementSection.cs b/mcs/class/System/System.Net.Configuration/ConnectionManagementSection.cs index 3f27c51dfed..ce55e953d1e 100644 --- a/mcs/class/System/System.Net.Configuration/ConnectionManagementSection.cs +++ b/mcs/class/System/System.Net.Configuration/ConnectionManagementSection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/DefaultProxySection.cs b/mcs/class/System/System.Net.Configuration/DefaultProxySection.cs index 482841bf0dc..84e50a619d6 100644 --- a/mcs/class/System/System.Net.Configuration/DefaultProxySection.cs +++ b/mcs/class/System/System.Net.Configuration/DefaultProxySection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/FtpCachePolicyElement.cs b/mcs/class/System/System.Net.Configuration/FtpCachePolicyElement.cs index 7545f9e45bb..28bd2d77003 100644 --- a/mcs/class/System/System.Net.Configuration/FtpCachePolicyElement.cs +++ b/mcs/class/System/System.Net.Configuration/FtpCachePolicyElement.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/HttpCachePolicyElement.cs b/mcs/class/System/System.Net.Configuration/HttpCachePolicyElement.cs index 9b54691e620..4098a8ae39f 100644 --- a/mcs/class/System/System.Net.Configuration/HttpCachePolicyElement.cs +++ b/mcs/class/System/System.Net.Configuration/HttpCachePolicyElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs b/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs index 4aab3bce82a..9d7a6a3c269 100644 --- a/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs +++ b/mcs/class/System/System.Net.Configuration/HttpWebRequestElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/Ipv6Element.cs b/mcs/class/System/System.Net.Configuration/Ipv6Element.cs index cccfad5e5c2..7ad1a01340b 100644 --- a/mcs/class/System/System.Net.Configuration/Ipv6Element.cs +++ b/mcs/class/System/System.Net.Configuration/Ipv6Element.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/MailSettingsSectionGroup.cs b/mcs/class/System/System.Net.Configuration/MailSettingsSectionGroup.cs index 1c540e9e2c7..6c92731a04c 100644 --- a/mcs/class/System/System.Net.Configuration/MailSettingsSectionGroup.cs +++ b/mcs/class/System/System.Net.Configuration/MailSettingsSectionGroup.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/ModuleElement.cs b/mcs/class/System/System.Net.Configuration/ModuleElement.cs index 9e9cc671d65..9dd64749ebc 100644 --- a/mcs/class/System/System.Net.Configuration/ModuleElement.cs +++ b/mcs/class/System/System.Net.Configuration/ModuleElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/NetSectionGroup.cs b/mcs/class/System/System.Net.Configuration/NetSectionGroup.cs index 29df6210474..b54caf0c9d5 100644 --- a/mcs/class/System/System.Net.Configuration/NetSectionGroup.cs +++ b/mcs/class/System/System.Net.Configuration/NetSectionGroup.cs @@ -29,7 +29,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/PerformanceCountersElement.cs b/mcs/class/System/System.Net.Configuration/PerformanceCountersElement.cs index e5ca4be24bd..5d2a9ac54da 100644 --- a/mcs/class/System/System.Net.Configuration/PerformanceCountersElement.cs +++ b/mcs/class/System/System.Net.Configuration/PerformanceCountersElement.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/ProxyElement.cs b/mcs/class/System/System.Net.Configuration/ProxyElement.cs index 0a336cedd4e..bce70c4277c 100644 --- a/mcs/class/System/System.Net.Configuration/ProxyElement.cs +++ b/mcs/class/System/System.Net.Configuration/ProxyElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/RequestCachingSection.cs b/mcs/class/System/System.Net.Configuration/RequestCachingSection.cs index f0aaf312fb9..f4745ade002 100644 --- a/mcs/class/System/System.Net.Configuration/RequestCachingSection.cs +++ b/mcs/class/System/System.Net.Configuration/RequestCachingSection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/ServicePointManagerElement.cs b/mcs/class/System/System.Net.Configuration/ServicePointManagerElement.cs index ff932efd6e8..e8f8c7727b2 100644 --- a/mcs/class/System/System.Net.Configuration/ServicePointManagerElement.cs +++ b/mcs/class/System/System.Net.Configuration/ServicePointManagerElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/SettingsSection.cs b/mcs/class/System/System.Net.Configuration/SettingsSection.cs index ad733c27528..1ab26c59651 100644 --- a/mcs/class/System/System.Net.Configuration/SettingsSection.cs +++ b/mcs/class/System/System.Net.Configuration/SettingsSection.cs @@ -29,7 +29,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/SmtpNetworkElement.cs b/mcs/class/System/System.Net.Configuration/SmtpNetworkElement.cs index 777ebd8c3eb..20897267f6c 100644 --- a/mcs/class/System/System.Net.Configuration/SmtpNetworkElement.cs +++ b/mcs/class/System/System.Net.Configuration/SmtpNetworkElement.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/SmtpSection.cs b/mcs/class/System/System.Net.Configuration/SmtpSection.cs index d13dd0d6d15..9d5f74bd0c1 100644 --- a/mcs/class/System/System.Net.Configuration/SmtpSection.cs +++ b/mcs/class/System/System.Net.Configuration/SmtpSection.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/SmtpSpecifiedPickupDirectoryElement.cs b/mcs/class/System/System.Net.Configuration/SmtpSpecifiedPickupDirectoryElement.cs index 18bb7397cfa..90b19cee8aa 100644 --- a/mcs/class/System/System.Net.Configuration/SmtpSpecifiedPickupDirectoryElement.cs +++ b/mcs/class/System/System.Net.Configuration/SmtpSpecifiedPickupDirectoryElement.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/SocketElement.cs b/mcs/class/System/System.Net.Configuration/SocketElement.cs index 7127e6eec6b..62974bf932e 100644 --- a/mcs/class/System/System.Net.Configuration/SocketElement.cs +++ b/mcs/class/System/System.Net.Configuration/SocketElement.cs @@ -29,7 +29,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/WebProxyScriptElement.cs b/mcs/class/System/System.Net.Configuration/WebProxyScriptElement.cs index 5c84421a7fa..98946ae10c6 100644 --- a/mcs/class/System/System.Net.Configuration/WebProxyScriptElement.cs +++ b/mcs/class/System/System.Net.Configuration/WebProxyScriptElement.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/WebRequestModuleElement.cs b/mcs/class/System/System.Net.Configuration/WebRequestModuleElement.cs index 3622080dbe6..95acd06dac8 100644 --- a/mcs/class/System/System.Net.Configuration/WebRequestModuleElement.cs +++ b/mcs/class/System/System.Net.Configuration/WebRequestModuleElement.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System; using System.ComponentModel; diff --git a/mcs/class/System/System.Net.Configuration/WebRequestModuleElementCollection.cs b/mcs/class/System/System.Net.Configuration/WebRequestModuleElementCollection.cs index ca4472efeac..579dec3bc2a 100644 --- a/mcs/class/System/System.Net.Configuration/WebRequestModuleElementCollection.cs +++ b/mcs/class/System/System.Net.Configuration/WebRequestModuleElementCollection.cs @@ -30,7 +30,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Configuration/WebRequestModulesSection.cs b/mcs/class/System/System.Net.Configuration/WebRequestModulesSection.cs index c990cb2b559..c2ea938e8d7 100644 --- a/mcs/class/System/System.Net.Configuration/WebRequestModulesSection.cs +++ b/mcs/class/System/System.Net.Configuration/WebRequestModulesSection.cs @@ -29,7 +29,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP using System.Configuration; diff --git a/mcs/class/System/System.Net.Mail/AlternateView.cs b/mcs/class/System/System.Net.Mail/AlternateView.cs index 8d178b6f6cc..2a84e67de36 100644 --- a/mcs/class/System/System.Net.Mail/AlternateView.cs +++ b/mcs/class/System/System.Net.Mail/AlternateView.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.IO; using System.Net.Mime; using System.Text; @@ -139,5 +137,3 @@ namespace System.Net.Mail { #endregion // Methods } } - -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/AlternateViewCollection.cs b/mcs/class/System/System.Net.Mail/AlternateViewCollection.cs index 08bddd22218..d14fd3cce87 100644 --- a/mcs/class/System/System.Net.Mail/AlternateViewCollection.cs +++ b/mcs/class/System/System.Net.Mail/AlternateViewCollection.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Collections.ObjectModel; using System.Net.Mime; @@ -82,4 +80,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/Attachment.cs b/mcs/class/System/System.Net.Mail/Attachment.cs index 2ce8c91ca76..213c93c07f5 100644 --- a/mcs/class/System/System.Net.Mail/Attachment.cs +++ b/mcs/class/System/System.Net.Mail/Attachment.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.IO; using System.Net.Mime; using System.Text; @@ -156,4 +154,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/AttachmentBase.cs b/mcs/class/System/System.Net.Mail/AttachmentBase.cs index 82586b8dad8..fae3f7c9add 100644 --- a/mcs/class/System/System.Net.Mail/AttachmentBase.cs +++ b/mcs/class/System/System.Net.Mail/AttachmentBase.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.IO; using System.Net.Mime; using System.Text; @@ -146,12 +144,7 @@ namespace System.Net.Mail { static Hashtable mimeTypes; static MimeTypes () { -#if NET_2_0 mimeTypes = new Hashtable (StringComparer.InvariantCultureIgnoreCase); -#else - mimeTypes = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant, - CaseInsensitiveComparer.DefaultInvariant); -#endif mimeTypes.Add ("3dm", "x-world/x-3dmf"); mimeTypes.Add ("3dmf", "x-world/x-3dmf"); @@ -603,4 +596,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/AttachmentCollection.cs b/mcs/class/System/System.Net.Mail/AttachmentCollection.cs index 24e11430ada..b01209dc839 100644 --- a/mcs/class/System/System.Net.Mail/AttachmentCollection.cs +++ b/mcs/class/System/System.Net.Mail/AttachmentCollection.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections.ObjectModel; using System.Collections.Generic; @@ -69,4 +67,3 @@ namespace System.Net.Mail { } } -#endif diff --git a/mcs/class/System/System.Net.Mail/DeliveryNotificationOptions.cs b/mcs/class/System/System.Net.Mail/DeliveryNotificationOptions.cs index dfdd7fe7fe6..34fb246765a 100644 --- a/mcs/class/System/System.Net.Mail/DeliveryNotificationOptions.cs +++ b/mcs/class/System/System.Net.Mail/DeliveryNotificationOptions.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Net.Mail { @@ -45,4 +43,3 @@ namespace System.Net.Mail { } } -#endif diff --git a/mcs/class/System/System.Net.Mail/LinkedResource.cs b/mcs/class/System/System.Net.Mail/LinkedResource.cs index 6b444452ec5..85d3f6129ef 100644 --- a/mcs/class/System/System.Net.Mail/LinkedResource.cs +++ b/mcs/class/System/System.Net.Mail/LinkedResource.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.IO; using System.Net.Mime; @@ -128,4 +127,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/LinkedResourceCollection.cs b/mcs/class/System/System.Net.Mail/LinkedResourceCollection.cs index d44696008e2..0bd952ae913 100644 --- a/mcs/class/System/System.Net.Mail/LinkedResourceCollection.cs +++ b/mcs/class/System/System.Net.Mail/LinkedResourceCollection.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Collections.ObjectModel; using System.Net.Mime; @@ -88,4 +86,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/MailAddress.cs b/mcs/class/System/System.Net.Mail/MailAddress.cs index 695b53efdc2..5ffaf6b4bd1 100644 --- a/mcs/class/System/System.Net.Mail/MailAddress.cs +++ b/mcs/class/System/System.Net.Mail/MailAddress.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Text; namespace System.Net.Mail { @@ -180,4 +178,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/MailAddressCollection.cs b/mcs/class/System/System.Net.Mail/MailAddressCollection.cs index 6bb97243105..71e950d0895 100644 --- a/mcs/class/System/System.Net.Mail/MailAddressCollection.cs +++ b/mcs/class/System/System.Net.Mail/MailAddressCollection.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections.ObjectModel; using System.Text; @@ -74,4 +72,3 @@ namespace System.Net.Mail { } } -#endif diff --git a/mcs/class/System/System.Net.Mail/MailMessage.cs b/mcs/class/System/System.Net.Mail/MailMessage.cs index 98d3244e330..45720eb92a8 100644 --- a/mcs/class/System/System.Net.Mail/MailMessage.cs +++ b/mcs/class/System/System.Net.Mail/MailMessage.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Collections.Specialized; using System.Globalization; using System.Net.Mime; @@ -263,4 +261,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/MailPriority.cs b/mcs/class/System/System.Net.Mail/MailPriority.cs index d71c5ea3897..02853bb3d83 100644 --- a/mcs/class/System/System.Net.Mail/MailPriority.cs +++ b/mcs/class/System/System.Net.Mail/MailPriority.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mail { public enum MailPriority @@ -41,4 +39,3 @@ namespace System.Net.Mail { } -#endif diff --git a/mcs/class/System/System.Net.Mail/SendCompletedEventHandler.cs b/mcs/class/System/System.Net.Mail/SendCompletedEventHandler.cs index 76c905d60c0..94b5635f60e 100644 --- a/mcs/class/System/System.Net.Mail/SendCompletedEventHandler.cs +++ b/mcs/class/System/System.Net.Mail/SendCompletedEventHandler.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; namespace System.Net.Mail @@ -37,4 +35,3 @@ namespace System.Net.Mail public delegate void SendCompletedEventHandler (object sender, AsyncCompletedEventArgs e); } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/SmtpAccess.cs b/mcs/class/System/System.Net.Mail/SmtpAccess.cs index 43a40be6d73..ddfd1768c09 100644 --- a/mcs/class/System/System.Net.Mail/SmtpAccess.cs +++ b/mcs/class/System/System.Net.Mail/SmtpAccess.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mail { public enum SmtpAccess { @@ -39,4 +37,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/SmtpClient.cs b/mcs/class/System/System.Net.Mail/SmtpClient.cs index 46a812df323..d9c06733acd 100644 --- a/mcs/class/System/System.Net.Mail/SmtpClient.cs +++ b/mcs/class/System/System.Net.Mail/SmtpClient.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - #if SECURITY_DEP extern alias PrebuiltSystem; #endif @@ -1298,4 +1296,3 @@ try { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/SmtpDeliveryMethod.cs b/mcs/class/System/System.Net.Mail/SmtpDeliveryMethod.cs index 4a42cdbe5e3..776752a5885 100644 --- a/mcs/class/System/System.Net.Mail/SmtpDeliveryMethod.cs +++ b/mcs/class/System/System.Net.Mail/SmtpDeliveryMethod.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mail { public enum SmtpDeliveryMethod @@ -41,4 +39,3 @@ namespace System.Net.Mail { } -#endif diff --git a/mcs/class/System/System.Net.Mail/SmtpException.cs b/mcs/class/System/System.Net.Mail/SmtpException.cs index b0d2924d320..4c76fd9bb9d 100644 --- a/mcs/class/System/System.Net.Mail/SmtpException.cs +++ b/mcs/class/System/System.Net.Mail/SmtpException.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.Serialization; namespace System.Net.Mail { @@ -109,4 +107,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs b/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs index 06189b4cde7..5d8c462364b 100644 --- a/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs +++ b/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Collections; using System.Runtime.Serialization; @@ -111,4 +109,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs b/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs index bd75f233e88..dcfab22b6d4 100644 --- a/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs +++ b/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Collections; using System.Runtime.Serialization; @@ -101,4 +99,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mail/SmtpPermission.cs b/mcs/class/System/System.Net.Mail/SmtpPermission.cs index 49f2f671210..79ceb4b84fa 100644 --- a/mcs/class/System/System.Net.Mail/SmtpPermission.cs +++ b/mcs/class/System/System.Net.Mail/SmtpPermission.cs @@ -26,8 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - + using System.Security; using System.Security.Permissions; @@ -186,4 +185,3 @@ namespace System.Net.Mail { } } -#endif diff --git a/mcs/class/System/System.Net.Mail/SmtpPermissionAttribute.cs b/mcs/class/System/System.Net.Mail/SmtpPermissionAttribute.cs index 747e6f14939..db68f63c6c2 100644 --- a/mcs/class/System/System.Net.Mail/SmtpPermissionAttribute.cs +++ b/mcs/class/System/System.Net.Mail/SmtpPermissionAttribute.cs @@ -26,8 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - + using System.Security; using System.Security.Permissions; @@ -81,4 +80,3 @@ namespace System.Net.Mail { } } -#endif diff --git a/mcs/class/System/System.Net.Mail/SmtpStatusCode.cs b/mcs/class/System/System.Net.Mail/SmtpStatusCode.cs index fc048d3069e..c8916ee913c 100644 --- a/mcs/class/System/System.Net.Mail/SmtpStatusCode.cs +++ b/mcs/class/System/System.Net.Mail/SmtpStatusCode.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mail { public enum SmtpStatusCode { @@ -61,4 +59,3 @@ namespace System.Net.Mail { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mime/ContentDisposition.cs b/mcs/class/System/System.Net.Mime/ContentDisposition.cs index c44f142f483..b6e3844597b 100644 --- a/mcs/class/System/System.Net.Mime/ContentDisposition.cs +++ b/mcs/class/System/System.Net.Mime/ContentDisposition.cs @@ -30,8 +30,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Text; using System.Collections; using System.Collections.Specialized; @@ -253,4 +251,3 @@ namespace System.Net.Mime { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mime/ContentType.cs b/mcs/class/System/System.Net.Mime/ContentType.cs index 25a91d9af32..9a7b9ca9f8a 100644 --- a/mcs/class/System/System.Net.Mime/ContentType.cs +++ b/mcs/class/System/System.Net.Mime/ContentType.cs @@ -30,8 +30,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Collections; using System.Collections.Specialized; using System.Text; @@ -235,4 +233,3 @@ namespace System.Net.Mime { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mime/DispositionTypeNames.cs b/mcs/class/System/System.Net.Mime/DispositionTypeNames.cs index 074f0d413f9..86abcb73b1f 100644 --- a/mcs/class/System/System.Net.Mime/DispositionTypeNames.cs +++ b/mcs/class/System/System.Net.Mime/DispositionTypeNames.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mime { public static class DispositionTypeNames { @@ -38,4 +36,3 @@ namespace System.Net.Mime { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mime/MediaTypeNames.cs b/mcs/class/System/System.Net.Mime/MediaTypeNames.cs index bdb1c497bf9..6b2d5511b61 100644 --- a/mcs/class/System/System.Net.Mime/MediaTypeNames.cs +++ b/mcs/class/System/System.Net.Mime/MediaTypeNames.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mime { public static class MediaTypeNames { @@ -56,5 +54,3 @@ namespace System.Net.Mime { } } } - -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.Mime/TransferEncoding.cs b/mcs/class/System/System.Net.Mime/TransferEncoding.cs index dc98f3614f8..abe9becd3ec 100644 --- a/mcs/class/System/System.Net.Mime/TransferEncoding.cs +++ b/mcs/class/System/System.Net.Mime/TransferEncoding.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Mime { public enum TransferEncoding { @@ -40,4 +38,3 @@ namespace System.Net.Mime { } } -#endif // NET_2_0 diff --git a/mcs/class/System/System.Net.NetworkInformation/DuplicateAddressDetectionState.cs b/mcs/class/System/System.Net.NetworkInformation/DuplicateAddressDetectionState.cs index 3562a906f57..5625522a21d 100644 --- a/mcs/class/System/System.Net.NetworkInformation/DuplicateAddressDetectionState.cs +++ b/mcs/class/System/System.Net.NetworkInformation/DuplicateAddressDetectionState.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public enum DuplicateAddressDetectionState { Invalid, @@ -35,5 +34,4 @@ namespace System.Net.NetworkInformation { Preferred } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformation.cs b/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformation.cs index d5dcb00d872..ea761a3fc41 100644 --- a/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformation.cs +++ b/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformation.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public abstract class GatewayIPAddressInformation { protected GatewayIPAddressInformation () @@ -50,5 +49,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs b/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs index e4bd8bb3d9d..058c337c4af 100644 --- a/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs +++ b/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -152,5 +151,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IPAddressCollection.cs b/mcs/class/System/System.Net.NetworkInformation/IPAddressCollection.cs index 509a54fb1c6..69b05505403 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPAddressCollection.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPAddressCollection.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.Collections.Generic; @@ -170,5 +169,5 @@ namespace System.Net.NetworkInformation { } } } -#endif + diff --git a/mcs/class/System/System.Net.NetworkInformation/IPAddressInformation.cs b/mcs/class/System/System.Net.NetworkInformation/IPAddressInformation.cs index a07a737ec4c..092ba2e2244 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPAddressInformation.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPAddressInformation.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Net.NetworkInformation { @@ -66,5 +65,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IPAddressInformationCollection.cs b/mcs/class/System/System.Net.NetworkInformation/IPAddressInformationCollection.cs index 0eac24f36e3..40f5f70fef8 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPAddressInformationCollection.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPAddressInformationCollection.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.Collections.Generic; @@ -136,5 +135,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IPGlobalStatistics.cs b/mcs/class/System/System.Net.NetworkInformation/IPGlobalStatistics.cs index 1745dd4b7b3..7a017ef80a8 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPGlobalStatistics.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPGlobalStatistics.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Specialized; using System.Globalization; using System.Runtime.InteropServices; @@ -248,5 +247,4 @@ namespace System.Net.NetworkInformation { public int NumRoutes; } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs b/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs index d0173192908..fec490398a2 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Generic; using System.Globalization; using System.IO; @@ -373,5 +372,5 @@ namespace System.Net.NetworkInformation { } } -#endif + diff --git a/mcs/class/System/System.Net.NetworkInformation/IPStatus.cs b/mcs/class/System/System.Net.NetworkInformation/IPStatus.cs index 6dae95a78e4..0d21b3b071e 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPStatus.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPStatus.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public enum IPStatus { Unknown = -1, @@ -54,5 +53,5 @@ namespace System.Net.NetworkInformation { DestinationScopeMismatch = 11045 } } -#endif + diff --git a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs index 21356e88c3f..990f7ff792c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.IO; using System.Runtime.InteropServices; @@ -200,5 +199,4 @@ namespace System.Net.NetworkInformation { public Win32_IP_ADDR_STRING DnsServerList; } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs index 79b9e37ff1a..2ddb462c31c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public abstract class IPv4InterfaceStatistics { protected IPv4InterfaceStatistics () @@ -263,5 +262,4 @@ namespace System.Net.NetworkInformation { } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IPv6InterfaceProperties.cs b/mcs/class/System/System.Net.NetworkInformation/IPv6InterfaceProperties.cs index 7acbbdca4c3..e81df59229c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IPv6InterfaceProperties.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IPv6InterfaceProperties.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public abstract class IPv6InterfaceProperties { protected IPv6InterfaceProperties () @@ -55,5 +54,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IcmpV4Statistics.cs b/mcs/class/System/System.Net.NetworkInformation/IcmpV4Statistics.cs index 9a1f3595fc7..bb7fab0b66c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IcmpV4Statistics.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IcmpV4Statistics.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Specialized; using System.Globalization; @@ -271,5 +270,4 @@ namespace System.Net.NetworkInformation { public uint AddrMaskReps; } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/IcmpV6Statistics.cs b/mcs/class/System/System.Net.NetworkInformation/IcmpV6Statistics.cs index 49bb30ef86f..7683ebd33e9 100644 --- a/mcs/class/System/System.Net.NetworkInformation/IcmpV6Statistics.cs +++ b/mcs/class/System/System.Net.NetworkInformation/IcmpV6Statistics.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Specialized; using System.Globalization; using System.Runtime.InteropServices; @@ -324,5 +323,4 @@ namespace System.Net.NetworkInformation { public uint [] Counts; } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs b/mcs/class/System/System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs index ace0845bb7d..249a55b0f4c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs +++ b/mcs/class/System/System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Runtime.InteropServices; @@ -104,5 +103,4 @@ namespace System.Net.NetworkInformation { TUNNEL6 = 769 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs b/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs index 52edf9c1eec..77c7a908813 100644 --- a/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs +++ b/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs @@ -1,4 +1,3 @@ -#if NET_2_0 using System; using System.Runtime.InteropServices; @@ -70,4 +69,3 @@ namespace System.Net.NetworkInformation { FDDI = 0xf } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformation.cs b/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformation.cs index 6869ca85f99..92db97265b5 100644 --- a/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformation.cs +++ b/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformation.cs @@ -26,7 +26,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + using System.Runtime.InteropServices; namespace System.Net.NetworkInformation { @@ -94,5 +94,3 @@ namespace System.Net.NetworkInformation { } } -#endif - diff --git a/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs b/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs index 3e2bc61b6a1..db9ccd81d5f 100644 --- a/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs +++ b/mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs @@ -27,7 +27,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -139,5 +139,3 @@ namespace System.Net.NetworkInformation { } } } -#endif - diff --git a/mcs/class/System/System.Net.NetworkInformation/NetBiosNodeType.cs b/mcs/class/System/System.Net.NetworkInformation/NetBiosNodeType.cs index 61585e05df1..00e3fb26376 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetBiosNodeType.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetBiosNodeType.cs @@ -25,7 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + namespace System.Net.NetworkInformation { public enum NetBiosNodeType { Unknown = 0, @@ -35,5 +35,4 @@ namespace System.Net.NetworkInformation { Hybrid = 1 << 3, } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkAddressChangedEventHandler.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkAddressChangedEventHandler.cs index ad92e5a1492..5c90f9a71e6 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkAddressChangedEventHandler.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkAddressChangedEventHandler.cs @@ -25,9 +25,8 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + namespace System.Net.NetworkInformation { public delegate void NetworkAddressChangedEventHandler (object sender, EventArgs e); } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityChangedEventHandler.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityChangedEventHandler.cs index c3609e4e4ad..df580bb2589 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityChangedEventHandler.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityChangedEventHandler.cs @@ -25,9 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 + namespace System.Net.NetworkInformation { public delegate void NetworkAvailabilityChangedEventHandler (object sender, NetworkAvailabilityEventArgs e); } -#endif - diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityEventArgs.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityEventArgs.cs index b881dfbda6c..af78934957c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityEventArgs.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkAvailabilityEventArgs.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Net.NetworkInformation { @@ -42,5 +41,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationAccess.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationAccess.cs index 13c11633c41..b51aa38bc8e 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationAccess.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationAccess.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Net.NetworkInformation { [Flags] @@ -35,5 +34,4 @@ namespace System.Net.NetworkInformation { Ping = 4 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationException.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationException.cs index d60303cb926..0770801732c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationException.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationException.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.ComponentModel; using System.Runtime.Serialization; @@ -72,5 +71,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermission.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermission.cs index 50a797b3eb7..2ffeb882cce 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermission.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermission.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Security; using System.Security.Permissions; @@ -101,5 +100,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.cs index eda9167f735..6b37c4fdf96 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Security; using System.Security.Permissions; @@ -72,5 +71,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs index 9ff82f5ca6a..5a60a9e1a2c 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs @@ -29,7 +29,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections.Generic; using System.Collections; @@ -711,5 +710,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceComponent.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceComponent.cs index 9eafe650657..daf09e4bd50 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceComponent.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceComponent.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Net.NetworkInformation { public enum NetworkInterfaceComponent { @@ -33,5 +32,4 @@ namespace System.Net.NetworkInformation { IPv6 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceType.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceType.cs index 002c21a8f08..76580917cb4 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceType.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInterfaceType.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Net.NetworkInformation { public enum NetworkInterfaceType { @@ -56,5 +55,4 @@ namespace System.Net.NetworkInformation { HighPerformanceSerialBus = 144 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/OperationalStatus.cs b/mcs/class/System/System.Net.NetworkInformation/OperationalStatus.cs index abc0c667938..1050f984279 100644 --- a/mcs/class/System/System.Net.NetworkInformation/OperationalStatus.cs +++ b/mcs/class/System/System.Net.NetworkInformation/OperationalStatus.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public enum OperationalStatus { Up = 1, @@ -37,5 +36,4 @@ namespace System.Net.NetworkInformation { LowerLayerDown = 7 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PhysicalAddress.cs b/mcs/class/System/System.Net.NetworkInformation/PhysicalAddress.cs index 20954db74d6..2c0c93366e7 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PhysicalAddress.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PhysicalAddress.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Text; using System.Globalization; @@ -147,4 +146,3 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/Ping.cs b/mcs/class/System/System.Net.NetworkInformation/Ping.cs index 9bc51071634..e7b65d0ae35 100644 --- a/mcs/class/System/System.Net.NetworkInformation/Ping.cs +++ b/mcs/class/System/System.Net.NetworkInformation/Ping.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.IO; using System.Text; @@ -37,6 +36,10 @@ using System.Net.Sockets; using System.Security.Principal; using System.Security.Cryptography; using System.Runtime.InteropServices; +#if NET_4_5 +using System.Threading; +using System.Threading.Tasks; +#endif namespace System.Net.NetworkInformation { [MonoTODO ("IPv6 support is missing")] @@ -77,6 +80,9 @@ namespace System.Net.NetworkInformation { BackgroundWorker worker; object user_async_state; +#if NET_4_5 + CancellationTokenSource cts; +#endif public event PingCompletedEventHandler PingCompleted; @@ -148,6 +154,9 @@ namespace System.Net.NetworkInformation { PingCompleted (this, e); user_async_state = null; worker = null; +#if NET_4_5 + cts = null; +#endif } // Sync @@ -361,8 +370,13 @@ namespace System.Net.NetworkInformation { public void SendAsync (IPAddress address, int timeout, byte [] buffer, PingOptions options, object userToken) { +#if NET_4_5 + if ((worker != null) || (cts != null)) + throw new InvalidOperationException ("Another SendAsync operation is in progress"); +#else if (worker != null) throw new InvalidOperationException ("Another SendAsync operation is in progress"); +#endif worker = new BackgroundWorker (); worker.DoWork += delegate (object o, DoWorkEventArgs ea) { @@ -385,6 +399,13 @@ namespace System.Net.NetworkInformation { public void SendAsyncCancel () { +#if NET_4_5 + if (cts != null) { + cts.Cancel (); + return; + } +#endif + if (worker == null) throw new InvalidOperationException ("SendAsync operation is not in progress"); worker.CancelAsync (); @@ -509,28 +530,78 @@ namespace System.Net.NetworkInformation { CultureInfo culture = CultureInfo.InvariantCulture; StringBuilder args = new StringBuilder (); uint t = Convert.ToUInt32 (Math.Floor ((timeout + 1000) / 1000.0)); -#if NET_2_0 bool is_mac = ((int) Environment.OSVersion.Platform == 6); if (!is_mac) -#endif args.AppendFormat (culture, "-q -n -c {0} -w {1} -t {2} -M ", DefaultCount, t, options.Ttl); -#if NET_2_0 else args.AppendFormat (culture, "-q -n -c {0} -t {1} -o -m {2} ", DefaultCount, t, options.Ttl); if (!is_mac) -#endif args.Append (options.DontFragment ? "do " : "dont "); -#if NET_2_0 else if (options.DontFragment) args.Append ("-D "); -#endif args.Append (address.ToString ()); return args.ToString (); } +#if NET_4_5 + public Task SendPingAsync (IPAddress address, int timeout, byte [] buffer) + { + return SendPingAsync (address, default_timeout, default_buffer, new PingOptions ()); + } + + public Task SendPingAsync (IPAddress address, int timeout) + { + return SendPingAsync (address, default_timeout, default_buffer); + } + + public Task SendPingAsync (IPAddress address) + { + return SendPingAsync (address, default_timeout); + } + + public Task SendPingAsync (string hostNameOrAddress, int timeout, byte [] buffer) + { + return SendPingAsync (hostNameOrAddress, timeout, buffer, new PingOptions ()); + } + + public Task SendPingAsync (string hostNameOrAddress, int timeout, byte [] buffer, PingOptions options) + { + IPAddress address = Dns.GetHostEntry (hostNameOrAddress).AddressList [0]; + return SendPingAsync (address, timeout, buffer, options); + } + + public Task SendPingAsync (string hostNameOrAddress, int timeout) + { + return SendPingAsync (hostNameOrAddress, timeout, default_buffer); + } + + public Task SendPingAsync (string hostNameOrAddress) + { + return SendPingAsync (hostNameOrAddress, default_timeout); + } + + public Task SendPingAsync (IPAddress address, int timeout, byte [] buffer, PingOptions options) + { + if ((worker != null) || (cts != null)) + throw new InvalidOperationException ("Another SendAsync operation is in progress"); + + var task = Task.Factory.StartNew ( + () => Send (address, timeout, buffer, options), cts.Token); + + task.ContinueWith ((t) => { + if (t.IsCanceled) + OnPingCompleted (new PingCompletedEventArgs (null, true, null, null)); + else if (t.IsFaulted) + OnPingCompleted (new PingCompletedEventArgs (t.Exception, false, null, null)); + else + OnPingCompleted (new PingCompletedEventArgs (null, false, null, t.Result)); + }); + + return task; + } +#endif } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventArgs.cs b/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventArgs.cs index 00bb7927c3a..6a359fa3ad5 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventArgs.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventArgs.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.ComponentModel; @@ -45,5 +44,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventHandler.cs b/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventHandler.cs index 4911ac27743..aba0df562a7 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventHandler.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PingCompletedEventHandler.cs @@ -25,9 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public delegate void PingCompletedEventHandler (object sender, PingCompletedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PingException.cs b/mcs/class/System/System.Net.NetworkInformation/PingException.cs index 65c5f7460a1..6a1081705e0 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PingException.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PingException.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.Runtime.Serialization; @@ -50,5 +49,4 @@ namespace System.Net.NetworkInformation { } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PingOptions.cs b/mcs/class/System/System.Net.NetworkInformation/PingOptions.cs index 6b6b37e0a71..f1dbecdde42 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PingOptions.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PingOptions.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public class PingOptions { int ttl = 128; @@ -54,5 +53,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PingReply.cs b/mcs/class/System/System.Net.NetworkInformation/PingReply.cs index e4be68d03d5..ecdd001c008 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PingReply.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PingReply.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public class PingReply { IPAddress address; @@ -65,5 +64,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/PrefixOrigin.cs b/mcs/class/System/System.Net.NetworkInformation/PrefixOrigin.cs index 8a470a96176..f61cf42ddd1 100644 --- a/mcs/class/System/System.Net.NetworkInformation/PrefixOrigin.cs +++ b/mcs/class/System/System.Net.NetworkInformation/PrefixOrigin.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public enum PrefixOrigin { Other = 0, @@ -35,5 +34,4 @@ namespace System.Net.NetworkInformation { RouterAdvertisement = 4 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/SuffixOrigin.cs b/mcs/class/System/System.Net.NetworkInformation/SuffixOrigin.cs index a0c30cbcf07..44d44f29148 100644 --- a/mcs/class/System/System.Net.NetworkInformation/SuffixOrigin.cs +++ b/mcs/class/System/System.Net.NetworkInformation/SuffixOrigin.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public enum SuffixOrigin { Other = 0, @@ -36,5 +35,4 @@ namespace System.Net.NetworkInformation { Random = 5 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/TcpConnectionInformation.cs b/mcs/class/System/System.Net.NetworkInformation/TcpConnectionInformation.cs index 48ef22ff162..f2aa8622486 100644 --- a/mcs/class/System/System.Net.NetworkInformation/TcpConnectionInformation.cs +++ b/mcs/class/System/System.Net.NetworkInformation/TcpConnectionInformation.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Net; namespace System.Net.NetworkInformation { @@ -64,5 +63,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/TcpState.cs b/mcs/class/System/System.Net.NetworkInformation/TcpState.cs index b4b1113c0b2..75c097b43a7 100644 --- a/mcs/class/System/System.Net.NetworkInformation/TcpState.cs +++ b/mcs/class/System/System.Net.NetworkInformation/TcpState.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.NetworkInformation { public enum TcpState { Unknown = 0, @@ -43,5 +42,4 @@ namespace System.Net.NetworkInformation { DeleteTcb = 12 } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/TcpStatistics.cs b/mcs/class/System/System.Net.NetworkInformation/TcpStatistics.cs index 961a58548a9..a7b46e35d6b 100644 --- a/mcs/class/System/System.Net.NetworkInformation/TcpStatistics.cs +++ b/mcs/class/System/System.Net.NetworkInformation/TcpStatistics.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Specialized; using System.Globalization; @@ -196,5 +195,4 @@ namespace System.Net.NetworkInformation { } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/UdpStatistics.cs b/mcs/class/System/System.Net.NetworkInformation/UdpStatistics.cs index 3f29c810540..6126b93d799 100644 --- a/mcs/class/System/System.Net.NetworkInformation/UdpStatistics.cs +++ b/mcs/class/System/System.Net.NetworkInformation/UdpStatistics.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections.Specialized; using System.Globalization; @@ -113,5 +112,4 @@ namespace System.Net.NetworkInformation { public int NumAddrs; } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs b/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs index b7ddace2d64..571bbad7f17 100644 --- a/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs +++ b/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Runtime.InteropServices; @@ -176,5 +175,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs b/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs index 9ac36cb2079..3905225f934 100644 --- a/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs +++ b/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections; using System.Collections.Generic; @@ -135,5 +134,4 @@ namespace System.Net.NetworkInformation { } } } -#endif diff --git a/mcs/class/System/System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs b/mcs/class/System/System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs index a987cdb341e..afcd4c36e02 100644 --- a/mcs/class/System/System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs +++ b/mcs/class/System/System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections.Generic; using System.Net; @@ -315,5 +314,4 @@ namespace System.Net.NetworkInformation const int AF_INET6 = 23; } } -#endif diff --git a/mcs/class/System/System.Net.Security/AuthenticatedStream.cs b/mcs/class/System/System.Net.Security/AuthenticatedStream.cs index 9f113e4f966..6e0481d55c4 100644 --- a/mcs/class/System/System.Net.Security/AuthenticatedStream.cs +++ b/mcs/class/System/System.Net.Security/AuthenticatedStream.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.IO; @@ -89,4 +88,3 @@ namespace System.Net.Security } } -#endif diff --git a/mcs/class/System/System.Net.Security/AuthenticationLevel.cs b/mcs/class/System/System.Net.Security/AuthenticationLevel.cs index 7cc2fb22e80..39c77183f0f 100644 --- a/mcs/class/System/System.Net.Security/AuthenticationLevel.cs +++ b/mcs/class/System/System.Net.Security/AuthenticationLevel.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.Security { @@ -41,4 +40,3 @@ namespace System.Net.Security } } -#endif diff --git a/mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs b/mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs index dd3448675f0..7064652708b 100644 --- a/mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs +++ b/mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs @@ -29,7 +29,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP #if !MOONLIGHT extern alias PrebuiltSystem; @@ -48,5 +48,4 @@ namespace System.Net.Security X509Certificate remoteCertificate, string [] acceptableIssuers); } - #endif diff --git a/mcs/class/System/System.Net.Security/ProtectionLevel.cs b/mcs/class/System/System.Net.Security/ProtectionLevel.cs index 08c93007fc6..8483567e427 100644 --- a/mcs/class/System/System.Net.Security/ProtectionLevel.cs +++ b/mcs/class/System/System.Net.Security/ProtectionLevel.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Security { public enum ProtectionLevel @@ -41,4 +39,3 @@ namespace System.Net.Security } } -#endif diff --git a/mcs/class/System/System.Net.Security/SslPolicyErrors.cs b/mcs/class/System/System.Net.Security/SslPolicyErrors.cs index a80f446f842..aa0fbd39990 100644 --- a/mcs/class/System/System.Net.Security/SslPolicyErrors.cs +++ b/mcs/class/System/System.Net.Security/SslPolicyErrors.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net.Security { [Flags] @@ -39,5 +37,3 @@ namespace System.Net.Security RemoteCertificateChainErrors = 4, } } - -#endif diff --git a/mcs/class/System/System.Net.Security/SslStream.cs b/mcs/class/System/System.Net.Security/SslStream.cs index 235796b7c65..3c4d5fd7549 100644 --- a/mcs/class/System/System.Net.Security/SslStream.cs +++ b/mcs/class/System/System.Net.Security/SslStream.cs @@ -453,7 +453,7 @@ namespace System.Net.Security ssl_stream = s; - return BeginRead (new byte[0], 0, 0, asyncCallback, asyncState); + return BeginWrite (new byte[0], 0, 0, asyncCallback, asyncState); } #endif MonoSecurityProtocolType GetMonoSslProtocol (SslProtocols ms) diff --git a/mcs/class/System/System.Net.Sockets/IOControlCode.cs b/mcs/class/System/System.Net.Sockets/IOControlCode.cs index 6cd825be67b..26d8cb596c9 100644 --- a/mcs/class/System/System.Net.Sockets/IOControlCode.cs +++ b/mcs/class/System/System.Net.Sockets/IOControlCode.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net.Sockets { public enum IOControlCode: long @@ -69,4 +68,3 @@ namespace System.Net.Sockets UnicastInterface = 0x98000006, } } -#endif diff --git a/mcs/class/System/System.Net.Sockets/IPPacketInformation.cs b/mcs/class/System/System.Net.Sockets/IPPacketInformation.cs index e398eecf016..ba0bf83e6f2 100644 --- a/mcs/class/System/System.Net.Sockets/IPPacketInformation.cs +++ b/mcs/class/System/System.Net.Sockets/IPPacketInformation.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Net; @@ -95,4 +93,3 @@ namespace System.Net.Sockets } } -#endif diff --git a/mcs/class/System/System.Net.Sockets/IPv6MulticastOption.cs b/mcs/class/System/System.Net.Sockets/IPv6MulticastOption.cs index 9b3631bd4a9..3db9e6c5550 100644 --- a/mcs/class/System/System.Net.Sockets/IPv6MulticastOption.cs +++ b/mcs/class/System/System.Net.Sockets/IPv6MulticastOption.cs @@ -33,7 +33,6 @@ using System.Net; namespace System.Net.Sockets { -#if NET_1_1 // // Encapsulates a multicast option // @@ -80,5 +79,4 @@ namespace System.Net.Sockets } } } -#endif } diff --git a/mcs/class/System/System.Net.Sockets/MulticastOption.cs b/mcs/class/System/System.Net.Sockets/MulticastOption.cs index 68f2d76b95c..129aa51f07f 100644 --- a/mcs/class/System/System.Net.Sockets/MulticastOption.cs +++ b/mcs/class/System/System.Net.Sockets/MulticastOption.cs @@ -42,16 +42,13 @@ namespace System.Net.Sockets // changing socket-io.c in the runtime private IPAddress group; private IPAddress local; -#if NET_2_0 int iface_index; -#endif public MulticastOption (IPAddress group) : this (group, IPAddress.Any) { } -#if NET_2_0 public MulticastOption (IPAddress group, int interfaceIndex) { if (group == null) @@ -62,7 +59,6 @@ namespace System.Net.Sockets this.group = group; this.iface_index = interfaceIndex; } -#endif public MulticastOption (IPAddress group, IPAddress mcint) { @@ -84,13 +80,10 @@ namespace System.Net.Sockets get { return local; } set { local = value; -#if NET_2_0 iface_index = 0; -#endif } } -#if NET_2_0 public int InterfaceIndex { get { return iface_index; } set { @@ -100,7 +93,6 @@ namespace System.Net.Sockets local = null; } } -#endif } } diff --git a/mcs/class/System/System.Net.Sockets/NetworkStream.cs b/mcs/class/System/System.Net.Sockets/NetworkStream.cs index 77dbede88df..b51e5050ce7 100644 --- a/mcs/class/System/System.Net.Sockets/NetworkStream.cs +++ b/mcs/class/System/System.Net.Sockets/NetworkStream.cs @@ -32,7 +32,7 @@ using System.IO; using System.Runtime.InteropServices; -#if NET_2_0 && !NET_2_1 +#if !NET_2_1 using System.Timers; using System.Threading; #endif @@ -93,14 +93,12 @@ namespace System.Net.Sockets } } -#if NET_2_0 public override bool CanTimeout { get { return(true); } } -#endif public override bool CanWrite { get { @@ -144,7 +142,7 @@ namespace System.Net.Sockets } } -#if NET_2_0 && !NET_2_1 +#if !NET_2_1 #if TARGET_JVM [MonoNotSupported ("Not supported since Socket.ReceiveTimeout is not supported")] #endif @@ -180,7 +178,7 @@ namespace System.Net.Sockets } } -#if NET_2_0 && !NET_2_1 +#if !NET_2_1 #if TARGET_JVM [MonoNotSupported ("Not supported since Socket.SendTimeout is not supported")] #endif @@ -268,14 +266,8 @@ namespace System.Net.Sockets Dispose (false); } -#if !NET_2_0 - public override void Close () - { - ((IDisposable) this).Dispose (); - } -#endif -#if NET_2_0 && !NET_2_1 +#if !NET_2_1 public void Close (int timeout) { if (timeout < -1) { @@ -298,13 +290,7 @@ namespace System.Net.Sockets } #endif - protected -#if NET_2_0 - override -#else - virtual -#endif - void Dispose (bool disposing) + protected override void Dispose (bool disposing) { if (disposed) return; @@ -368,13 +354,6 @@ namespace System.Net.Sockets // network streams are non-buffered, this is a no-op } -#if !NET_2_0 - void IDisposable.Dispose () - { - Dispose (true); - } -#endif - public override int Read ([In,Out] byte [] buffer, int offset, int size) { CheckDisposed (); diff --git a/mcs/class/System/System.Net.Sockets/ProtocolType.cs b/mcs/class/System/System.Net.Sockets/ProtocolType.cs index 90a06d12024..b54e9be4800 100644 --- a/mcs/class/System/System.Net.Sockets/ProtocolType.cs +++ b/mcs/class/System/System.Net.Sockets/ProtocolType.cs @@ -70,11 +70,9 @@ namespace System.Net.Sockets { /// Idp = 22, -#if NET_1_1 /// /// IPv6 = 41, -#endif /// /// @@ -104,7 +102,6 @@ namespace System.Net.Sockets { /// Unknown = -1, -#if NET_2_0 IPv4 = 4, IPv6RoutingHeader = 43, IPv6FragmentHeader = 44, @@ -114,7 +111,6 @@ namespace System.Net.Sockets { IPv6NoNextHeader = 59, IPv6DestinationOptions = 60, IPv6HopByHopOptions = 0, -#endif } // ProtocolType } // System.Net.Sockets diff --git a/mcs/class/System/System.Net.Sockets/SendPacketsElement.cs b/mcs/class/System/System.Net.Sockets/SendPacketsElement.cs index aa515683606..983faa98047 100644 --- a/mcs/class/System/System.Net.Sockets/SendPacketsElement.cs +++ b/mcs/class/System/System.Net.Sockets/SendPacketsElement.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; namespace System.Net.Sockets @@ -88,4 +87,3 @@ namespace System.Net.Sockets } } } -#endif diff --git a/mcs/class/System/System.Net.Sockets/Socket.jvm.cs b/mcs/class/System/System.Net.Sockets/Socket.jvm.cs index c6eabc50aee..2e4eae7b7fe 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.jvm.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.jvm.cs @@ -918,7 +918,6 @@ namespace System.Net.Sockets } } -#if NET_1_1 public static bool SupportsIPv4 { get @@ -936,23 +935,6 @@ namespace System.Net.Sockets return ipv6Supported == 1; } } -#else - internal static bool SupportsIPv4 - { - get - { - return true; - } - } - - internal static bool SupportsIPv6 - { - get - { - return false; - } - } -#endif internal static void CheckProtocolSupport() { @@ -973,7 +955,7 @@ namespace System.Net.Sockets if(ipv6Supported == -1) { -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP SettingsSection config; config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings"); if (config != null) @@ -1428,13 +1410,11 @@ namespace System.Net.Sockets req.CheckIfThrowDelayedException(); } -#if NET_2_0 [MonoNotSupported ("")] public void EndDisconnect (IAsyncResult asyncResult) { throw new NotImplementedException (); } -#endif public int EndReceive(IAsyncResult result) { EnsureStillUsable(); @@ -1619,13 +1599,11 @@ namespace System.Net.Sockets return result; } -#if NET_2_0 [MonoNotSupported ("")] public int IOControl (IOControlCode ioControlCode, byte [] optionInValue, byte [] optionOutValue) { throw new NotImplementedException (); } -#endif #if !TARGET_JVM [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -1923,7 +1901,6 @@ namespace System.Net.Sockets return Send_nochecks (buf, 0, size, flags); } -#if NET_2_0 [MonoNotSupported ("")] public int Send (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode) { @@ -1992,7 +1969,6 @@ namespace System.Net.Sockets { throw new NotImplementedException (); } -#endif #if !TARGET_JVM [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -2215,14 +2191,10 @@ namespace System.Net.Sockets */ if (opt_value is System.Boolean) { -#if NET_2_0 bool bool_val = (bool) opt_value; int int_val = (bool_val) ? 1 : 0; SetSocketOption_internal (socket, level, name, null, null, int_val, out error); -#else - throw new ArgumentException ("Use an integer 1 (true) or 0 (false) instead of a boolean.", "opt_value"); -#endif } else { SetSocketOption_internal (socket, level, name, opt_value, null, 0, out error); } @@ -2231,7 +2203,6 @@ namespace System.Net.Sockets throw new SocketException (error); } -#if NET_2_0 public void SetSocketOption (SocketOptionLevel level, SocketOptionName name, bool optionValue) { EnsureStillUsable(); @@ -2241,7 +2212,7 @@ namespace System.Net.Sockets if (error != 0) throw new SocketException (error); } -#endif + #if !TARGET_JVM [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern static void Shutdown_internal(IntPtr socket, SocketShutdown how, out int error); @@ -2333,7 +2304,6 @@ namespace System.Net.Sockets #endif #region .Net 2.0 properties and methods -#if NET_2_0 #region Properties [MonoTODO] @@ -2600,7 +2570,6 @@ namespace System.Net.Sockets } #endregion //Methods -#endif #endregion void IDisposable.Dispose () diff --git a/mcs/class/System/System.Net.Sockets/SocketError.cs b/mcs/class/System/System.Net.Sockets/SocketError.cs index 1ca399122a4..2601bdb3503 100644 --- a/mcs/class/System/System.Net.Sockets/SocketError.cs +++ b/mcs/class/System/System.Net.Sockets/SocketError.cs @@ -30,12 +30,7 @@ namespace System.Net.Sockets { -#if NET_2_0 - public -#else - internal -#endif - enum SocketError + public enum SocketError { AccessDenied = 10013, AddressAlreadyInUse = 10048, diff --git a/mcs/class/System/System.Net.Sockets/SocketException.cs b/mcs/class/System/System.Net.Sockets/SocketException.cs index 859c190bed6..895c765e121 100644 --- a/mcs/class/System/System.Net.Sockets/SocketException.cs +++ b/mcs/class/System/System.Net.Sockets/SocketException.cs @@ -70,7 +70,6 @@ namespace System.Net.Sockets } } -#if NET_2_0 public SocketError SocketErrorCode { get { return (SocketError) NativeErrorCode; @@ -82,7 +81,5 @@ namespace System.Net.Sockets return base.Message; } } -#endif - } } diff --git a/mcs/class/System/System.Net.Sockets/SocketFlags.cs b/mcs/class/System/System.Net.Sockets/SocketFlags.cs index 2131eae4699..061a6d00d93 100644 --- a/mcs/class/System/System.Net.Sockets/SocketFlags.cs +++ b/mcs/class/System/System.Net.Sockets/SocketFlags.cs @@ -39,12 +39,10 @@ namespace System.Net.Sockets { Peek = 0x00000002, DontRoute = 0x00000004, MaxIOVectorLength = 0x00000010, -#if NET_2_0 Truncated = 0x00000100, ControlDataTruncated = 0x00000200, Broadcast = 0x00000400, Multicast = 0x00000800, -#endif Partial = 0x00008000, } // SocketFlags diff --git a/mcs/class/System/System.Net.Sockets/SocketInformation.cs b/mcs/class/System/System.Net.Sockets/SocketInformation.cs index 6c04c59d1a2..759d31ba162 100644 --- a/mcs/class/System/System.Net.Sockets/SocketInformation.cs +++ b/mcs/class/System/System.Net.Sockets/SocketInformation.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; @@ -60,4 +59,3 @@ namespace System.Net.Sockets } } -#endif diff --git a/mcs/class/System/System.Net.Sockets/SocketInformationOptions.cs b/mcs/class/System/System.Net.Sockets/SocketInformationOptions.cs index c78ad2a4fff..2b47eacea40 100644 --- a/mcs/class/System/System.Net.Sockets/SocketInformationOptions.cs +++ b/mcs/class/System/System.Net.Sockets/SocketInformationOptions.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; @@ -42,5 +41,3 @@ namespace System.Net.Sockets UseOnlyOverlappedIO = 0x00000008 } } - -#endif diff --git a/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs b/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs index e93bb2f4b04..cda7027a7f7 100644 --- a/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs +++ b/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs @@ -46,11 +46,9 @@ namespace System.Net.Sockets { /// IP = 0, -#if NET_1_1 /// /// IPv6 = 41, -#endif /// /// diff --git a/mcs/class/System/System.Net.Sockets/SocketOptionName.cs b/mcs/class/System/System.Net.Sockets/SocketOptionName.cs index ce10c14fafe..d0043e1d24e 100644 --- a/mcs/class/System/System.Net.Sockets/SocketOptionName.cs +++ b/mcs/class/System/System.Net.Sockets/SocketOptionName.cs @@ -198,11 +198,9 @@ namespace System.Net.Sockets { /// ChecksumCoverage = 20, -#if NET_2_0 HopLimit = 21, UpdateAcceptContext = 28683, UpdateConnectContext = 28688, -#endif } // SocketOptionName diff --git a/mcs/class/System/System.Net.Sockets/Socket_2_1.cs b/mcs/class/System/System.Net.Sockets/Socket_2_1.cs index 77c8a42e229..0e932125548 100644 --- a/mcs/class/System/System.Net.Sockets/Socket_2_1.cs +++ b/mcs/class/System/System.Net.Sockets/Socket_2_1.cs @@ -496,7 +496,6 @@ namespace System.Net.Sockets { args.SetLastOperation (async_op); args.SocketError = SocketError.Success; args.BytesTransferred = 0; - args.Count = 0; } public void Accept () @@ -1647,6 +1646,8 @@ namespace System.Net.Sockets { #if MOONLIGHT || NET_4_0 IPAddress [] addresses = null; use_remoteep = !GetCheckedIPs (e, out addresses); +#endif +#if MOONLIGHT bool policy_failed = (e.SocketError == SocketError.AccessDenied); #endif e.curSocket = this; diff --git a/mcs/class/System/System.Net.Sockets/TransmitFileOptions.cs b/mcs/class/System/System.Net.Sockets/TransmitFileOptions.cs index 8def6c713be..654448c5572 100644 --- a/mcs/class/System/System.Net.Sockets/TransmitFileOptions.cs +++ b/mcs/class/System/System.Net.Sockets/TransmitFileOptions.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Net.Sockets @@ -44,5 +42,3 @@ namespace System.Net.Sockets UseKernelApc = 0x00000020, } } - -#endif diff --git a/mcs/class/System/System.Net/AuthenticationManager.cs b/mcs/class/System/System.Net/AuthenticationManager.cs index 876418bbc6f..0c87dbef56f 100644 --- a/mcs/class/System/System.Net/AuthenticationManager.cs +++ b/mcs/class/System/System.Net/AuthenticationManager.cs @@ -59,7 +59,7 @@ namespace System.Net modules.Add (new BasicClient ()); modules.Add (new DigestClient ()); modules.Add (new NtlmClient ()); -#elif NET_2_0 && CONFIGURATION_DEP +#elif CONFIGURATION_DEP object cfg = ConfigurationManager.GetSection ("system.net/authenticationModules"); AuthenticationModulesSection s = cfg as AuthenticationModulesSection; if (s != null) { diff --git a/mcs/class/System/System.Net/AuthenticationSchemeSelector.cs b/mcs/class/System/System.Net/AuthenticationSchemeSelector.cs index 45c94214970..e20ccb4465a 100644 --- a/mcs/class/System/System.Net/AuthenticationSchemeSelector.cs +++ b/mcs/class/System/System.Net/AuthenticationSchemeSelector.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP namespace System.Net { public delegate AuthenticationSchemes AuthenticationSchemeSelector (HttpListenerRequest httpRequest); diff --git a/mcs/class/System/System.Net/AuthenticationSchemes.cs b/mcs/class/System/System.Net/AuthenticationSchemes.cs index 94a32890206..0a599855537 100644 --- a/mcs/class/System/System.Net/AuthenticationSchemes.cs +++ b/mcs/class/System/System.Net/AuthenticationSchemes.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Collections; using System.Configuration; @@ -46,4 +44,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/Authorization.cs b/mcs/class/System/System.Net/Authorization.cs index 71a1272bd5d..a80845485b1 100644 --- a/mcs/class/System/System.Net/Authorization.cs +++ b/mcs/class/System/System.Net/Authorization.cs @@ -76,7 +76,6 @@ namespace System.Net { set { module = value; } } -#if NET_2_0 static Exception GetMustImplement () { return new NotImplementedException (); @@ -92,6 +91,5 @@ namespace System.Net { throw GetMustImplement (); } } -#endif } } diff --git a/mcs/class/System/System.Net/BindIPEndPoint.cs b/mcs/class/System/System.Net/BindIPEndPoint.cs index c638e000234..e1a1937b93d 100644 --- a/mcs/class/System/System.Net/BindIPEndPoint.cs +++ b/mcs/class/System/System.Net/BindIPEndPoint.cs @@ -25,10 +25,8 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net { public delegate IPEndPoint BindIPEndPoint (ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount); } -#endif diff --git a/mcs/class/System/System.Net/ChunkedInputStream.cs b/mcs/class/System/System.Net/ChunkedInputStream.cs index 4c7c744140b..5a46e510525 100644 --- a/mcs/class/System/System.Net/ChunkedInputStream.cs +++ b/mcs/class/System/System.Net/ChunkedInputStream.cs @@ -25,7 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.IO; using System.Net.Sockets; diff --git a/mcs/class/System/System.Net/CookieCollection.cs b/mcs/class/System/System.Net/CookieCollection.cs index a8fec602f23..6881a880a05 100644 --- a/mcs/class/System/System.Net/CookieCollection.cs +++ b/mcs/class/System/System.Net/CookieCollection.cs @@ -49,11 +49,12 @@ namespace System.Net { if (x == null || y == null) return 0; - - int c1 = x.Name.Length + x.Value.Length; - int c2 = y.Name.Length + y.Value.Length; - return (c1 - c2); + var ydomain = y.Domain.Length - (y.Domain[0] == '.' ? 1 : 0); + var xdomain = x.Domain.Length - (x.Domain[0] == '.' ? 1 : 0); + + int result = ydomain - xdomain; + return result == 0 ? y.Path.Length - x.Path.Length : result; } } diff --git a/mcs/class/System/System.Net/CredentialCache.cs b/mcs/class/System/System.Net/CredentialCache.cs index 6a6566ed5b8..9978daa46d7 100644 --- a/mcs/class/System/System.Net/CredentialCache.cs +++ b/mcs/class/System/System.Net/CredentialCache.cs @@ -31,23 +31,16 @@ using System.Collections; using System.Runtime.Serialization; namespace System.Net { - public class CredentialCache : ICredentials, IEnumerable -#if NET_2_0 - , ICredentialsByHost -#endif + public class CredentialCache : ICredentials, IEnumerable, ICredentialsByHost { static NetworkCredential empty = new NetworkCredential (String.Empty, String.Empty, String.Empty); Hashtable cache; -#if NET_2_0 Hashtable cacheForHost; -#endif public CredentialCache () { cache = new Hashtable (); -#if NET_2_0 cacheForHost = new Hashtable (); -#endif } [MonoTODO ("Need EnvironmentPermission implementation first")] @@ -58,13 +51,11 @@ namespace System.Net { } } -#if NET_2_0 // MS does might return a special ICredentials which does not allow getting the // username/password information out of it for non-internal classes. public static NetworkCredential DefaultNetworkCredentials { get { return empty; } } -#endif public NetworkCredential GetCredential (Uri uriPrefix, string authType) { @@ -136,7 +127,6 @@ namespace System.Net { cache.Remove (new CredentialCacheKey (uriPrefix, authType)); } -#if NET_2_0 public NetworkCredential GetCredential (string host, int port, string authenticationType) { NetworkCredential result = null; @@ -187,7 +177,6 @@ namespace System.Net { cacheForHost.Remove (new CredentialCacheForHostKey (host, port, authenticationType)); } -#endif class CredentialCacheKey { Uri uriPrefix; @@ -242,7 +231,6 @@ namespace System.Net { } } -#if NET_2_0 class CredentialCacheForHostKey { string host; int port; @@ -288,7 +276,6 @@ namespace System.Net { return host + " : " + authType; } } -#endif } } diff --git a/mcs/class/System/System.Net/DecompressionMethods.cs b/mcs/class/System/System.Net/DecompressionMethods.cs index 1109afd668d..c9cad9553e5 100644 --- a/mcs/class/System/System.Net/DecompressionMethods.cs +++ b/mcs/class/System/System.Net/DecompressionMethods.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net { [Flags] @@ -39,4 +37,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs index 82d3369389b..011c295a5ea 100644 --- a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs +++ b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs @@ -39,7 +39,7 @@ namespace System.Net { // but) expired certificates. public bool CheckValidationResult (ServicePoint point, X509Certificate certificate, WebRequest request, int certificateProblem) { -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP // If using default policy and the new callback is there, ignore this if (ServicePointManager.ServerCertificateValidationCallback != null) return true; diff --git a/mcs/class/System/System.Net/DownloadDataCompletedEventArgs.cs b/mcs/class/System/System.Net/DownloadDataCompletedEventArgs.cs index eed95c123b6..47959d482dc 100644 --- a/mcs/class/System/System.Net/DownloadDataCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/DownloadDataCompletedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; using System.IO; @@ -53,4 +51,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/DownloadDataCompletedEventHandler.cs b/mcs/class/System/System.Net/DownloadDataCompletedEventHandler.cs index d9e31729951..0bf90de49cd 100644 --- a/mcs/class/System/System.Net/DownloadDataCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/DownloadDataCompletedEventHandler.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net @@ -33,4 +32,3 @@ namespace System.Net public delegate void DownloadDataCompletedEventHandler (object sender, DownloadDataCompletedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Net/DownloadProgressChangedEventArgs.cs b/mcs/class/System/System.Net/DownloadProgressChangedEventArgs.cs index bd42a4a92f7..8ea292c943e 100644 --- a/mcs/class/System/System.Net/DownloadProgressChangedEventArgs.cs +++ b/mcs/class/System/System.Net/DownloadProgressChangedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; using System.IO; @@ -55,4 +53,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/DownloadProgressChangedEventHandler.cs b/mcs/class/System/System.Net/DownloadProgressChangedEventHandler.cs index 3420ecea813..1f28234772d 100644 --- a/mcs/class/System/System.Net/DownloadProgressChangedEventHandler.cs +++ b/mcs/class/System/System.Net/DownloadProgressChangedEventHandler.cs @@ -25,12 +25,8 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void DownloadProgressChangedEventHandler (object sender, DownloadProgressChangedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Net/DownloadStringCompletedEventArgs.cs b/mcs/class/System/System.Net/DownloadStringCompletedEventArgs.cs index 2c130a5fa3e..08dca9e8527 100644 --- a/mcs/class/System/System.Net/DownloadStringCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/DownloadStringCompletedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; namespace System.Net @@ -55,4 +53,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/DownloadStringCompletedEventHandler.cs b/mcs/class/System/System.Net/DownloadStringCompletedEventHandler.cs index 76e9fb89a1d..03ca24954f6 100644 --- a/mcs/class/System/System.Net/DownloadStringCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/DownloadStringCompletedEventHandler.cs @@ -25,12 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void DownloadStringCompletedEventHandler (object sender, DownloadStringCompletedEventArgs e); } - -#endif diff --git a/mcs/class/System/System.Net/EndPointListener.cs b/mcs/class/System/System.Net/EndPointListener.cs index 8fb54a4c6c5..da7294e9472 100644 --- a/mcs/class/System/System.Net/EndPointListener.cs +++ b/mcs/class/System/System.Net/EndPointListener.cs @@ -2,9 +2,10 @@ // System.Net.EndPointListener // // Author: -// Gonzalo Paniagua Javier (gonzalo@novell.com) +// Gonzalo Paniagua Javier (gonzalo.mono@gmail.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// Copyright (c) 2012 Xamarin, Inc. (http://xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,11 +27,12 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.IO; using System.Net.Sockets; using System.Collections; +using System.Collections.Generic; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Threading; @@ -47,7 +49,7 @@ namespace System.Net { X509Certificate2 cert; AsymmetricAlgorithm key; bool secure; - Hashtable unregistered; + Dictionary unregistered; public EndPointListener (IPAddress addr, int port, bool secure) { @@ -65,7 +67,7 @@ namespace System.Net { args.Completed += OnAccept; sock.AcceptAsync (args); prefixes = new Hashtable (); - unregistered = new Hashtable (); + unregistered = new Dictionary (); } void LoadCertificateAndKey (IPAddress addr, int port) @@ -76,7 +78,11 @@ namespace System.Net { string path = Path.Combine (dirname, ".mono"); path = Path.Combine (path, "httplistener"); string cert_file = Path.Combine (path, String.Format ("{0}.cer", port)); + if (!File.Exists (cert_file)) + return; string pvk_file = Path.Combine (path, String.Format ("{0}.pvk", port)); + if (!File.Exists (pvk_file)) + return; cert = new X509Certificate2 (cert_file); key = PrivateKey.CreateFromFile (pvk_file).RSA; } catch { @@ -271,7 +277,12 @@ namespace System.Net { { sock.Close (); lock (unregistered) { - foreach (HttpConnection c in unregistered.Keys) + // + // Clone the list because RemoveConnection can be called from Close + // + var connections = new List (unregistered.Keys); + + foreach (HttpConnection c in connections) c.Close (true); unregistered.Clear (); } diff --git a/mcs/class/System/System.Net/EndPointManager.cs b/mcs/class/System/System.Net/EndPointManager.cs index eb87c998b07..eb4c79852c7 100644 --- a/mcs/class/System/System.Net/EndPointManager.cs +++ b/mcs/class/System/System.Net/EndPointManager.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.Collections; using System.Collections.Generic; diff --git a/mcs/class/System/System.Net/FileWebRequest.cs b/mcs/class/System/System.Net/FileWebRequest.cs index 08c2d00c075..618c09ee145 100644 --- a/mcs/class/System/System.Net/FileWebRequest.cs +++ b/mcs/class/System/System.Net/FileWebRequest.cs @@ -64,9 +64,7 @@ namespace System.Net this.webHeaders = new WebHeaderCollection (); } -#if NET_2_0 [Obsolete ("Serialization is obsoleted for this type", false)] -#endif protected FileWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext) { SerializationInfo info = serializationInfo; @@ -93,11 +91,7 @@ namespace System.Net get { return contentLength; } set { if (value < 0) -#if NET_2_0 throw new ArgumentException ("The Content-Length value must be greater than or equal to zero.", "value"); -#else - throw new ArgumentException ("value"); -#endif contentLength = value; } } @@ -121,13 +115,8 @@ namespace System.Net get { return this.method; } set { if (value == null || value.Length == 0) -#if NET_2_0 throw new ArgumentException ("Cannot set null or blank " + "methods on request.", "value"); -#else - throw new ArgumentException ("Cannot set null or blank " - + "methods on request."); -#endif this.method = value; } } @@ -152,18 +141,13 @@ namespace System.Net get { return timeout; } set { if (value < -1) -#if NET_2_0 throw new ArgumentOutOfRangeException ("Timeout can be " + "only set to 'System.Threading.Timeout.Infinite' " + "or a value >= 0."); -#else - throw new ArgumentOutOfRangeException ("value"); -#endif timeout = value; } } -#if NET_2_0 public override bool UseDefaultCredentials { get { @@ -173,14 +157,11 @@ namespace System.Net throw new NotSupportedException (); } } -#endif - // Methods private delegate Stream GetRequestStreamCallback (); private delegate WebResponse GetResponseCallback (); -#if NET_2_0 static Exception GetMustImplement () { return new NotImplementedException (); @@ -194,7 +175,6 @@ namespace System.Net { throw GetMustImplement (); } -#endif public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state) { @@ -305,10 +285,7 @@ namespace System.Net GetObjectData (serializationInfo, streamingContext); } -#if NET_2_0 - protected override -#endif - void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) + protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) { SerializationInfo info = serializationInfo; info.AddValue ("headers", webHeaders, typeof (WebHeaderCollection)); @@ -319,11 +296,7 @@ namespace System.Net info.AddValue ("contentLength", contentLength); info.AddValue ("timeout", timeout); info.AddValue ("fileAccess", fileAccess); -#if NET_2_0 info.AddValue ("preauthenticate", false); -#else - info.AddValue ("preauthenticate", preAuthenticate); -#endif } internal void Close () diff --git a/mcs/class/System/System.Net/FileWebResponse.cs b/mcs/class/System/System.Net/FileWebResponse.cs index 1c9cd126bd2..2bce7359930 100644 --- a/mcs/class/System/System.Net/FileWebResponse.cs +++ b/mcs/class/System/System.Net/FileWebResponse.cs @@ -64,9 +64,7 @@ namespace System.Net this.exception = exception; } -#if NET_2_0 [Obsolete ("Serialization is obsoleted for this type", false)] -#endif protected FileWebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext) { SerializationInfo info = serializationInfo; @@ -120,10 +118,7 @@ namespace System.Net GetObjectData (serializationInfo, streamingContext); } -#if NET_2_0 - protected override -#endif - void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) + protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) { SerializationInfo info = serializationInfo; @@ -162,9 +157,6 @@ namespace System.Net GC.SuppressFinalize (this); } -#if !NET_2_0 - protected virtual -#endif void Dispose (bool disposing) { if (this.disposed) diff --git a/mcs/class/System/System.Net/FtpAsyncResult.cs b/mcs/class/System/System.Net/FtpAsyncResult.cs index b5b34480821..33e67372c48 100644 --- a/mcs/class/System/System.Net/FtpAsyncResult.cs +++ b/mcs/class/System/System.Net/FtpAsyncResult.cs @@ -12,8 +12,6 @@ using System.IO; using System.Threading; using System.Net; -#if NET_2_0 - namespace System.Net { class FtpAsyncResult : IAsyncResult @@ -161,5 +159,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/FtpDataStream.cs b/mcs/class/System/System.Net/FtpDataStream.cs index 8ed7d63d47e..7bb47468c3a 100644 --- a/mcs/class/System/System.Net/FtpDataStream.cs +++ b/mcs/class/System/System.Net/FtpDataStream.cs @@ -14,8 +14,6 @@ using System.Runtime.Remoting.Messaging; using System.Threading; using System.Net; -#if NET_2_0 - namespace System.Net { class FtpDataStream : Stream, IDisposable @@ -251,5 +249,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/FtpRequestCreator.cs b/mcs/class/System/System.Net/FtpRequestCreator.cs index b1f0590dd52..e72266fbeab 100644 --- a/mcs/class/System/System.Net/FtpRequestCreator.cs +++ b/mcs/class/System/System.Net/FtpRequestCreator.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net { @@ -41,5 +40,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/FtpStatus.cs b/mcs/class/System/System.Net/FtpStatus.cs index a7e252cceae..9b6afa543b0 100644 --- a/mcs/class/System/System.Net/FtpStatus.cs +++ b/mcs/class/System/System.Net/FtpStatus.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net { internal class FtpStatus @@ -50,4 +49,3 @@ namespace System.Net } } } -#endif diff --git a/mcs/class/System/System.Net/FtpStatusCode.cs b/mcs/class/System/System.Net/FtpStatusCode.cs index 9c84e2c0981..516124fa3e0 100644 --- a/mcs/class/System/System.Net/FtpStatusCode.cs +++ b/mcs/class/System/System.Net/FtpStatusCode.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net { public enum FtpStatusCode @@ -74,5 +72,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/FtpWebRequest.cs b/mcs/class/System/System.Net/FtpWebRequest.cs index e337aa98401..2f328ffdae0 100644 --- a/mcs/class/System/System.Net/FtpWebRequest.cs +++ b/mcs/class/System/System.Net/FtpWebRequest.cs @@ -6,7 +6,6 @@ // // (c) Copyright 2006 Novell, Inc. (http://www.novell.com) // -#if NET_2_0 using System; using System.IO; @@ -1194,5 +1193,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/FtpWebResponse.cs b/mcs/class/System/System.Net/FtpWebResponse.cs index 2efd11208d3..68f06774435 100644 --- a/mcs/class/System/System.Net/FtpWebResponse.cs +++ b/mcs/class/System/System.Net/FtpWebResponse.cs @@ -12,8 +12,6 @@ using System.IO; using System.Runtime.Serialization; using System.Net; -#if NET_2_0 - namespace System.Net { public class FtpWebResponse : WebResponse @@ -177,5 +175,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/GlobalProxySelection.cs b/mcs/class/System/System.Net/GlobalProxySelection.cs index 2cde423649b..049f61ccad0 100644 --- a/mcs/class/System/System.Net/GlobalProxySelection.cs +++ b/mcs/class/System/System.Net/GlobalProxySelection.cs @@ -31,15 +31,11 @@ using System.Collections; using System.Configuration; using System.IO; using System.Runtime.Serialization; -#if NET_2_0 using System.Net.Configuration; -#endif namespace System.Net { -#if NET_2_0 [ObsoleteAttribute("Use WebRequest.DefaultProxy instead")] -#endif public class GlobalProxySelection { // Constructors @@ -47,39 +43,9 @@ namespace System.Net // Properties -#if !NET_2_0 - volatile static IWebProxy proxy; - static readonly object lockobj = new object (); - - static IWebProxy GetProxy () - { - lock (lockobj) { - if (proxy != null) - return proxy; - - object p = ConfigurationSettings.GetConfig ("system.net/defaultProxy"); - if (p == null) - p = new EmptyWebProxy (); - proxy = (IWebProxy) p; - } - - return proxy; - } -#endif - public static IWebProxy Select { -#if NET_2_0 get { return WebRequest.DefaultWebProxy; } set { WebRequest.DefaultWebProxy = value; } -#else - get { return GetProxy (); } - set { - if (value == null) - throw new ArgumentNullException ("GlobalProxySelection.Select", - "null IWebProxy not allowed. Use GetEmptyWebProxy ()"); - proxy = value; - } -#endif } // Methods diff --git a/mcs/class/System/System.Net/HttpConnection.cs b/mcs/class/System/System.Net/HttpConnection.cs index e90cc39e27e..b8dab7a78b4 100644 --- a/mcs/class/System/System.Net/HttpConnection.cs +++ b/mcs/class/System/System.Net/HttpConnection.cs @@ -2,9 +2,10 @@ // System.Net.HttpConnection // // Author: -// Gonzalo Paniagua Javier (gonzalo@novell.com) +// Gonzalo Paniagua Javier (gonzalo.mono@gmail.com) // -// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// Copyright (c) 2005-2009 Novell, Inc. (http://www.novell.com) +// Copyright (c) 2012 Xamarin, Inc. (http://xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -61,6 +62,8 @@ namespace System.Net { Timer timer; IPEndPoint local_ep; HttpListener last_listener; + int [] client_cert_errors; + X509Certificate2 client_cert; public HttpConnection (Socket sock, EndPointListener epl, bool secure, X509Certificate2 cert, AsymmetricAlgorithm key) { @@ -71,14 +74,35 @@ namespace System.Net { if (secure == false) { stream = new NetworkStream (sock, false); } else { - SslServerStream ssl_stream = new SslServerStream (new NetworkStream (sock, false), cert, false, false); + SslServerStream ssl_stream = new SslServerStream (new NetworkStream (sock, false), cert, false, true, false); ssl_stream.PrivateKeyCertSelectionDelegate += OnPVKSelection; + ssl_stream.ClientCertValidationDelegate += OnClientCertificateValidation; stream = ssl_stream; } timer = new Timer (OnTimeout, null, Timeout.Infinite, Timeout.Infinite); Init (); } + internal int [] ClientCertificateErrors { + get { return client_cert_errors; } + } + + internal X509Certificate2 ClientCertificate { + get { return client_cert; } + } + + bool OnClientCertificateValidation (X509Certificate certificate, int[] errors) + { + if (certificate == null) + return true; + X509Certificate2 cert = certificate as X509Certificate2; + if (cert == null) + cert = new X509Certificate2 (certificate.GetRawCertData ()); + client_cert = cert; + client_cert_errors = errors; + return true; + } + AsymmetricAlgorithm OnPVKSelection (X509Certificate certificate, string targetHost) { return key; @@ -415,7 +439,9 @@ namespace System.Net { { if (sock != null) { Stream st = GetResponseStream (); - st.Close (); + if (st != null) + st.Close (); + o_stream = null; } diff --git a/mcs/class/System/System.Net/HttpListenerBasicIdentity.cs b/mcs/class/System/System.Net/HttpListenerBasicIdentity.cs index 9f4fd0211f3..7b7b21c8f0c 100644 --- a/mcs/class/System/System.Net/HttpListenerBasicIdentity.cs +++ b/mcs/class/System/System.Net/HttpListenerBasicIdentity.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Security.Principal; namespace System.Net { public class HttpListenerBasicIdentity : GenericIdentity { @@ -41,5 +40,4 @@ namespace System.Net { } } } -#endif diff --git a/mcs/class/System/System.Net/HttpListenerException.cs b/mcs/class/System/System.Net/HttpListenerException.cs index 7553ddc688d..684344e366d 100644 --- a/mcs/class/System/System.Net/HttpListenerException.cs +++ b/mcs/class/System/System.Net/HttpListenerException.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.ComponentModel; using System.Runtime.Serialization; namespace System.Net { @@ -53,5 +52,4 @@ namespace System.Net { } } } -#endif diff --git a/mcs/class/System/System.Net/HttpListenerPrefixCollection.cs b/mcs/class/System/System.Net/HttpListenerPrefixCollection.cs index 6cbe8ff5680..dffb521ded4 100644 --- a/mcs/class/System/System.Net/HttpListenerPrefixCollection.cs +++ b/mcs/class/System/System.Net/HttpListenerPrefixCollection.cs @@ -25,7 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP || EMBEDDED_IN_1_0 +#if SECURITY_DEP || EMBEDDED_IN_1_0 using System.Collections; using System.Collections.Generic; diff --git a/mcs/class/System/System.Net/HttpListenerRequest.cs b/mcs/class/System/System.Net/HttpListenerRequest.cs index 3e5e5f7e6fd..f8be5c4f3b9 100644 --- a/mcs/class/System/System.Net/HttpListenerRequest.cs +++ b/mcs/class/System/System.Net/HttpListenerRequest.cs @@ -2,11 +2,11 @@ // System.Net.HttpListenerRequest // // Authors: -// Gonzalo Paniagua Javier (gonzalo@novell.com) +// Gonzalo Paniagua Javier (gonzalo.mono@gmail.com) // Marek Safar (marek.safar@gmail.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) -// Copyright 2011 Xamarin Inc. +// Copyright (c) 2011-2012 Xamarin, Inc. (http://xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -42,6 +42,7 @@ using System.Security.Authentication.ExtendedProtection; #if NET_4_5 using System.Threading.Tasks; #endif +using Mono.Security.Protocol.Tls; namespace System.Net { public sealed class HttpListenerRequest @@ -57,8 +58,6 @@ namespace System.Net { #endif string [] accept_types; -// int client_cert_error; -// bool no_get_certificate; Encoding content_encoding; long content_length; bool cl_set; @@ -76,6 +75,9 @@ namespace System.Net { bool is_chunked; bool ka_set; bool keep_alive; + delegate X509Certificate2 GCCDelegate (); + GCCDelegate gcc_delegate; + static byte [] _100continue = Encoding.ASCII.GetBytes ("HTTP/1.1 100 Continue\r\n\r\n"); internal HttpListenerRequest (HttpListenerContext context) @@ -331,15 +333,14 @@ namespace System.Net { get { return accept_types; } } - [MonoTODO ("Always returns 0")] public int ClientCertificateError { get { -/* - if (no_get_certificate) - throw new InvalidOperationException ( - "Call GetClientCertificate() before calling this method."); - return client_cert_error; -*/ + HttpConnection cnc = context.Connection; + if (cnc.ClientCertificate == null) + throw new InvalidOperationException ("No client certificate"); + int [] errors = cnc.ClientCertificateErrors; + if (errors != null && errors.Length > 0) + return errors [0]; return 0; } } @@ -479,24 +480,27 @@ namespace System.Net { get { return user_languages; } } - [MonoTODO] public IAsyncResult BeginGetClientCertificate (AsyncCallback requestCallback, object state) { - throw new NotImplementedException (); + if (gcc_delegate == null) + gcc_delegate = new GCCDelegate (GetClientCertificate); + return gcc_delegate.BeginInvoke (requestCallback, state); } - [MonoTODO] public X509Certificate2 EndGetClientCertificate (IAsyncResult asyncResult) { - throw new NotImplementedException (); + if (asyncResult == null) + throw new ArgumentNullException ("asyncResult"); + + if (gcc_delegate == null) + throw new InvalidOperationException (); + + return gcc_delegate.EndInvoke (asyncResult); } public X509Certificate2 GetClientCertificate () { - // set no_client_certificate once done. - - // InvalidOp if call in progress. - return null; + return context.Connection.ClientCertificate; } #if NET_4_0 diff --git a/mcs/class/System/System.Net/HttpListenerResponse.cs b/mcs/class/System/System.Net/HttpListenerResponse.cs index acf28426ced..d1c6a616572 100644 --- a/mcs/class/System/System.Net/HttpListenerResponse.cs +++ b/mcs/class/System/System.Net/HttpListenerResponse.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.Globalization; using System.IO; @@ -49,7 +49,10 @@ namespace System.Net { string status_description = "OK"; bool chunked; HttpListenerContext context; + internal bool HeadersSent; + internal object headers_lock = new object (); + bool force_close_chunked; internal HttpListenerResponse (HttpListenerContext context) diff --git a/mcs/class/System/System.Net/HttpRequestHeader.cs b/mcs/class/System/System.Net/HttpRequestHeader.cs index f25d7c8678d..46bd92bd957 100644 --- a/mcs/class/System/System.Net/HttpRequestHeader.cs +++ b/mcs/class/System/System.Net/HttpRequestHeader.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net { public enum HttpRequestHeader { CacheControl, @@ -71,5 +70,4 @@ namespace System.Net { UserAgent } } -#endif diff --git a/mcs/class/System/System.Net/HttpResponseHeader.cs b/mcs/class/System/System.Net/HttpResponseHeader.cs index d559b2f13d7..2bf820aa66d 100644 --- a/mcs/class/System/System.Net/HttpResponseHeader.cs +++ b/mcs/class/System/System.Net/HttpResponseHeader.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Net { public enum HttpResponseHeader { CacheControl, @@ -60,5 +59,4 @@ namespace System.Net { WwwAuthenticate } } -#endif diff --git a/mcs/class/System/System.Net/HttpStreamAsyncResult.cs b/mcs/class/System/System.Net/HttpStreamAsyncResult.cs index 7d0413f9d6c..05abfab20a8 100644 --- a/mcs/class/System/System.Net/HttpStreamAsyncResult.cs +++ b/mcs/class/System/System.Net/HttpStreamAsyncResult.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Threading; namespace System.Net { @@ -91,5 +90,4 @@ namespace System.Net { } } } -#endif diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 2c224a9df09..623824b5b68 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -396,9 +396,6 @@ namespace System.Net static bool CheckValidHost (string scheme, string val) { - if (val == null) - throw new ArgumentNullException ("value"); - if (val.Length == 0) return false; @@ -560,7 +557,14 @@ namespace System.Net internal ServicePoint ServicePointNoLock { get { return servicePoint; } } - +#if NET_4_5 || MOBILE + [MonoTODO ("for portable library support")] + public bool SupportsCookieContainer { + get { + throw new NotImplementedException (); + } + } +#endif public override int Timeout { get { return timeout; } set { @@ -822,8 +826,18 @@ namespace System.Net void CheckIfForceWrite () { - if (writeStream == null || writeStream.RequestWritten || (contentLength < 0 && writeStream.CanWrite == true) || !InternalAllowBuffering) + if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering) return; +#if NET_4_0 + if (contentLength < 0 && writeStream.CanWrite == true && writeStream.WriteBufferLength <= 0) + return; + + if (contentLength < 0 && writeStream.WriteBufferLength > 0) + InternalContentLength = writeStream.WriteBufferLength; +#else + if (contentLength < 0 && writeStream.CanWrite == true) + return; +#endif // This will write the POST/PUT if the write stream already has the expected // amount of bytes in it (ContentLength) (bug #77753) or if the write stream diff --git a/mcs/class/System/System.Net/HttpWebRequest.jvm.cs b/mcs/class/System/System.Net/HttpWebRequest.jvm.cs index 04fd44381c2..a2809219275 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.jvm.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.jvm.cs @@ -600,7 +600,6 @@ namespace System.Net #endregion -#if NET_2_0 public DecompressionMethods AutomaticDecompression { get { @@ -610,7 +609,6 @@ namespace System.Net throw new NotSupportedException (); } } -#endif } } diff --git a/mcs/class/System/System.Net/IPAddress.cs b/mcs/class/System/System.Net/IPAddress.cs index 802364e0379..155e3d8c816 100644 --- a/mcs/class/System/System.Net/IPAddress.cs +++ b/mcs/class/System/System.Net/IPAddress.cs @@ -140,14 +140,9 @@ namespace System.Net { int len = address.Length; -#if NET_2_0 if (len != 16 && len != 4) throw new ArgumentException ("An invalid IP address was specified.", "address"); -#else - if (len != 16) - throw new ArgumentException ("address"); -#endif if (len == 16) { m_Numbers = new ushort [8]; @@ -167,12 +162,8 @@ namespace System.Net { throw new ArgumentNullException ("address"); if (address.Length != 16) -#if NET_2_0 throw new ArgumentException ("An invalid IP address was specified.", "address"); -#else - throw new ArgumentException("address"); -#endif m_Numbers = new ushort [8]; Buffer.BlockCopy(address, 0, m_Numbers, 0, 16); @@ -199,12 +190,7 @@ namespace System.Net { throw new FormatException ("An invalid IP address was specified."); } -#if NET_2_0 - public -#else - internal -#endif - static bool TryParse (string ipString, out IPAddress address) + public static bool TryParse (string ipString, out IPAddress address) { if (ipString == null) throw new ArgumentNullException ("ipString"); @@ -217,14 +203,9 @@ namespace System.Net { private static IPAddress ParseIPV4 (string ip) { -#if ONLY_1_1 - if (ip.Length == 0 || ip == " ") - return new IPAddress (0); -#endif int pos = ip.IndexOf (' '); if (pos != -1) { -#if NET_2_0 string [] nets = ip.Substring (pos + 1).Split (new char [] {'.'}); if (nets.Length > 0) { string lastNet = nets [nets.Length - 1]; @@ -238,7 +219,6 @@ namespace System.Net { if (!Uri.IsHexDigit (c)) return null; } -#endif ip = ip.Substring (0, pos); } @@ -274,12 +254,8 @@ namespace System.Net { } } else { -#if NET_2_0 if (!Int64.TryParse (subnet, NumberStyles.None, null, out val)) return null; -#else - val = long.Parse (subnet, NumberStyles.None); -#endif } if (i == (ips.Length - 1)) { @@ -336,7 +312,6 @@ namespace System.Net { get { return m_Address; } } -#if NET_2_0 public bool IsIPv6LinkLocal { get { if (m_Family == AddressFamily.InterNetwork) @@ -361,7 +336,6 @@ namespace System.Net { ((ushort) NetworkToHostOrder ((short) m_Numbers [0]) & 0xFF00) == 0xFF00; } } -#endif public long ScopeId { get { diff --git a/mcs/class/System/System.Net/IPEndPoint.cs b/mcs/class/System/System.Net/IPEndPoint.cs index a1f6a6cf680..a6982a1ed7a 100644 --- a/mcs/class/System/System.Net/IPEndPoint.cs +++ b/mcs/class/System/System.Net/IPEndPoint.cs @@ -117,7 +117,6 @@ namespace System.Net { ipe = new IPEndPoint(address, port); break; -#if NET_1_1 case AddressFamily.InterNetworkV6: if (size < 28) { return(null); @@ -144,7 +143,6 @@ namespace System.Net { ipe = new IPEndPoint (new IPAddress(addressData, scopeId), port); break; -#endif default: return null; } @@ -173,7 +171,7 @@ namespace System.Net { sockaddr [6] = (byte) ((addr >> 16) & 0xff); sockaddr [7] = (byte) ((addr >> 24) & 0xff); break; -#if NET_1_1 + case AddressFamily.InterNetworkV6: sockaddr = new SocketAddress(AddressFamily.InterNetworkV6, 28); @@ -189,7 +187,6 @@ namespace System.Net { sockaddr [26] = (byte) ((address.ScopeId >> 16) & 0xff); sockaddr [27] = (byte) ((address.ScopeId >> 24) & 0xff); break; -#endif } return(sockaddr); diff --git a/mcs/class/System/System.Net/IPv6Address.cs b/mcs/class/System/System.Net/IPv6Address.cs index 7165fb2536d..26bb3497c12 100644 --- a/mcs/class/System/System.Net/IPv6Address.cs +++ b/mcs/class/System/System.Net/IPv6Address.cs @@ -136,18 +136,7 @@ namespace System.Net { static bool TryParse (string prefix, out int res) { -#if NET_2_0 return Int32.TryParse (prefix, NumberStyles.Integer, CultureInfo.InvariantCulture, out res); -#else - try { - res = Int32.Parse (prefix, NumberStyles.Integer, CultureInfo.InvariantCulture); - } catch (Exception) { - res = -1; - return false; - } - - return true; -#endif } public static bool TryParse (string ipString, out IPv6Address result) diff --git a/mcs/class/System/System.Net/ListenerAsyncResult.cs b/mcs/class/System/System.Net/ListenerAsyncResult.cs index 4de352b66a7..1738ce07ee1 100644 --- a/mcs/class/System/System.Net/ListenerAsyncResult.cs +++ b/mcs/class/System/System.Net/ListenerAsyncResult.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.Threading; namespace System.Net { diff --git a/mcs/class/System/System.Net/ListenerPrefix.cs b/mcs/class/System/System.Net/ListenerPrefix.cs index 146ee4024a2..ae9746c1260 100644 --- a/mcs/class/System/System.Net/ListenerPrefix.cs +++ b/mcs/class/System/System.Net/ListenerPrefix.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP namespace System.Net { sealed class ListenerPrefix diff --git a/mcs/class/System/System.Net/MacProxy.cs b/mcs/class/System/System.Net/MacProxy.cs new file mode 100644 index 00000000000..f213b0d29e1 --- /dev/null +++ b/mcs/class/System/System.Net/MacProxy.cs @@ -0,0 +1,865 @@ +// +// MacProxy.cs +// +// Author: Jeffrey Stedfast +// +// Copyright (c) 2012 Xamarin Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +using System; +using System.Runtime.InteropServices; + +namespace System.Net +{ + internal class CFObject : IDisposable + { + public const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"; + const string SystemLibrary = "/usr/lib/libSystem.dylib"; + + [DllImport (SystemLibrary)] + public static extern IntPtr dlopen (string path, int mode); + + [DllImport (SystemLibrary)] + public static extern IntPtr dlsym (IntPtr handle, string symbol); + + [DllImport (SystemLibrary)] + public static extern void dlclose (IntPtr handle); + + public static IntPtr GetIndirect (IntPtr handle, string symbol) + { + return dlsym (handle, symbol); + } + + public static IntPtr GetCFObjectHandle (IntPtr handle, string symbol) + { + var indirect = dlsym (handle, symbol); + if (indirect == IntPtr.Zero) + return IntPtr.Zero; + + return Marshal.ReadIntPtr (indirect); + } + + public CFObject (IntPtr handle, bool own) + { + Handle = handle; + + if (!own) + Retain (); + } + + ~CFObject () + { + Dispose (false); + } + + public IntPtr Handle { get; private set; } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFRetain (IntPtr handle); + + void Retain () + { + CFRetain (Handle); + } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFRelease (IntPtr handle); + + void Release () + { + CFRelease (Handle); + } + + protected virtual void Dispose (bool disposing) + { + if (Handle != IntPtr.Zero) { + Release (); + Handle = IntPtr.Zero; + } + } + + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + } + + internal class CFArray : CFObject + { + public CFArray (IntPtr handle, bool own) : base (handle, own) { } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFArrayCreate (IntPtr allocator, IntPtr values, int numValues, IntPtr callbacks); + static readonly IntPtr kCFTypeArrayCallbacks; + + static CFArray () + { + var handle = dlopen (CoreFoundationLibrary, 0); + if (handle == IntPtr.Zero) + return; + + try { + kCFTypeArrayCallbacks = GetIndirect (handle, "kCFTypeArrayCallBacks"); + } finally { + dlclose (handle); + } + } + + static unsafe CFArray Create (params IntPtr[] values) + { + if (values == null) + throw new ArgumentNullException ("values"); + + fixed (IntPtr *pv = values) { + IntPtr handle = CFArrayCreate (IntPtr.Zero, (IntPtr) pv, values.Length, kCFTypeArrayCallbacks); + + return new CFArray (handle, false); + } + } + + public static CFArray Create (params CFObject[] values) + { + if (values == null) + throw new ArgumentNullException ("values"); + + IntPtr[] _values = new IntPtr [values.Length]; + for (int i = 0; i < _values.Length; i++) + _values[i] = values[i].Handle; + + return Create (_values); + } + + [DllImport (CoreFoundationLibrary)] + extern static int CFArrayGetCount (IntPtr handle); + + public int Count { + get { return CFArrayGetCount (Handle); } + } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFArrayGetValueAtIndex (IntPtr handle, int index); + + public IntPtr this[int index] { + get { + return CFArrayGetValueAtIndex (Handle, index); + } + } + } + + internal class CFNumber : CFObject + { + public CFNumber (IntPtr handle, bool own) : base (handle, own) { } + + [DllImport (CoreFoundationLibrary)] + extern static bool CFNumberGetValue (IntPtr handle, int type, out bool value); + + public static bool AsBool (IntPtr handle) + { + bool value; + + if (handle == IntPtr.Zero) + return false; + + CFNumberGetValue (handle, 1, out value); + + return value; + } + + public static implicit operator bool (CFNumber number) + { + return AsBool (number.Handle); + } + + [DllImport (CoreFoundationLibrary)] + extern static bool CFNumberGetValue (IntPtr handle, int type, out int value); + + public static int AsInt32 (IntPtr handle) + { + int value; + + if (handle == IntPtr.Zero) + return 0; + + CFNumberGetValue (handle, 9, out value); + + return value; + } + + public static implicit operator int (CFNumber number) + { + return AsInt32 (number.Handle); + } + } + + internal struct CFRange { + public int Location, Length; + + public CFRange (int loc, int len) + { + Location = loc; + Length = len; + } + } + + internal class CFString : CFObject + { + string str; + + public CFString (IntPtr handle, bool own) : base (handle, own) { } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFStringCreateWithCharacters (IntPtr alloc, IntPtr chars, int length); + + public static CFString Create (string value) + { + IntPtr handle; + + unsafe { + fixed (char *ptr = value) { + handle = CFStringCreateWithCharacters (IntPtr.Zero, (IntPtr) ptr, value.Length); + } + } + + if (handle == IntPtr.Zero) + return null; + + return new CFString (handle, true); + } + + [DllImport (CoreFoundationLibrary)] + extern static int CFStringGetLength (IntPtr handle); + + public int Length { + get { + if (str != null) + return str.Length; + + return CFStringGetLength (Handle); + } + } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFStringGetCharactersPtr (IntPtr handle); + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFStringGetCharacters (IntPtr handle, CFRange range, IntPtr buffer); + + public static string AsString (IntPtr handle) + { + if (handle == IntPtr.Zero) + return null; + + int len = CFStringGetLength (handle); + + if (len == 0) + return string.Empty; + + IntPtr chars = CFStringGetCharactersPtr (handle); + IntPtr buffer = IntPtr.Zero; + + if (chars == IntPtr.Zero) { + CFRange range = new CFRange (0, len); + buffer = Marshal.AllocHGlobal (len * 2); + CFStringGetCharacters (handle, range, buffer); + chars = buffer; + } + + string str; + + unsafe { + str = new string ((char *) chars, 0, len); + } + + if (buffer != IntPtr.Zero) + Marshal.FreeHGlobal (buffer); + + return str; + } + + public override string ToString () + { + if (str == null) + str = AsString (Handle); + + return str; + } + + public static implicit operator string (CFString str) + { + return str.ToString (); + } + + public static implicit operator CFString (string str) + { + return Create (str); + } + } + + internal class CFDictionary : CFObject + { + public CFDictionary (IntPtr handle, bool own) : base (handle, own) { } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFDictionaryGetValue (IntPtr handle, IntPtr key); + + public IntPtr GetValue (IntPtr key) + { + return CFDictionaryGetValue (Handle, key); + } + + public IntPtr this[IntPtr key] { + get { + return GetValue (key); + } + } + } + + internal class CFUrl : CFObject + { + public CFUrl (IntPtr handle, bool own) : base (handle, own) { } + + [DllImport (CoreFoundationLibrary)] + extern static IntPtr CFURLCreateWithString (IntPtr allocator, IntPtr str, IntPtr baseURL); + + public static CFUrl Create (string absolute) + { + if (string.IsNullOrEmpty (absolute)) + return null; + + CFString str = CFString.Create (absolute); + IntPtr handle = CFURLCreateWithString (IntPtr.Zero, str.Handle, IntPtr.Zero); + str.Dispose (); + + if (handle == IntPtr.Zero) + return null; + + return new CFUrl (handle, true); + } + } + + internal enum CFProxyType { + None, + AutoConfigurationUrl, + AutoConfigurationJavaScript, + FTP, + HTTP, + HTTPS, + SOCKS + } + + internal class CFProxy { + //static IntPtr kCFProxyAutoConfigurationHTTPResponseKey; + static IntPtr kCFProxyAutoConfigurationJavaScriptKey; + static IntPtr kCFProxyAutoConfigurationURLKey; + static IntPtr kCFProxyHostNameKey; + static IntPtr kCFProxyPasswordKey; + static IntPtr kCFProxyPortNumberKey; + static IntPtr kCFProxyTypeKey; + static IntPtr kCFProxyUsernameKey; + + //static IntPtr kCFProxyTypeNone; + static IntPtr kCFProxyTypeAutoConfigurationURL; + static IntPtr kCFProxyTypeAutoConfigurationJavaScript; + static IntPtr kCFProxyTypeFTP; + static IntPtr kCFProxyTypeHTTP; + static IntPtr kCFProxyTypeHTTPS; + static IntPtr kCFProxyTypeSOCKS; + + static CFProxy () + { + IntPtr handle = CFObject.dlopen (CFNetwork.CFNetworkLibrary, 0); + + //kCFProxyAutoConfigurationHTTPResponseKey = CFObject.GetCFObjectHandle (handle, "kCFProxyAutoConfigurationHTTPResponseKey"); + kCFProxyAutoConfigurationJavaScriptKey = CFObject.GetCFObjectHandle (handle, "kCFProxyAutoConfigurationJavaScriptKey"); + kCFProxyAutoConfigurationURLKey = CFObject.GetCFObjectHandle (handle, "kCFProxyAutoConfigurationURLKey"); + kCFProxyHostNameKey = CFObject.GetCFObjectHandle (handle, "kCFProxyHostNameKey"); + kCFProxyPasswordKey = CFObject.GetCFObjectHandle (handle, "kCFProxyPasswordKey"); + kCFProxyPortNumberKey = CFObject.GetCFObjectHandle (handle, "kCFProxyPortNumberKey"); + kCFProxyTypeKey = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeKey"); + kCFProxyUsernameKey = CFObject.GetCFObjectHandle (handle, "kCFProxyUsernameKey"); + + //kCFProxyTypeNone = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeNone"); + kCFProxyTypeAutoConfigurationURL = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeAutoConfigurationURL"); + kCFProxyTypeAutoConfigurationJavaScript = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeAutoConfigurationJavaScript"); + kCFProxyTypeFTP = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeFTP"); + kCFProxyTypeHTTP = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeHTTP"); + kCFProxyTypeHTTPS = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeHTTPS"); + kCFProxyTypeSOCKS = CFObject.GetCFObjectHandle (handle, "kCFProxyTypeSOCKS"); + + CFObject.dlclose (handle); + } + + CFDictionary settings; + + internal CFProxy (CFDictionary settings) + { + this.settings = settings; + } + + static CFProxyType CFProxyTypeToEnum (IntPtr type) + { + if (type == kCFProxyTypeAutoConfigurationJavaScript) + return CFProxyType.AutoConfigurationJavaScript; + + if (type == kCFProxyTypeAutoConfigurationURL) + return CFProxyType.AutoConfigurationUrl; + + if (type == kCFProxyTypeFTP) + return CFProxyType.FTP; + + if (type == kCFProxyTypeHTTP) + return CFProxyType.HTTP; + + if (type == kCFProxyTypeHTTPS) + return CFProxyType.HTTPS; + + if (type == kCFProxyTypeSOCKS) + return CFProxyType.SOCKS; + + return CFProxyType.None; + } + +#if false + // AFAICT these get used with CFNetworkExecuteProxyAutoConfiguration*() + + // TODO: bind CFHTTPMessage so we can return the proper type here. + public IntPtr AutoConfigurationHTTPResponse { + get { return settings[kCFProxyAutoConfigurationHTTPResponseKey]; } + } +#endif + + public IntPtr AutoConfigurationJavaScript { + get { + if (kCFProxyAutoConfigurationJavaScriptKey == IntPtr.Zero) + return IntPtr.Zero; + + return settings[kCFProxyAutoConfigurationJavaScriptKey]; + } + } + + public IntPtr AutoConfigurationUrl { + get { + if (kCFProxyAutoConfigurationURLKey == IntPtr.Zero) + return IntPtr.Zero; + + return settings[kCFProxyAutoConfigurationURLKey]; + } + } + + public string HostName { + get { + if (kCFProxyHostNameKey == IntPtr.Zero) + return null; + + return CFString.AsString (settings[kCFProxyHostNameKey]); + } + } + + public string Password { + get { + if (kCFProxyPasswordKey == IntPtr.Zero) + return null; + + return CFString.AsString (settings[kCFProxyPasswordKey]); + } + } + + public int Port { + get { + if (kCFProxyPortNumberKey == IntPtr.Zero) + return 0; + + return CFNumber.AsInt32 (settings[kCFProxyPortNumberKey]); + } + } + + public CFProxyType ProxyType { + get { + if (kCFProxyTypeKey == IntPtr.Zero) + return CFProxyType.None; + + return CFProxyTypeToEnum (settings[kCFProxyTypeKey]); + } + } + + public string Username { + get { + if (kCFProxyUsernameKey == IntPtr.Zero) + return null; + + return CFString.AsString (settings[kCFProxyUsernameKey]); + } + } + } + + internal class CFProxySettings { + static IntPtr kCFNetworkProxiesHTTPEnable; + static IntPtr kCFNetworkProxiesHTTPPort; + static IntPtr kCFNetworkProxiesHTTPProxy; + static IntPtr kCFNetworkProxiesProxyAutoConfigEnable; + static IntPtr kCFNetworkProxiesProxyAutoConfigJavaScript; + static IntPtr kCFNetworkProxiesProxyAutoConfigURLString; + + static CFProxySettings () + { + IntPtr handle = CFObject.dlopen (CFNetwork.CFNetworkLibrary, 0); + + kCFNetworkProxiesHTTPEnable = CFObject.GetCFObjectHandle (handle, "kCFNetworkProxiesHTTPEnable"); + kCFNetworkProxiesHTTPPort = CFObject.GetCFObjectHandle (handle, "kCFNetworkProxiesHTTPPort"); + kCFNetworkProxiesHTTPProxy = CFObject.GetCFObjectHandle (handle, "kCFNetworkProxiesHTTPProxy"); + kCFNetworkProxiesProxyAutoConfigEnable = CFObject.GetCFObjectHandle (handle, "kCFNetworkProxiesProxyAutoConfigEnable"); + kCFNetworkProxiesProxyAutoConfigJavaScript = CFObject.GetCFObjectHandle (handle, "kCFNetworkProxiesProxyAutoConfigJavaScript"); + kCFNetworkProxiesProxyAutoConfigURLString = CFObject.GetCFObjectHandle (handle, "kCFNetworkProxiesProxyAutoConfigURLString"); + + CFObject.dlclose (handle); + } + + CFDictionary settings; + + public CFProxySettings (CFDictionary settings) + { + this.settings = settings; + } + + public CFDictionary Dictionary { + get { return settings; } + } + + public bool HTTPEnable { + get { + if (kCFNetworkProxiesHTTPEnable == IntPtr.Zero) + return false; + + return CFNumber.AsBool (settings[kCFNetworkProxiesHTTPEnable]); + } + } + + public int HTTPPort { + get { + if (kCFNetworkProxiesHTTPPort == IntPtr.Zero) + return 0; + + return CFNumber.AsInt32 (settings[kCFNetworkProxiesHTTPPort]); + } + } + + public string HTTPProxy { + get { + if (kCFNetworkProxiesHTTPProxy == IntPtr.Zero) + return null; + + return CFString.AsString (settings[kCFNetworkProxiesHTTPProxy]); + } + } + + public bool ProxyAutoConfigEnable { + get { + if (kCFNetworkProxiesProxyAutoConfigEnable == IntPtr.Zero) + return false; + + return CFNumber.AsBool (settings[kCFNetworkProxiesProxyAutoConfigEnable]); + } + } + + public string ProxyAutoConfigJavaScript { + get { + if (kCFNetworkProxiesProxyAutoConfigJavaScript == IntPtr.Zero) + return null; + + return CFString.AsString (settings[kCFNetworkProxiesProxyAutoConfigJavaScript]); + } + } + + public string ProxyAutoConfigURLString { + get { + if (kCFNetworkProxiesProxyAutoConfigURLString == IntPtr.Zero) + return null; + + return CFString.AsString (settings[kCFNetworkProxiesProxyAutoConfigURLString]); + } + } + } + + internal static class CFNetwork { +#if !MONOTOUCH + public const string CFNetworkLibrary = "/System/Library/Frameworks/CoreServices.framework/Frameworks/CFNetwork.framework/CFNetwork"; +#else + public const string CFNetworkLibrary = "/System/Library/Frameworks/CFNetwork.framework/CFNetwork"; +#endif + + [DllImport (CFNetworkLibrary)] + // CFArrayRef CFNetworkCopyProxiesForAutoConfigurationScript (CFStringRef proxyAutoConfigurationScript, CFURLRef targetURL); + extern static IntPtr CFNetworkCopyProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, IntPtr targetURL); + + static CFArray CopyProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, CFUrl targetURL) + { + IntPtr native = CFNetworkCopyProxiesForAutoConfigurationScript (proxyAutoConfigurationScript, targetURL.Handle); + + if (native == IntPtr.Zero) + return null; + + return new CFArray (native, true); + } + + public static CFProxy[] GetProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, CFUrl targetURL) + { + if (proxyAutoConfigurationScript == IntPtr.Zero) + throw new ArgumentNullException ("proxyAutoConfigurationScript"); + + if (targetURL == null) + throw new ArgumentNullException ("targetURL"); + + CFArray array = CopyProxiesForAutoConfigurationScript (proxyAutoConfigurationScript, targetURL); + + if (array == null) + return null; + + CFProxy[] proxies = new CFProxy [array.Count]; + for (int i = 0; i < proxies.Length; i++) { + CFDictionary dict = new CFDictionary (array[i], false); + proxies[i] = new CFProxy (dict); + } + + array.Dispose (); + + return proxies; + } + + public static CFProxy[] GetProxiesForAutoConfigurationScript (IntPtr proxyAutoConfigurationScript, Uri targetUri) + { + if (proxyAutoConfigurationScript == IntPtr.Zero) + throw new ArgumentNullException ("proxyAutoConfigurationScript"); + + if (targetUri == null) + throw new ArgumentNullException ("targetUri"); + + CFUrl targetURL = CFUrl.Create (targetUri.AbsoluteUri); + CFProxy[] proxies = GetProxiesForAutoConfigurationScript (proxyAutoConfigurationScript, targetURL); + targetURL.Dispose (); + + return proxies; + } + + [DllImport (CFNetworkLibrary)] + // CFArrayRef CFNetworkCopyProxiesForURL (CFURLRef url, CFDictionaryRef proxySettings); + extern static IntPtr CFNetworkCopyProxiesForURL (IntPtr url, IntPtr proxySettings); + + static CFArray CopyProxiesForURL (CFUrl url, CFDictionary proxySettings) + { + IntPtr native = CFNetworkCopyProxiesForURL (url.Handle, proxySettings != null ? proxySettings.Handle : IntPtr.Zero); + + if (native == IntPtr.Zero) + return null; + + return new CFArray (native, true); + } + + public static CFProxy[] GetProxiesForURL (CFUrl url, CFProxySettings proxySettings) + { + if (url == null || url.Handle == IntPtr.Zero) + throw new ArgumentNullException ("url"); + + if (proxySettings == null) + proxySettings = GetSystemProxySettings (); + + CFArray array = CopyProxiesForURL (url, proxySettings.Dictionary); + + if (array == null) + return null; + + CFProxy[] proxies = new CFProxy [array.Count]; + for (int i = 0; i < proxies.Length; i++) { + CFDictionary dict = new CFDictionary (array[i], false); + proxies[i] = new CFProxy (dict); + } + + array.Dispose (); + + return proxies; + } + + public static CFProxy[] GetProxiesForUri (Uri uri, CFProxySettings proxySettings) + { + if (uri == null) + throw new ArgumentNullException ("uri"); + + CFUrl url = CFUrl.Create (uri.AbsoluteUri); + if (url == null) + return null; + + CFProxy[] proxies = GetProxiesForURL (url, proxySettings); + url.Dispose (); + + return proxies; + } + + [DllImport (CFNetworkLibrary)] + // CFDictionaryRef CFNetworkCopySystemProxySettings (void); + extern static IntPtr CFNetworkCopySystemProxySettings (); + + public static CFProxySettings GetSystemProxySettings () + { + IntPtr native = CFNetworkCopySystemProxySettings (); + + if (native == IntPtr.Zero) + return null; + + var dict = new CFDictionary (native, true); + + return new CFProxySettings (dict); + } + + class CFWebProxy : IWebProxy { + public CFWebProxy () + { + + } + + public ICredentials Credentials { + get; set; + } + + static Uri GetProxyUri (CFProxy proxy) + { + string protocol; + + switch (proxy.ProxyType) { + case CFProxyType.FTP: + protocol = "ftp://"; + break; + case CFProxyType.HTTP: + case CFProxyType.HTTPS: + protocol = "http://"; + break; + default: + return null; + } + + string username = proxy.Username; + string password = proxy.Password; + string hostname = proxy.HostName; + int port = proxy.Port; + string userinfo; + string uri; + + if (username != null) { + if (password != null) + userinfo = Uri.EscapeDataString (username) + ':' + Uri.EscapeDataString (password) + '@'; + else + userinfo = Uri.EscapeDataString (username) + '@'; + } else { + userinfo = string.Empty; + } + + uri = protocol + userinfo + hostname + (port != 0 ? ':' + port.ToString () : string.Empty); + + return new Uri (uri, UriKind.Absolute); + } + + static Uri GetProxyUriFromScript (IntPtr script, Uri targetUri) + { + CFProxy[] proxies = CFNetwork.GetProxiesForAutoConfigurationScript (script, targetUri); + + if (proxies == null) + return targetUri; + + for (int i = 0; i < proxies.Length; i++) { + switch (proxies[i].ProxyType) { + case CFProxyType.HTTPS: + case CFProxyType.HTTP: + case CFProxyType.FTP: + // create a Uri based on the hostname/port/etc info + return GetProxyUri (proxies[i]); + case CFProxyType.SOCKS: + default: + // unsupported proxy type, try the next one + break; + case CFProxyType.None: + // no proxy should be used + return targetUri; + } + } + + return null; + } + + public Uri GetProxy (Uri targetUri) + { + if (targetUri == null) + throw new ArgumentNullException ("targetUri"); + + try { + CFProxySettings settings = CFNetwork.GetSystemProxySettings (); + CFProxy[] proxies = CFNetwork.GetProxiesForUri (targetUri, settings); + Uri uri; + + if (proxies == null) + return targetUri; + + for (int i = 0; i < proxies.Length; i++) { + switch (proxies[i].ProxyType) { + case CFProxyType.AutoConfigurationJavaScript: + if ((uri = GetProxyUriFromScript (proxies[i].AutoConfigurationJavaScript, targetUri)) != null) + return uri; + break; + case CFProxyType.AutoConfigurationUrl: + // unsupported proxy type (requires fetching script from remote url) + break; + case CFProxyType.HTTPS: + case CFProxyType.HTTP: + case CFProxyType.FTP: + // create a Uri based on the hostname/port/etc info + return GetProxyUri (proxies[i]); + case CFProxyType.SOCKS: + // unsupported proxy type, try the next one + break; + case CFProxyType.None: + // no proxy should be used + return targetUri; + } + } + } catch { + // ignore errors while retrieving proxy data + } + // no supported proxies for this Uri, fall back to trying to connect to targetUri directly. + return targetUri; + } + + public bool IsBypassed (Uri targetUri) + { + if (targetUri == null) + throw new ArgumentNullException ("targetUri"); + + return GetProxy (targetUri) == targetUri; + } + } + + static CFWebProxy defaultWebProxy; + public static IWebProxy GetDefaultProxy () + { + if (defaultWebProxy == null) + defaultWebProxy = new CFWebProxy (); + + return defaultWebProxy; + } + } +} diff --git a/mcs/class/System/System.Net/NetworkAccess.cs b/mcs/class/System/System.Net/NetworkAccess.cs index af134a0305b..cc56568c7eb 100644 --- a/mcs/class/System/System.Net/NetworkAccess.cs +++ b/mcs/class/System/System.Net/NetworkAccess.cs @@ -32,9 +32,7 @@ namespace System.Net { -#if NET_2_0 [Flags] -#endif public enum NetworkAccess { Accept = 128, diff --git a/mcs/class/System/System.Net/OpenReadCompletedEventArgs.cs b/mcs/class/System/System.Net/OpenReadCompletedEventArgs.cs index 2fb6bed4827..6bf153853e5 100644 --- a/mcs/class/System/System.Net/OpenReadCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/OpenReadCompletedEventArgs.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.ComponentModel; using System.IO; @@ -55,4 +54,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/OpenReadCompletedEventHandler.cs b/mcs/class/System/System.Net/OpenReadCompletedEventHandler.cs index fec0f45f4ac..a9389eea305 100644 --- a/mcs/class/System/System.Net/OpenReadCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/OpenReadCompletedEventHandler.cs @@ -25,12 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void OpenReadCompletedEventHandler (object sender, OpenReadCompletedEventArgs e); } - -#endif diff --git a/mcs/class/System/System.Net/OpenWriteCompletedEventArgs.cs b/mcs/class/System/System.Net/OpenWriteCompletedEventArgs.cs index 7191efe49a3..335249fd5b8 100644 --- a/mcs/class/System/System.Net/OpenWriteCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/OpenWriteCompletedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; using System.IO; @@ -55,5 +53,3 @@ namespace System.Net } } } - -#endif diff --git a/mcs/class/System/System.Net/OpenWriteCompletedEventHandler.cs b/mcs/class/System/System.Net/OpenWriteCompletedEventHandler.cs index a0fe51dfd09..7b202d82d6d 100644 --- a/mcs/class/System/System.Net/OpenWriteCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/OpenWriteCompletedEventHandler.cs @@ -25,12 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void OpenWriteCompletedEventHandler (object sender, OpenWriteCompletedEventArgs e); } - -#endif diff --git a/mcs/class/System/System.Net/RequestStream.cs b/mcs/class/System/System.Net/RequestStream.cs index 748808f4be0..0ea866d621a 100644 --- a/mcs/class/System/System.Net/RequestStream.cs +++ b/mcs/class/System/System.Net/RequestStream.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.IO; using System.Net.Sockets; using System.Runtime.InteropServices; @@ -220,5 +219,4 @@ namespace System.Net { } } } -#endif diff --git a/mcs/class/System/System.Net/ResponseStream.cs b/mcs/class/System/System.Net/ResponseStream.cs index 31a0e66faa8..860509b9ace 100644 --- a/mcs/class/System/System.Net/ResponseStream.cs +++ b/mcs/class/System/System.Net/ResponseStream.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.IO; using System.Net.Sockets; @@ -101,11 +101,14 @@ namespace System.Net { MemoryStream GetHeaders (bool closing) { - if (response.HeadersSent) - return null; - MemoryStream ms = new MemoryStream (); - response.SendHeaders (closing, ms); - return ms; + // SendHeaders works on shared headers + lock (response.headers_lock) { + if (response.HeadersSent) + return null; + MemoryStream ms = new MemoryStream (); + response.SendHeaders (closing, ms); + return ms; + } } public override void Flush () diff --git a/mcs/class/System/System.Net/SecurityProtocolType.cs b/mcs/class/System/System.Net/SecurityProtocolType.cs index d68ab6e25d3..54ea620ead7 100644 --- a/mcs/class/System/System.Net/SecurityProtocolType.cs +++ b/mcs/class/System/System.Net/SecurityProtocolType.cs @@ -30,9 +30,6 @@ namespace System.Net { [Flags] -#if !NET_2_0 - [Serializable] -#endif public enum SecurityProtocolType { Ssl3 = 48, diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs index fd412ee6956..12895c441dc 100644 --- a/mcs/class/System/System.Net/ServicePoint.cs +++ b/mcs/class/System/System.Net/ServicePoint.cs @@ -78,7 +78,6 @@ namespace System.Net get { return uri; } } -#if NET_2_0 static Exception GetMustImplement () { return new NotImplementedException (); @@ -89,7 +88,6 @@ namespace System.Net get { return endPointCallback; } set { endPointCallback = value; } } -#endif public X509Certificate Certificate { get { return certificate; } @@ -99,7 +97,6 @@ namespace System.Net get { return clientCertificate; } } -#if NET_2_0 [MonoTODO] public int ConnectionLeaseTimeout { @@ -110,7 +107,6 @@ namespace System.Net throw GetMustImplement (); } } -#endif public int ConnectionLimit { get { return connectionLimit; } @@ -155,7 +151,6 @@ namespace System.Net get { return protocolVersion; } } -#if NET_2_0 [MonoTODO] public int ReceiveBufferSize { @@ -166,13 +161,12 @@ namespace System.Net throw GetMustImplement (); } } -#endif public bool SupportsPipelining { get { return HttpVersion.Version11.Equals (protocolVersion); } } -#if NET_1_1 + public bool Expect100Continue { get { return SendContinue; } set { SendContinue = value; } @@ -182,7 +176,6 @@ namespace System.Net get { return useNagle; } set { useNagle = value; } } -#endif internal bool SendContinue { get { return sendContinue && @@ -232,13 +225,6 @@ namespace System.Net } } -#if !NET_2_0 - public override int GetHashCode() - { - return base.GetHashCode (); - } -#endif - // Internal Methods internal bool UsesProxy { @@ -338,7 +324,6 @@ namespace System.Net return cnc.SendRequest (request); } #endif -#if NET_2_0 public bool CloseConnectionGroup (string connectionGroupName) { lock (locker) { @@ -351,7 +336,6 @@ namespace System.Net return false; } -#endif internal void IncrementConnection () { @@ -376,7 +360,6 @@ namespace System.Net clientCertificate = client; } -#if NET_2_0 internal bool CallEndPointDelegate (Socket sock, IPEndPoint remote) { if (endPointCallback == null) @@ -412,7 +395,6 @@ namespace System.Net return true; } } -#endif } } diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs index 3e35e93a867..3f14b29396f 100644 --- a/mcs/class/System/System.Net/ServicePointManager.cs +++ b/mcs/class/System/System.Net/ServicePointManager.cs @@ -114,14 +114,12 @@ namespace System.Net private static bool _checkCRL = false; private static SecurityProtocolType _securityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls; -#if NET_1_1 #if TARGET_JVM static bool expectContinue = false; #else static bool expectContinue = true; #endif static bool useNagle; -#endif static RemoteCertificateValidationCallback server_cert_cb; static bool tcp_keepalive; static int tcp_keepalive_time; @@ -140,7 +138,7 @@ namespace System.Net static ServicePointManager () { #if !NET_2_1 -#if NET_2_0 && CONFIGURATION_DEP +#if CONFIGURATION_DEP object cfg = ConfigurationManager.GetSection (configKey); ConnectionManagementSection s = cfg as ConnectionManagementSection; if (s != null) { @@ -166,22 +164,14 @@ namespace System.Net // Properties -#if NET_2_0 [Obsolete ("Use ServerCertificateValidationCallback instead", false)] -#endif public static ICertificatePolicy CertificatePolicy { get { return policy; } set { policy = value; } } -#if NET_1_0 - // we need it for SslClientStream - internal -#else [MonoTODO("CRL checks not implemented")] - public -#endif - static bool CheckCertificateRevocationList { + public static bool CheckCertificateRevocationList { get { return _checkCRL; } set { _checkCRL = false; } // TODO - don't yet accept true } @@ -196,7 +186,6 @@ namespace System.Net } } -#if NET_2_0 static Exception GetMustImplement () { return new NotImplementedException (); @@ -223,7 +212,6 @@ namespace System.Net throw GetMustImplement (); } } -#endif public static int MaxServicePointIdleTime { get { @@ -270,7 +258,6 @@ namespace System.Net } } -#if NET_1_1 public static bool Expect100Continue { get { return expectContinue; } set { expectContinue = value; } @@ -280,7 +267,7 @@ namespace System.Net get { return useNagle; } set { useNagle = value; } } -#endif + // Methods public static void SetTcpKeepAlive (bool enabled, int keepAliveTime, int keepAliveInterval) { @@ -410,7 +397,7 @@ namespace System.Net return new ValidationResult (true, false, 0); } } -#elif NET_2_0 && SECURITY_DEP +#elif SECURITY_DEP internal class ChainValidationHelper { object sender; string host; @@ -508,7 +495,7 @@ namespace System.Net #endif // Attempt to use OSX certificates // Ideally we should return the SecTrustResult - MSX.OSX509Certificates.SecTrustResult trustResult; + MSX.OSX509Certificates.SecTrustResult trustResult = MSX.OSX509Certificates.SecTrustResult.Deny; try { trustResult = MSX.OSX509Certificates.TrustEvaluateSsl (certs); // We could use the other values of trustResult to pass this extra information @@ -523,6 +510,10 @@ namespace System.Net if (result) { status11 = 0; errors = 0; + } else { + // callback and DefaultCertificatePolicy needs this since 'result' is not specified + status11 = (int) trustResult; + errors |= SslPolicyErrors.RemoteCertificateChainErrors; } #if !MONOTOUCH } diff --git a/mcs/class/System/System.Net/UploadDataCompletedEventArgs.cs b/mcs/class/System/System.Net/UploadDataCompletedEventArgs.cs index e305ed89461..dd4d6059513 100644 --- a/mcs/class/System/System.Net/UploadDataCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/UploadDataCompletedEventArgs.cs @@ -27,7 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.ComponentModel; using System.IO; @@ -51,4 +50,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/UploadDataCompletedEventHandler.cs b/mcs/class/System/System.Net/UploadDataCompletedEventHandler.cs index 41a4c9115fd..08794d6b12c 100644 --- a/mcs/class/System/System.Net/UploadDataCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/UploadDataCompletedEventHandler.cs @@ -25,12 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void UploadDataCompletedEventHandler (object sender, UploadDataCompletedEventArgs e); } - -#endif diff --git a/mcs/class/System/System.Net/UploadFileCompletedEventArgs.cs b/mcs/class/System/System.Net/UploadFileCompletedEventArgs.cs index cb0c712e1d1..b764cffbf10 100644 --- a/mcs/class/System/System.Net/UploadFileCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/UploadFileCompletedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; using System.IO; @@ -51,4 +49,3 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/UploadFileCompletedEventHandler.cs b/mcs/class/System/System.Net/UploadFileCompletedEventHandler.cs index 7983ded297d..3a380b1d4b7 100644 --- a/mcs/class/System/System.Net/UploadFileCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/UploadFileCompletedEventHandler.cs @@ -25,12 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void UploadFileCompletedEventHandler (object sender, UploadFileCompletedEventArgs e); } - -#endif diff --git a/mcs/class/System/System.Net/UploadProgressChangedEventHandler.cs b/mcs/class/System/System.Net/UploadProgressChangedEventHandler.cs index 08bfa60b0ad..af1853e5c60 100644 --- a/mcs/class/System/System.Net/UploadProgressChangedEventHandler.cs +++ b/mcs/class/System/System.Net/UploadProgressChangedEventHandler.cs @@ -25,12 +25,8 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void UploadProgressChangedEventHandler (object sender, UploadProgressChangedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Net/UploadStringCompletedEventArgs.cs b/mcs/class/System/System.Net/UploadStringCompletedEventArgs.cs index dfef2c9ba0e..116c87f252d 100644 --- a/mcs/class/System/System.Net/UploadStringCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/UploadStringCompletedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; namespace System.Net @@ -54,5 +52,3 @@ namespace System.Net } } } - -#endif diff --git a/mcs/class/System/System.Net/UploadStringCompletedEventHandler.cs b/mcs/class/System/System.Net/UploadStringCompletedEventHandler.cs index 799da8e0571..059ffe2cd21 100644 --- a/mcs/class/System/System.Net/UploadStringCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/UploadStringCompletedEventHandler.cs @@ -25,12 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void UploadStringCompletedEventHandler (object sender, UploadStringCompletedEventArgs e); } - -#endif diff --git a/mcs/class/System/System.Net/UploadValuesCompletedEventArgs.cs b/mcs/class/System/System.Net/UploadValuesCompletedEventArgs.cs index 4720486c58e..352ca58342b 100644 --- a/mcs/class/System/System.Net/UploadValuesCompletedEventArgs.cs +++ b/mcs/class/System/System.Net/UploadValuesCompletedEventArgs.cs @@ -27,8 +27,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; using System.IO; @@ -50,5 +48,3 @@ namespace System.Net } } } - -#endif diff --git a/mcs/class/System/System.Net/UploadValuesCompletedEventHandler.cs b/mcs/class/System/System.Net/UploadValuesCompletedEventHandler.cs index acf201982a9..41f8ab3b8ff 100644 --- a/mcs/class/System/System.Net/UploadValuesCompletedEventHandler.cs +++ b/mcs/class/System/System.Net/UploadValuesCompletedEventHandler.cs @@ -25,12 +25,8 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - - namespace System.Net { public delegate void UploadValuesCompletedEventHandler (object sender, UploadValuesCompletedEventArgs e); } -#endif diff --git a/mcs/class/System/System.Net/WebClient.cs b/mcs/class/System/System.Net/WebClient.cs index 07abdc8b940..7bed211b1e2 100644 --- a/mcs/class/System/System.Net/WebClient.cs +++ b/mcs/class/System/System.Net/WebClient.cs @@ -6,6 +6,7 @@ // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Atsushi Enomoto (atsushi@ximian.com) // Miguel de Icaza (miguel@ximian.com) +// Martin Baulig (martin.baulig@googlemail.com) // // Copyright 2003 Ximian, Inc. (http://www.ximian.com) // Copyright 2006, 2010 Novell, Inc. (http://www.novell.com) @@ -68,6 +69,9 @@ using System.Runtime.Serialization; using System.Text; using System.Threading; using System.Net.Cache; +#if NET_4_5 +using System.Threading.Tasks; +#endif namespace System.Net { @@ -89,6 +93,9 @@ namespace System.Net Encoding encoding = Encoding.Default; IWebProxy proxy; // RequestCachePolicy cache_policy; +#if NET_4_5 + CancellationTokenSource cts; +#endif // Constructors static WebClient () @@ -205,7 +212,13 @@ namespace System.Net } public bool IsBusy { - get { return is_busy; } + get { +#if NET_4_5 + return is_busy || (cts != null); +#else + return is_busy; +#endif + } } // Methods @@ -1000,6 +1013,13 @@ namespace System.Net public void CancelAsync () { lock (this){ +#if NET_4_5 + if (cts != null) { + cts.Cancel (); + return; + } +#endif + if (async_thread == null) return; @@ -1017,9 +1037,14 @@ namespace System.Net void CompleteAsync () { - lock (this){ + lock (this) { is_busy = false; async_thread = null; +#if NET_4_5 + if (cts != null) + cts.Dispose (); + cts = null; +#endif } } @@ -1474,6 +1499,699 @@ namespace System.Net responseHeaders = response.Headers; return response; } + +#if NET_4_5 + + // DownloadDataTaskAsync + + public Task DownloadDataTaskAsync (string address) + { + return DownloadDataTaskAsync (CreateUri (address)); + } + + public async Task DownloadDataTaskAsync (Uri address) + { + WebRequest request = null; + WebResponse response = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address); + response = await GetWebResponseTaskAsync (request, cts.Token); + var result = await ReadAllTaskAsync (request, response, cts.Token); + OnDownloadDataCompleted (new DownloadDataCompletedEventArgs (result, null, false, null)); + return result; + } catch (WebException ex) { + OnDownloadDataCompleted (new DownloadDataCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnDownloadDataCompleted (new DownloadDataCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnDownloadDataCompleted (new DownloadDataCompletedEventArgs (null, ex, true, null)); + throw new WebException ("An error occurred performing a WebClient request.", ex); + } finally { + if (response != null) + response.Close (); + } + } + + Task SetupRequestAsync (Uri address) + { + return Task.Factory.StartNew (() => SetupRequest (address)); + } + + async Task SetupRequestAsync (Uri address, string method, bool is_upload) + { + WebRequest request = await SetupRequestAsync (address); + request.Method = DetermineMethod (address, method, is_upload); + return request; + } + + async Task GetWebResponseTaskAsync (WebRequest request, CancellationToken token) + { + token.ThrowIfCancellationRequested (); + WebResponse response = await request.GetResponseAsync (); + token.ThrowIfCancellationRequested (); + responseHeaders = response.Headers; + return response; + } + + async Task ReadAllTaskAsync (WebRequest request, WebResponse response, CancellationToken token) + { + Stream stream = response.GetResponseStream (); + int length = (int)response.ContentLength; + HttpWebRequest wreq = request as HttpWebRequest; + + if (length > -1 && wreq != null && (int)wreq.AutomaticDecompression != 0) { + string content_encoding = ((HttpWebResponse)response).ContentEncoding; + if (((content_encoding == "gzip" && (wreq.AutomaticDecompression & DecompressionMethods.GZip) != 0)) || + ((content_encoding == "deflate" && (wreq.AutomaticDecompression & DecompressionMethods.Deflate) != 0))) + length = -1; + } + + MemoryStream ms = null; + bool nolength = (length == -1); + int size = ((nolength) ? 8192 : length); + if (nolength) + ms = new MemoryStream (); + + long total = 0; + int nread = 0; + int offset = 0; + byte [] buffer = new byte [size]; + token.ThrowIfCancellationRequested (); + while ((nread = await stream.ReadAsync (buffer, offset, size, token)) != 0) { + if (nolength) { + ms.Write (buffer, 0, nread); + } else { + offset += nread; + size -= nread; + } + total += nread; + OnDownloadProgressChanged (new DownloadProgressChangedEventArgs (total, length, null)); + token.ThrowIfCancellationRequested (); + } + + return nolength ? ms.ToArray () : buffer; + } + + // DownloadFileTaskAsync + + public Task DownloadFileTaskAsync (string address, string fileName) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return DownloadFileTaskAsync (CreateUri (address), fileName); + } + + public async Task DownloadFileTaskAsync (Uri address, string fileName) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (fileName == null) + throw new ArgumentNullException ("fileName"); + + WebRequest request = null; + WebResponse response = null; + + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address); + response = await GetWebResponseTaskAsync (request, cts.Token); + await DownloadFileTaskAsyncCore (request, response, fileName, cts.Token); + OnDownloadFileCompleted (new AsyncCompletedEventArgs (null, false, null)); + } catch (WebException ex) { + OnDownloadFileCompleted (new AsyncCompletedEventArgs (ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnDownloadFileCompleted (new AsyncCompletedEventArgs (null, true, null)); + throw; + } catch (Exception ex) { + OnDownloadFileCompleted (new AsyncCompletedEventArgs (ex, false, null)); + throw new WebException ("An error occurred " + + "performing a WebClient request.", ex); + } finally { + if (response != null) + response.Close (); + } + } + + async Task DownloadFileTaskAsyncCore (WebRequest request, WebResponse response, + string fileName, CancellationToken token) + { + using (FileStream f = new FileStream (fileName, FileMode.Create)) { + Stream st = response.GetResponseStream (); + + int cLength = (int)response.ContentLength; + int length = (cLength <= -1 || cLength > 32 * 1024) ? 32 * 1024 : cLength; + byte [] buffer = new byte [length]; + + int nread = 0; + long notify_total = 0; + token.ThrowIfCancellationRequested (); + while ((nread = await st.ReadAsync (buffer, 0, length, token)) != 0) { + notify_total += nread; + OnDownloadProgressChanged ( + new DownloadProgressChangedEventArgs (notify_total, response.ContentLength, null)); + token.ThrowIfCancellationRequested (); + await f.WriteAsync (buffer, 0, nread, token); + token.ThrowIfCancellationRequested (); + } + } + } + + // OpenReadTaskAsync + + public Task OpenReadTaskAsync (string address) + { + if (address == null) + throw new ArgumentNullException ("address"); + return OpenReadTaskAsync (CreateUri (address)); + } + + public async Task OpenReadTaskAsync (Uri address) + { + if (address == null) + throw new ArgumentNullException ("address"); + + WebRequest request = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address); + WebResponse response = await GetWebResponseTaskAsync (request, cts.Token); + var result = response.GetResponseStream (); + cts.Token.ThrowIfCancellationRequested (); + OnOpenReadCompleted (new OpenReadCompletedEventArgs (result, null, false, null)); + return result; + } catch (WebException ex) { + OnOpenReadCompleted (new OpenReadCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnOpenReadCompleted (new OpenReadCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnOpenReadCompleted (new OpenReadCompletedEventArgs (null, ex, false, null)); + throw new WebException ("An error occurred " + + "performing a WebClient request.", ex); + } + } + + // DownloadStringTaskAsync + + public Task DownloadStringTaskAsync (string address) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return DownloadStringTaskAsync (CreateUri (address)); + } + + public async Task DownloadStringTaskAsync (Uri address) + { + if (address == null) + throw new ArgumentNullException ("address"); + + WebRequest request = null; + WebResponse response = null; + + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address); + response = await GetWebResponseTaskAsync (request, cts.Token); + var data = await ReadAllTaskAsync (request, response, cts.Token); + cts.Token.ThrowIfCancellationRequested (); + var text = encoding.GetString (data); + OnDownloadStringCompleted (new DownloadStringCompletedEventArgs (text, null, false, null)); + return text; + } catch (WebException ex) { + OnDownloadStringCompleted (new DownloadStringCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnDownloadStringCompleted (new DownloadStringCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnDownloadStringCompleted (new DownloadStringCompletedEventArgs (null, ex, true, null)); + throw new WebException ("An error occurred performing a WebClient request.", ex); + } finally { + if (response != null) + response.Close (); + } + } + + // OpenWriteTaskAsync + + public Task OpenWriteTaskAsync (string address) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return OpenWriteTaskAsync (CreateUri (address)); + } + + public Task OpenWriteTaskAsync (string address, string method) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return OpenWriteTaskAsync (CreateUri (address), method); + } + + public Task OpenWriteTaskAsync (Uri address) + { + return OpenWriteTaskAsync (address, (string) null); + } + + public async Task OpenWriteTaskAsync (Uri address, string method) + { + if (address == null) + throw new ArgumentNullException ("address"); + + WebRequest request = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = SetupRequest (address); + return await request.GetRequestStreamAsync (); + } catch (WebException) { + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + throw; + } catch (Exception ex) { + throw new WebException ("An error occurred " + + "performing a WebClient request.", ex); + } finally { + CompleteAsync (); + } + } + + // UploadDataTaskAsync + + public Task UploadDataTaskAsync (string address, byte [] data) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return UploadDataTaskAsync (CreateUri (address), data); + } + + public Task UploadDataTaskAsync (string address, string method, byte [] data) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return UploadDataTaskAsync (CreateUri (address), method, data); + } + + public Task UploadDataTaskAsync (Uri address, byte [] data) + { + return UploadDataTaskAsync (address, (string) null, data); + } + + public async Task UploadDataTaskAsync (Uri address, string method, byte [] data) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (data == null) + throw new ArgumentNullException ("data"); + + WebRequest request = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address, method, true); + var result = await UploadDataTaskAsyncCore (request, data, cts.Token); + OnUploadDataCompleted (new UploadDataCompletedEventArgs (result, null, false, null)); + return result; + } catch (WebException ex) { + OnUploadDataCompleted (new UploadDataCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnUploadDataCompleted (new UploadDataCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnUploadDataCompleted (new UploadDataCompletedEventArgs (null, ex, true, null)); + throw new WebException ("An error occurred performing a WebClient request.", ex); + } + } + + async Task UploadDataTaskAsyncCore (WebRequest request, byte[] data, CancellationToken token) + { + token.ThrowIfCancellationRequested (); + + int contentLength = data.Length; + request.ContentLength = contentLength; + using (Stream stream = await request.GetRequestStreamAsync ()) { + token.ThrowIfCancellationRequested (); + await stream.WriteAsync (data, 0, contentLength, token); + token.ThrowIfCancellationRequested (); + } + + WebResponse response = null; + + try { + response = await GetWebResponseTaskAsync (request, token); + return await ReadAllTaskAsync (request, response, token); + } finally { + if (response != null) + response.Close (); + } + } + + // UploadFileTaskAsync + + public Task UploadFileTaskAsync (string address, string fileName) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return UploadFileTaskAsync (CreateUri (address), fileName); + } + + public Task UploadFileTaskAsync (Uri address, string fileName) + { + return UploadFileTaskAsync (address, (string) null, fileName); + } + + public Task UploadFileTaskAsync (string address, string method, string fileName) + { + return UploadFileTaskAsync (CreateUri (address), method, fileName); + } + + public async Task UploadFileTaskAsync (Uri address, string method, string fileName) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (fileName == null) + throw new ArgumentNullException ("fileName"); + + WebRequest request = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address, method, true); + var result = await UploadFileTaskAsyncCore (request, method, fileName, cts.Token); + OnUploadFileCompleted (new UploadFileCompletedEventArgs (result, null, false, null)); + return result; + } catch (WebException ex) { + OnUploadFileCompleted (new UploadFileCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnUploadFileCompleted (new UploadFileCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnUploadFileCompleted (new UploadFileCompletedEventArgs (null, ex, true, null)); + throw new WebException ("An error occurred performing a WebClient request.", ex); + } + } + + async Task UploadFileTaskAsyncCore (WebRequest request, string method, + string fileName, CancellationToken token) + { + token.ThrowIfCancellationRequested (); + + string fileCType = Headers ["Content-Type"]; + if (fileCType != null) { + string lower = fileCType.ToLower (); + if (lower.StartsWith ("multipart/")) + throw new WebException ("Content-Type cannot be set to a multipart" + + " type for this request."); + } else { + fileCType = "application/octet-stream"; + } + + bool needs_boundary = (method != "PUT"); // only verified case so far + string boundary = null; + if (needs_boundary) { + boundary = "------------" + DateTime.Now.Ticks.ToString ("x"); + Headers ["Content-Type"] = String.Format ("multipart/form-data; boundary={0}", boundary); + } + Stream reqStream = null; + Stream fStream = null; + WebResponse response = null; + + fileName = Path.GetFullPath (fileName); + + try { + fStream = File.OpenRead (fileName); + token.ThrowIfCancellationRequested (); + reqStream = await request.GetRequestStreamAsync (); + token.ThrowIfCancellationRequested (); + byte [] bytes_boundary = null; + if (needs_boundary) { + bytes_boundary = Encoding.ASCII.GetBytes (boundary); + using (MemoryStream ms = new MemoryStream ()) { + ms.WriteByte ((byte) '-'); + ms.WriteByte ((byte) '-'); + ms.Write (bytes_boundary, 0, bytes_boundary.Length); + ms.WriteByte ((byte) '\r'); + ms.WriteByte ((byte) '\n'); + string partHeaders = String.Format ( + "Content-Disposition: form-data; " + + "name=\"file\"; filename=\"{0}\"\r\n" + + "Content-Type: {1}\r\n\r\n", + Path.GetFileName (fileName), fileCType); + byte [] partHeadersBytes = Encoding.UTF8.GetBytes (partHeaders); + ms.Write (partHeadersBytes, 0, partHeadersBytes.Length); + await ms.CopyToAsync (reqStream, (int)ms.Position, token); + } + } + int nread; + long bytes_sent = 0; + long file_size = -1; + long step = 16384; // every 16kB + if (fStream.CanSeek) { + file_size = fStream.Length; + step = file_size / 100; + } + var upload_args = new UploadProgressChangedEventArgs (0, 0, bytes_sent, file_size, 0, null); + OnUploadProgressChanged (upload_args); + byte [] buffer = new byte [4096]; + long sum = 0; + token.ThrowIfCancellationRequested (); + while ((nread = await fStream.ReadAsync (buffer, 0, 4096, token)) > 0) { + token.ThrowIfCancellationRequested (); + await reqStream.WriteAsync (buffer, 0, nread, token); + bytes_sent += nread; + sum += nread; + if (sum >= step || nread < 4096) { + int percent = 0; + if (file_size > 0) + percent = (int) (bytes_sent * 100 / file_size); + upload_args = new UploadProgressChangedEventArgs (0, 0, bytes_sent, file_size, percent, null); + OnUploadProgressChanged (upload_args); + sum = 0; + } + } + + if (needs_boundary) { + using (MemoryStream ms = new MemoryStream ()) { + ms.WriteByte ((byte) '\r'); + ms.WriteByte ((byte) '\n'); + ms.WriteByte ((byte) '-'); + ms.WriteByte ((byte) '-'); + ms.Write (bytes_boundary, 0, bytes_boundary.Length); + ms.WriteByte ((byte) '-'); + ms.WriteByte ((byte) '-'); + ms.WriteByte ((byte) '\r'); + ms.WriteByte ((byte) '\n'); + await ms.CopyToAsync (reqStream, (int)ms.Position, token); + } + } + reqStream.Close (); + reqStream = null; + + response = await GetWebResponseTaskAsync (request, token); + return await ReadAllTaskAsync (request, response, token); + } finally { + if (fStream != null) + fStream.Close (); + + if (reqStream != null) + reqStream.Close (); + + if (response != null) + response.Close (); + } + } + + // UploadStringTaskAsync + + public Task UploadStringTaskAsync (string address, string data) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (data == null) + throw new ArgumentNullException ("data"); + + return UploadStringTaskAsync (CreateUri (address), null, data); + } + + public Task UploadStringTaskAsync (string address, string method, string data) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (data == null) + throw new ArgumentNullException ("data"); + + return UploadStringTaskAsync (CreateUri (address), method, data); + } + + public Task UploadStringTaskAsync (Uri address, string data) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (data == null) + throw new ArgumentNullException ("data"); + + return UploadStringTaskAsync (address, null, data); + } + + public async Task UploadStringTaskAsync (Uri address, string method, string data) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (data == null) + throw new ArgumentNullException ("data"); + + WebRequest request = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address, method, true); + var result = await UploadDataTaskAsyncCore (request, encoding.GetBytes (data), cts.Token); + var result_str = encoding.GetString (result); + OnUploadStringCompleted (new UploadStringCompletedEventArgs (result_str, null, false, null)); + return result_str; + } catch (WebException ex) { + OnUploadStringCompleted (new UploadStringCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnUploadStringCompleted (new UploadStringCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnUploadStringCompleted (new UploadStringCompletedEventArgs (null, ex, true, null)); + throw new WebException ("An error occurred performing a WebClient request.", ex); + } + } + + // UploadValuesTaskAsync + + public Task UploadValuesTaskAsync (string address, NameValueCollection data) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return UploadValuesTaskAsync (CreateUri (address), data); + } + + public Task UploadValuesTaskAsync (string address, string method, NameValueCollection data) + { + if (address == null) + throw new ArgumentNullException ("address"); + + return UploadValuesTaskAsync (CreateUri (address), method, data); + } + + public Task UploadValuesTaskAsync (Uri address, NameValueCollection data) + { + return UploadValuesTaskAsync (address, (string) null, data); + } + + public async Task UploadValuesTaskAsync (Uri address, string method, NameValueCollection data) + { + if (address == null) + throw new ArgumentNullException ("address"); + if (data == null) + throw new ArgumentNullException ("data"); + + WebRequest request = null; + try { + SetBusy (); + cts = new CancellationTokenSource (); + request = await SetupRequestAsync (address, method, true); + var result = await UploadValuesTaskAsyncCore (request, data, cts.Token); + OnUploadValuesCompleted (new UploadValuesCompletedEventArgs (result, null, false, null)); + return result; + } catch (WebException ex) { + OnUploadValuesCompleted (new UploadValuesCompletedEventArgs (null, ex, false, null)); + throw; + } catch (OperationCanceledException) { + if (request != null) + request.Abort (); + OnUploadValuesCompleted (new UploadValuesCompletedEventArgs (null, null, true, null)); + throw; + } catch (Exception ex) { + OnUploadValuesCompleted (new UploadValuesCompletedEventArgs (null, ex, true, null)); + throw new WebException ("An error occurred performing a WebClient request.", ex); + } + } + + async Task UploadValuesTaskAsyncCore (WebRequest request, NameValueCollection data, + CancellationToken token) + { + token.ThrowIfCancellationRequested (); + string cType = Headers ["Content-Type"]; + if (cType != null && String.Compare (cType, urlEncodedCType, true) != 0) + throw new WebException ("Content-Type header cannot be changed from its default " + + "value for this request."); + + WebResponse response = null; + + Headers ["Content-Type"] = urlEncodedCType; + try { + MemoryStream tmpStream = new MemoryStream (); + foreach (string key in data) { + byte [] bytes = Encoding.UTF8.GetBytes (key); + UrlEncodeAndWrite (tmpStream, bytes); + tmpStream.WriteByte ((byte) '='); + bytes = Encoding.UTF8.GetBytes (data [key]); + UrlEncodeAndWrite (tmpStream, bytes); + tmpStream.WriteByte ((byte) '&'); + } + + token.ThrowIfCancellationRequested (); + + int length = (int) tmpStream.Length; + if (length > 0) + tmpStream.SetLength (--length); // remove trailing '&' + + byte [] buf = tmpStream.GetBuffer (); + request.ContentLength = length; + using (Stream rqStream = await request.GetRequestStreamAsync ()) { + await rqStream.WriteAsync (buf, 0, length, token); + } + tmpStream.Close (); + + response = await GetWebResponseTaskAsync (request, token); + return await ReadAllTaskAsync (request, response, token); + } finally { + if (response != null) + response.Close (); + } + } + +#endif } } diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs index b8e28b5c08e..6169df13609 100644 --- a/mcs/class/System/System.Net/WebConnection.cs +++ b/mcs/class/System/System.Net/WebConnection.cs @@ -433,7 +433,12 @@ namespace System.Net int nread = -1; try { nread = ns.EndRead (result); + } catch (ObjectDisposedException) { + return; } catch (Exception e) { + if (e.InnerException is ObjectDisposedException) + return; + cnc.HandleError (WebExceptionStatus.ReceiveFailure, e, "ReadDone1"); return; } @@ -655,8 +660,7 @@ namespace System.Net return; keepAlive = request.KeepAlive; - Data = new WebConnectionData (); - Data.request = request; + Data = new WebConnectionData (request); retry: Connect (request); if (request.Aborted) @@ -713,7 +717,8 @@ namespace System.Net { lock (queue) { if (queue.Count > 0) { - SendRequest ((HttpWebRequest) queue.Dequeue ()); + Data.request = (HttpWebRequest) queue.Dequeue (); + SendRequest (Data.request); } } } @@ -1092,7 +1097,7 @@ namespace System.Net lock (this) { lock (queue) { HttpWebRequest req = (HttpWebRequest) sender; - if (Data.request == req) { + if (Data.request == req || Data.request == null) { if (!req.FinishedReading) { status = WebExceptionStatus.RequestCanceled; Close (false); diff --git a/mcs/class/System/System.Net/WebConnectionData.cs b/mcs/class/System/System.Net/WebConnectionData.cs index 82c5a64ab38..0e3b79a2526 100644 --- a/mcs/class/System/System.Net/WebConnectionData.cs +++ b/mcs/class/System/System.Net/WebConnectionData.cs @@ -34,7 +34,7 @@ namespace System.Net { class WebConnectionData { - public HttpWebRequest request; + HttpWebRequest _request; public int StatusCode; public string StatusDescription; public WebHeaderCollection Headers; @@ -42,13 +42,22 @@ namespace System.Net public Stream stream; public string Challenge; - public void Init () + public WebConnectionData () { - request = null; - StatusCode = 0; - StatusDescription = null; - Headers = null; - stream = null; + } + + public WebConnectionData (HttpWebRequest request) + { + this._request = request; + } + + public HttpWebRequest request { + get { + return _request; + } + set { + _request = value; + } } } } diff --git a/mcs/class/System/System.Net/WebConnectionGroup.cs b/mcs/class/System/System.Net/WebConnectionGroup.cs index 80cf2342a54..39253cbad22 100644 --- a/mcs/class/System/System.Net/WebConnectionGroup.cs +++ b/mcs/class/System/System.Net/WebConnectionGroup.cs @@ -115,13 +115,12 @@ namespace System.Net cnc_cred.Password != req_cred.Password) { needs_reset = true; } -#if NET_1_1 + if (!needs_reset) { bool req_sharing = request.UnsafeAuthenticatedConnectionSharing; bool cnc_sharing = cnc.UnsafeAuthenticatedConnectionSharing; needs_reset = (req_sharing == false || req_sharing != cnc_sharing); } -#endif if (needs_reset) { cnc.Close (false); // closes the authenticated connection cnc.ResetNtlm (); diff --git a/mcs/class/System/System.Net/WebConnectionStream.cs b/mcs/class/System/System.Net/WebConnectionStream.cs index a1876e63f57..405d428f568 100644 --- a/mcs/class/System/System.Net/WebConnectionStream.cs +++ b/mcs/class/System/System.Net/WebConnectionStream.cs @@ -137,16 +137,11 @@ namespace System.Net internal WebConnection Connection { get { return cnc; } } -#if NET_2_0 public override bool CanTimeout { get { return true; } } -#endif -#if NET_2_0 - public override -#endif - int ReadTimeout { + public override int ReadTimeout { get { return read_timeout; } @@ -158,10 +153,7 @@ namespace System.Net } } -#if NET_2_0 - public override -#endif - int WriteTimeout { + public override int WriteTimeout { get { return write_timeout; } diff --git a/mcs/class/System/System.Net/WebExceptionStatus.cs b/mcs/class/System/System.Net/WebExceptionStatus.cs index ceeadb9108e..32fa1af8ea2 100644 --- a/mcs/class/System/System.Net/WebExceptionStatus.cs +++ b/mcs/class/System/System.Net/WebExceptionStatus.cs @@ -53,16 +53,13 @@ namespace System.Net Timeout = 14, ProxyNameResolutionFailure = 15, -#if NET_1_1 + UnknownError = 16, MessageLengthLimitExceeded = 17, -#endif -#if NET_2_0 CacheEntryNotFound = 18, RequestProhibitedByCachePolicy = 19, RequestProhibitedByProxy = 20, -#endif } } diff --git a/mcs/class/System/System.Net/WebHeaderCollection.cs b/mcs/class/System/System.Net/WebHeaderCollection.cs index c9b7ee2b03d..d136d830d12 100644 --- a/mcs/class/System/System.Net/WebHeaderCollection.cs +++ b/mcs/class/System/System.Net/WebHeaderCollection.cs @@ -181,6 +181,12 @@ namespace System.Net headerValue = headerValue.Trim (); if (!IsHeaderValue (headerValue)) throw new ArgumentException ("invalid header value: " + headerValue, "headerValue"); + + AddValue (headerName, headerValue); + } + + internal void AddValue (string headerName, string headerValue) + { base.Add (headerName, headerValue); } diff --git a/mcs/class/System/System.Net/WebPermissionAttribute.cs b/mcs/class/System/System.Net/WebPermissionAttribute.cs index fadab95e603..7b7fb5588ec 100644 --- a/mcs/class/System/System.Net/WebPermissionAttribute.cs +++ b/mcs/class/System/System.Net/WebPermissionAttribute.cs @@ -53,23 +53,14 @@ namespace System.Net { public string Accept { get { -#if NET_2_0 if (m_accept == null) return null; -#endif return (m_accept as WebPermissionInfo).Info; } set { if (m_accept != null) AlreadySet ("Accept", "Accept"); -#if NET_2_0 m_accept = new WebPermissionInfo (WebPermissionInfoType.InfoString, value); -#else - if (value == null) - m_accept = null; - else - m_accept = new WebPermissionInfo (WebPermissionInfoType.InfoString, value); -#endif } } @@ -91,23 +82,14 @@ namespace System.Net { public string Connect { get { -#if NET_2_0 if (m_connect == null) return null; -#endif return (m_connect as WebPermissionInfo).Info; } set { if (m_connect != null) AlreadySet ("Connect", "Connect"); -#if NET_2_0 m_connect = new WebPermissionInfo (WebPermissionInfoType.InfoString, value); -#else - if (value == null) - m_connect = null; - else - m_connect = new WebPermissionInfo (WebPermissionInfoType.InfoString, value); -#endif } } diff --git a/mcs/class/System/System.Net/WebProxy.cs b/mcs/class/System/System.Net/WebProxy.cs index 5ef0b10ad89..365535a056b 100644 --- a/mcs/class/System/System.Net/WebProxy.cs +++ b/mcs/class/System/System.Net/WebProxy.cs @@ -42,9 +42,7 @@ namespace System.Net bool bypassOnLocal; ArrayList bypassList; ICredentials credentials; -#if NET_2_0 bool useDefaultCredentials; -#endif // Constructors @@ -92,9 +90,7 @@ namespace System.Net this.address = (Uri) serializationInfo.GetValue ("_ProxyAddress", typeof (Uri)); this.bypassOnLocal = serializationInfo.GetBoolean ("_BypassOnLocal"); this.bypassList = (ArrayList) serializationInfo.GetValue ("_BypassList", typeof (ArrayList)); -#if NET_2_0 this.useDefaultCredentials = serializationInfo.GetBoolean ("_UseDefaultCredentials"); -#endif this.credentials = null; CheckBypassList (); } @@ -133,18 +129,14 @@ namespace System.Net set { credentials = value; } } -#if NET_2_0 [MonoTODO ("Does not affect Credentials, since CredentialCache.DefaultCredentials is not implemented.")] public bool UseDefaultCredentials { get { return useDefaultCredentials; } set { useDefaultCredentials = value; } } -#endif // Methods -#if NET_2_0 [Obsolete ("This method has been deprecated", false)] -#endif [MonoTODO("Can we get this info under windows from the system?")] public static WebProxy GetDefaultProxy () { @@ -166,10 +158,8 @@ namespace System.Net public bool IsBypassed (Uri host) { -#if NET_2_0 if (host == null) throw new ArgumentNullException ("host"); -#endif if (host.IsLoopback && bypassOnLocal) return true; @@ -223,17 +213,12 @@ namespace System.Net } } -#if NET_2_0 - protected virtual -#endif - void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) + protected virtual void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) { serializationInfo.AddValue ("_BypassOnLocal", bypassOnLocal); serializationInfo.AddValue ("_ProxyAddress", address); serializationInfo.AddValue ("_BypassList", bypassList); -#if NET_2_0 serializationInfo.AddValue ("_UseDefaultCredentials", UseDefaultCredentials); -#endif } void ISerializable.GetObjectData (SerializationInfo serializationInfo, diff --git a/mcs/class/System/System.Net/WebRequest.cs b/mcs/class/System/System.Net/WebRequest.cs index aa88aeecd55..df007846cc6 100644 --- a/mcs/class/System/System.Net/WebRequest.cs +++ b/mcs/class/System/System.Net/WebRequest.cs @@ -63,22 +63,11 @@ namespace System.Net static bool isDefaultWebProxySet; static IWebProxy defaultWebProxy; static RequestCachePolicy defaultCachePolicy; - static MethodInfo cfGetDefaultProxy; // Constructors static WebRequest () { - if (Platform.IsMacOS) { -#if MONOTOUCH - Type type = Type.GetType ("MonoTouch.CoreFoundation.CFNetwork, monotouch"); -#else - Type type = Type.GetType ("MonoMac.CoreFoundation.CFNetwork, monomac"); -#endif - if (type != null) - cfGetDefaultProxy = type.GetMethod ("GetDefaultProxy"); - } - #if NET_2_1 IWebRequestCreate http = new HttpRequestCreator (); RegisterPrefix ("http", http); @@ -246,9 +235,14 @@ namespace System.Net ProxyElement pe = sec.Proxy; - if ((pe.UseSystemDefault != ProxyElement.UseSystemDefaultValues.False) && (pe.ProxyAddress == null)) - p = (WebProxy) GetSystemWebProxy (); - else + if ((pe.UseSystemDefault != ProxyElement.UseSystemDefaultValues.False) && (pe.ProxyAddress == null)) { + IWebProxy proxy = GetSystemWebProxy (); + + if (!(proxy is WebProxy)) + return proxy; + + p = (WebProxy) proxy; + } else p = new WebProxy (); if (pe.ProxyAddress != null) @@ -303,7 +297,19 @@ namespace System.Net throw new ArgumentNullException ("requestUri"); return GetCreator (requestUri.Scheme).Create (requestUri); } - +#if NET_4_5 || MOBILE + [MonoTODO ("for portable library support")] + public static HttpWebRequest CreateHttp (string requestUriString) + { + throw new NotImplementedException (); + } + + [MonoTODO ("for portable library support")] + public static HttpWebRequest CreateHttp (Uri requestUri) + { + throw new NotImplementedException (); + } +#endif public virtual Stream EndGetRequestStream (IAsyncResult asyncResult) { throw GetMustImplement (); @@ -362,6 +368,9 @@ namespace System.Net } } else { #endif + if (Platform.IsMacOS) + return CFNetwork.GetDefaultProxy (); + string address = Environment.GetEnvironmentVariable ("http_proxy"); if (address == null) @@ -413,9 +422,6 @@ namespace System.Net } #endif - if (cfGetDefaultProxy != null) - return (IWebProxy) cfGetDefaultProxy.Invoke (null, null); - return new WebProxy (); } diff --git a/mcs/class/System/System.Net/WebRequestMethods.cs b/mcs/class/System/System.Net/WebRequestMethods.cs index d0cce9bf242..1e7a7ac7866 100644 --- a/mcs/class/System/System.Net/WebRequestMethods.cs +++ b/mcs/class/System/System.Net/WebRequestMethods.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Net { public static class WebRequestMethods @@ -69,5 +67,4 @@ namespace System.Net } } -#endif diff --git a/mcs/class/System/System.Net/WebResponse.cs b/mcs/class/System/System.Net/WebResponse.cs index b87d65b40c2..43864f4424f 100644 --- a/mcs/class/System/System.Net/WebResponse.cs +++ b/mcs/class/System/System.Net/WebResponse.cs @@ -87,7 +87,12 @@ namespace System.Net public virtual Uri ResponseUri { get { throw new NotSupportedException (); } } - +#if NET_4_5 || MOBILE + [MonoTODO ("for portable library support")] + public virtual bool SupportsHeaders { + get { throw new NotImplementedException (); } + } +#endif // Methods public virtual void Close() @@ -101,6 +106,8 @@ namespace System.Net } #if TARGET_JVM //enable overrides for extenders public virtual void Dispose() +#elif NET_4_0 || MOBILE + public void Dispose () #else void IDisposable.Dispose() #endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/ADVF.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/ADVF.cs index c0cf788f740..e8e85aaf632 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/ADVF.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/ADVF.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -46,5 +44,3 @@ namespace System.Runtime.InteropServices.ComTypes ADVF_DATAONSTOP = 64, } } - -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/DATADIR.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/DATADIR.cs index 4a5ef38605a..ee685502489 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/DATADIR.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/DATADIR.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -40,5 +38,3 @@ namespace System.Runtime.InteropServices.ComTypes DATADIR_SET, } } - -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/DVASPECT.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/DVASPECT.cs index 7f3f12ce308..43815ccf015 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/DVASPECT.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/DVASPECT.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -44,4 +42,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/FORMATETC.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/FORMATETC.cs index 3a2be76c0da..183ffc3a1fc 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/FORMATETC.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/FORMATETC.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -47,4 +45,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IAdviseSink.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IAdviseSink.cs index 560c23887de..f4783fd550b 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IAdviseSink.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IAdviseSink.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Runtime.InteropServices; @@ -53,4 +51,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IDataObject.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IDataObject.cs index 8f60ff009dd..b05a4c7e563 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IDataObject.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IDataObject.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Runtime.InteropServices; @@ -56,4 +54,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs index 9046e573753..70b797fbb12 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Runtime.InteropServices; @@ -49,5 +47,3 @@ namespace System.Runtime.InteropServices.ComTypes int Skip (int celt); } } - -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs index 7786e572d3b..bf28069236d 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; using System.Runtime.InteropServices; @@ -49,5 +47,3 @@ namespace System.Runtime.InteropServices.ComTypes int Skip (int celt); } } - -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/STATDATA.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/STATDATA.cs index d77dba0f9f4..e500a0df77c 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/STATDATA.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/STATDATA.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -43,4 +41,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs index fc119054a55..6ba37a0e29f 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -43,4 +41,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices.ComTypes/TYMED.cs b/mcs/class/System/System.Runtime.InteropServices.ComTypes/TYMED.cs index fda512dffe4..ee0945cca44 100644 --- a/mcs/class/System/System.Runtime.InteropServices.ComTypes/TYMED.cs +++ b/mcs/class/System/System.Runtime.InteropServices.ComTypes/TYMED.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices.ComTypes @@ -48,4 +46,3 @@ namespace System.Runtime.InteropServices.ComTypes } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs b/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs index 74a5b4eed84..ff51de2d023 100644 --- a/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs +++ b/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs @@ -25,8 +25,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices @@ -98,4 +96,3 @@ namespace System.Runtime.InteropServices } } -#endif diff --git a/mcs/class/System/System.Runtime.InteropServices/StandardOleMarshalObject.cs b/mcs/class/System/System.Runtime.InteropServices/StandardOleMarshalObject.cs index 315a150c18f..982d02ddaa3 100644 --- a/mcs/class/System/System.Runtime.InteropServices/StandardOleMarshalObject.cs +++ b/mcs/class/System/System.Runtime.InteropServices/StandardOleMarshalObject.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Runtime.InteropServices { @@ -42,4 +40,3 @@ namespace System.Runtime.InteropServices { } } -#endif diff --git a/mcs/class/System/System.Security.AccessControl/SemaphoreAccessRule.cs b/mcs/class/System/System.Security.AccessControl/SemaphoreAccessRule.cs index cbdaefdde4f..005ca1e0104 100644 --- a/mcs/class/System/System.Security.AccessControl/SemaphoreAccessRule.cs +++ b/mcs/class/System/System.Security.AccessControl/SemaphoreAccessRule.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.InteropServices; using System.Security.Principal; @@ -62,4 +60,3 @@ namespace System.Security.AccessControl { } } -#endif diff --git a/mcs/class/System/System.Security.AccessControl/SemaphoreAuditRule.cs b/mcs/class/System/System.Security.AccessControl/SemaphoreAuditRule.cs index df54526dab1..db21749bf6c 100644 --- a/mcs/class/System/System.Security.AccessControl/SemaphoreAuditRule.cs +++ b/mcs/class/System/System.Security.AccessControl/SemaphoreAuditRule.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.InteropServices; using System.Security.Principal; @@ -55,4 +53,3 @@ namespace System.Security.AccessControl { } } -#endif diff --git a/mcs/class/System/System.Security.AccessControl/SemaphoreRights.cs b/mcs/class/System/System.Security.AccessControl/SemaphoreRights.cs index f3163c99581..58c39cd4cb3 100644 --- a/mcs/class/System/System.Security.AccessControl/SemaphoreRights.cs +++ b/mcs/class/System/System.Security.AccessControl/SemaphoreRights.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Runtime.InteropServices; @@ -45,4 +44,3 @@ namespace System.Security.AccessControl { } } -#endif diff --git a/mcs/class/System/System.Security.AccessControl/SemaphoreSecurity.cs b/mcs/class/System/System.Security.AccessControl/SemaphoreSecurity.cs index 8e3700d2cdf..38ae5b4884a 100644 --- a/mcs/class/System/System.Security.AccessControl/SemaphoreSecurity.cs +++ b/mcs/class/System/System.Security.AccessControl/SemaphoreSecurity.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.InteropServices; using System.Security.Principal; @@ -134,4 +132,3 @@ namespace System.Security.AccessControl { } } -#endif diff --git a/mcs/class/System/System.Security.Authentication/AuthenticationException.cs b/mcs/class/System/System.Security.Authentication/AuthenticationException.cs index 0ab57d38dad..af5d3594a3b 100644 --- a/mcs/class/System/System.Security.Authentication/AuthenticationException.cs +++ b/mcs/class/System/System.Security.Authentication/AuthenticationException.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.Serialization; namespace System.Security.Authentication { @@ -59,4 +57,3 @@ namespace System.Security.Authentication { } } -#endif diff --git a/mcs/class/System/System.Security.Authentication/CipherAlgorithmType.cs b/mcs/class/System/System.Security.Authentication/CipherAlgorithmType.cs index 6343cca1bba..0af6badd1ee 100644 --- a/mcs/class/System/System.Security.Authentication/CipherAlgorithmType.cs +++ b/mcs/class/System/System.Security.Authentication/CipherAlgorithmType.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Authentication { public enum CipherAlgorithmType @@ -48,4 +46,3 @@ namespace System.Security.Authentication } } -#endif diff --git a/mcs/class/System/System.Security.Authentication/ExchangeAlgorithmType.cs b/mcs/class/System/System.Security.Authentication/ExchangeAlgorithmType.cs index 5ac3c37153a..279456e59ec 100644 --- a/mcs/class/System/System.Security.Authentication/ExchangeAlgorithmType.cs +++ b/mcs/class/System/System.Security.Authentication/ExchangeAlgorithmType.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Security.Authentication { @@ -42,4 +41,3 @@ namespace System.Security.Authentication } } -#endif diff --git a/mcs/class/System/System.Security.Authentication/HashAlgorithmType.cs b/mcs/class/System/System.Security.Authentication/HashAlgorithmType.cs index 7747f6bce87..24668658040 100644 --- a/mcs/class/System/System.Security.Authentication/HashAlgorithmType.cs +++ b/mcs/class/System/System.Security.Authentication/HashAlgorithmType.cs @@ -29,7 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 namespace System.Security.Authentication { @@ -41,4 +40,3 @@ namespace System.Security.Authentication } } -#endif diff --git a/mcs/class/System/System.Security.Authentication/InvalidCredentialException.cs b/mcs/class/System/System.Security.Authentication/InvalidCredentialException.cs index d93d415b595..6d2e86b84a1 100644 --- a/mcs/class/System/System.Security.Authentication/InvalidCredentialException.cs +++ b/mcs/class/System/System.Security.Authentication/InvalidCredentialException.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Runtime.Serialization; @@ -59,4 +58,3 @@ namespace System.Security.Authentication { } } -#endif diff --git a/mcs/class/System/System.Security.Authentication/SslProtocols.cs b/mcs/class/System/System.Security.Authentication/SslProtocols.cs index bf76ece18f0..5b88fddf314 100644 --- a/mcs/class/System/System.Security.Authentication/SslProtocols.cs +++ b/mcs/class/System/System.Security.Authentication/SslProtocols.cs @@ -28,8 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Authentication { [Flags] @@ -42,4 +40,3 @@ namespace System.Security.Authentication { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/OpenFlags.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/OpenFlags.cs index 9e0c31b6242..627afab706a 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/OpenFlags.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/OpenFlags.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { [Flags] @@ -41,4 +39,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreLocation.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreLocation.cs index a4a71dc3829..4cbde5065a7 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreLocation.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreLocation.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum StoreLocation { @@ -37,4 +35,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreName.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreName.cs index 5386186d8c2..5f3237580cf 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreName.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/StoreName.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum StoreName { @@ -43,4 +41,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs index f3e2df67278..5e602238a5d 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { [Flags] @@ -45,4 +43,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs index 52be6b7a4d4..4fcd9252fe5 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.IO; using System.Text; #if SECURITY_DEP || MOONLIGHT @@ -669,4 +667,3 @@ namespace System.Security.Cryptography.X509Certificates { #endif } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs index 9fb1dde7746..142592bc581 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { [Flags] @@ -59,4 +57,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509FindType.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509FindType.cs index 7711fd96244..244ebddc5c8 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509FindType.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509FindType.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum X509FindType { @@ -50,4 +48,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509IncludeOption.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509IncludeOption.cs index 345eb9341ea..48023c21e52 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509IncludeOption.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509IncludeOption.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum X509IncludeOption { @@ -39,4 +37,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs index 119b7349b54..aacfc894b09 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum X509RevocationFlag { @@ -38,4 +36,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationMode.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationMode.cs index 123b15af02a..356fea8d003 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationMode.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509RevocationMode.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum X509RevocationMode { @@ -38,4 +36,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs index 8db37c08581..74253236fa1 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { public enum X509SubjectKeyIdentifierHashAlgorithm { @@ -37,4 +35,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs index 956f9a5474c..17ea0819975 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System.Security.Cryptography.X509Certificates { [Flags] @@ -54,4 +52,3 @@ namespace System.Security.Cryptography.X509Certificates { } } -#endif diff --git a/mcs/class/System/System.Security.Cryptography/AsnEncodedDataCollection.cs b/mcs/class/System/System.Security.Cryptography/AsnEncodedDataCollection.cs index 16b14387f50..def3c8350c0 100644 --- a/mcs/class/System/System.Security.Cryptography/AsnEncodedDataCollection.cs +++ b/mcs/class/System/System.Security.Cryptography/AsnEncodedDataCollection.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.Collections; diff --git a/mcs/class/System/System.Security.Cryptography/AsnEncodedDataEnumerator.cs b/mcs/class/System/System.Security.Cryptography/AsnEncodedDataEnumerator.cs index a78d55ebbeb..714b5534489 100644 --- a/mcs/class/System/System.Security.Cryptography/AsnEncodedDataEnumerator.cs +++ b/mcs/class/System/System.Security.Cryptography/AsnEncodedDataEnumerator.cs @@ -27,7 +27,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 && SECURITY_DEP +#if SECURITY_DEP using System.Collections; diff --git a/mcs/class/System/System.Security.Permissions/PermissionHelper.cs b/mcs/class/System/System.Security.Permissions/PermissionHelper.cs index 3413a15edc7..b53a5c1e484 100644 --- a/mcs/class/System/System.Security.Permissions/PermissionHelper.cs +++ b/mcs/class/System/System.Security.Permissions/PermissionHelper.cs @@ -48,12 +48,6 @@ namespace System.Security.Permissions { case PermissionState.None: break; case PermissionState.Unrestricted: -#if !NET_2_0 - if (!allowUnrestricted) { - msg = Locale.GetText ("Unrestricted isn't not allowed for identity permissions."); - throw new ArgumentException (msg, "state"); - } -#endif break; default: msg = String.Format (Locale.GetText ("Invalid enum {0}"), state); diff --git a/mcs/class/System/System.Security.Permissions/ResourcePermissionBase.cs b/mcs/class/System/System.Security.Permissions/ResourcePermissionBase.cs index 8bdafb300c8..88bdbf45119 100644 --- a/mcs/class/System/System.Security.Permissions/ResourcePermissionBase.cs +++ b/mcs/class/System/System.Security.Permissions/ResourcePermissionBase.cs @@ -50,12 +50,7 @@ namespace System.Security.Permissions { protected ResourcePermissionBase (PermissionState state) : this () { -#if NET_2_0 PermissionHelper.CheckPermissionState (state, true); -#else - // there are no validation of the permission state - // but any invalid value results in a restricted set -#endif _unrestricted = (state == PermissionState.Unrestricted); } @@ -114,13 +109,8 @@ namespace System.Security.Permissions { [MonoTODO ("incomplete - need more test")] public override void FromXml (SecurityElement securityElement) { -#if NET_2_0 if (securityElement == null) throw new ArgumentNullException ("securityElement"); -#else - if (securityElement == null) - throw new NullReferenceException ("securityElement"); -#endif CheckSecurityElement (securityElement, "securityElement", version, version); // Note: we do not (yet) care about the return value // as we only accept version 1 (min/max values) @@ -178,12 +168,8 @@ namespace System.Security.Permissions { public override bool IsSubsetOf (IPermission target) { if (target == null) { -#if NET_2_0 // do not use Cast - different permissions (and earlier Fx) return false :-/ return true; -#else - return false; -#endif } ResourcePermissionBase rpb = (target as ResourcePermissionBase); @@ -333,13 +319,11 @@ namespace System.Security.Permissions { { if (se == null) throw new ArgumentNullException (parameterName); -#if NET_2_0 // Tag is case-sensitive if (se.Tag != "IPermission") { string msg = String.Format (Locale.GetText ("Invalid tag {0}"), se.Tag); throw new ArgumentException (msg, parameterName); } -#endif // Note: we do not care about the class attribute at // this stage (in fact we don't even if the class // attribute is present or not). Anyway the object has @@ -358,13 +342,11 @@ namespace System.Security.Permissions { throw new ArgumentException (msg, parameterName, e); } } -#if NET_2_0 if ((version < minimumVersion) || (version > maximumVersion)) { string msg = Locale.GetText ("Unknown version '{0}', expected versions between ['{1}','{2}']."); msg = String.Format (msg, version, minimumVersion, maximumVersion); throw new ArgumentException (msg, parameterName); } -#endif return version; } diff --git a/mcs/class/System/System.Security.Permissions/StorePermission.cs b/mcs/class/System/System.Security.Permissions/StorePermission.cs index 239e65ce8a3..0debdb9b9b4 100644 --- a/mcs/class/System/System.Security.Permissions/StorePermission.cs +++ b/mcs/class/System/System.Security.Permissions/StorePermission.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Globalization; namespace System.Security.Permissions { @@ -173,4 +171,3 @@ namespace System.Security.Permissions { } } -#endif diff --git a/mcs/class/System/System.Security.Permissions/StorePermissionAttribute.cs b/mcs/class/System/System.Security.Permissions/StorePermissionAttribute.cs index 44700ce704c..703c941a5af 100644 --- a/mcs/class/System/System.Security.Permissions/StorePermissionAttribute.cs +++ b/mcs/class/System/System.Security.Permissions/StorePermissionAttribute.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Globalization; @@ -156,4 +155,3 @@ namespace System.Security.Permissions { } } -#endif diff --git a/mcs/class/System/System.Security.Permissions/StorePermissionFlags.cs b/mcs/class/System/System.Security.Permissions/StorePermissionFlags.cs index 9cf0c2c0694..eec1f8c4eae 100644 --- a/mcs/class/System/System.Security.Permissions/StorePermissionFlags.cs +++ b/mcs/class/System/System.Security.Permissions/StorePermissionFlags.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System; namespace System.Security.Permissions { @@ -48,4 +46,3 @@ namespace System.Security.Permissions { } } -#endif diff --git a/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs b/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs index 972e2ccf319..bebd38bff9f 100644 --- a/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs +++ b/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs @@ -5,9 +5,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Threading; -#if NET_2_0 using System.Collections.Generic; -#endif namespace System.Text.RegularExpressions { @@ -23,7 +21,6 @@ namespace System.Text.RegularExpressions { // matching opcodes // -#if NET_2_0 class CILCompiler : RxCompiler, ICompiler { DynamicMethod[] eval_methods; bool[] eval_methods_defined; @@ -1861,10 +1858,6 @@ namespace System.Text.RegularExpressions { return m; } } -#else - class CILCompiler : RxCompiler { - } -#endif } diff --git a/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs b/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs index 058453971b6..1e8894373b9 100644 --- a/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs +++ b/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs @@ -29,8 +29,6 @@ namespace System.Text.RegularExpressions { -#if NET_2_0 [Serializable] -#endif public delegate string MatchEvaluator (Match match); } diff --git a/mcs/class/System/System.Text.RegularExpressions/Regex.cs b/mcs/class/System/System.Text.RegularExpressions/Regex.cs index c518934c512..9d18feabd0c 100644 --- a/mcs/class/System/System.Text.RegularExpressions/Regex.cs +++ b/mcs/class/System/System.Text.RegularExpressions/Regex.cs @@ -177,7 +177,6 @@ namespace System.Text.RegularExpressions { return re.Split (input); } -#if NET_2_0 static FactoryCache cache = new FactoryCache (15); public static int CacheSize { get { return cache.Capacity; } @@ -188,9 +187,6 @@ namespace System.Text.RegularExpressions { cache.Capacity = value; } } -#else - static FactoryCache cache = new FactoryCache (200); -#endif // private @@ -311,23 +307,12 @@ namespace System.Text.RegularExpressions { return machineFactory; } -#if NET_2_0 - protected -#else - private -#endif - Regex (SerializationInfo info, StreamingContext context) : + protected Regex (SerializationInfo info, StreamingContext context) : this (info.GetString ("pattern"), (RegexOptions) info.GetValue ("options", typeof (RegexOptions))) { } -#if ONLY_1_1 && !TARGET_JVM - // fixes public API signature - ~Regex () - { - } -#endif // public instance properties public RegexOptions Options { diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs b/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs index 308314e58ff..2addae024bd 100644 --- a/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs +++ b/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs @@ -51,10 +51,8 @@ namespace System.Text.RegularExpressions { set { if (value == null) throw new ArgumentNullException ("Name"); -#if NET_2_0 if (value.Length == 0) throw new ArgumentException ("Name"); -#endif name = value; } } diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs b/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs index 9cb3e2ca0f3..48b42b9314f 100644 --- a/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs +++ b/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs @@ -55,13 +55,11 @@ namespace System.Text.RegularExpressions { protected void Capture (int capnum, int start, int end) { throw new NotImplementedException (); } -#if NET_2_0 [MonoTODO] protected static bool CharInClass (char ch, string charClass) { throw new NotImplementedException (); } -#endif [MonoTODO] protected static bool CharInSet (char ch, string set, string category) { throw new NotImplementedException (); diff --git a/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs b/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs index b1495432d68..19b257bf131 100644 --- a/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs +++ b/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs @@ -635,6 +635,13 @@ namespace System.Text.RegularExpressions { EmitLink (next); } + public void EmitJumpTest (LinkRef target,LinkRef ElseTarget) + { + //for evaluating ALTERNATIVES ("or" or "|") + EmitJump (target);//not implemented for RxCompiler + // see compiler.cs for implementation guideline + } + public void EmitJump (LinkRef target) { BeginLink (target); diff --git a/mcs/class/System/System.Text.RegularExpressions/arch.cs b/mcs/class/System/System.Text.RegularExpressions/arch.cs index 72e9a15c690..4e60129a961 100644 --- a/mcs/class/System/System.Text.RegularExpressions/arch.cs +++ b/mcs/class/System/System.Text.RegularExpressions/arch.cs @@ -72,7 +72,12 @@ namespace System.Text.RegularExpressions { // miscellaneous - Info // pattern information + Info, // pattern information + + JumpTest // Jump if we didn't already go + // through this path with an alternative + // option (an "or" path).. i.e. so we + // don't do short circuit or } [Flags] diff --git a/mcs/class/System/System.Text.RegularExpressions/compiler.cs b/mcs/class/System/System.Text.RegularExpressions/compiler.cs index cd2a8bc305c..170ae239ae7 100644 --- a/mcs/class/System/System.Text.RegularExpressions/compiler.cs +++ b/mcs/class/System/System.Text.RegularExpressions/compiler.cs @@ -77,6 +77,7 @@ namespace System.Text.RegularExpressions { void EmitSub (LinkRef tail); void EmitTest (LinkRef yes, LinkRef tail); void EmitBranch (LinkRef next); + void EmitJumpTest (LinkRef target, LinkRef ElseTarget); void EmitJump (LinkRef target); void EmitRepeat (int min, int max, bool lazy, LinkRef until); void EmitUntil (LinkRef repeat); @@ -337,6 +338,15 @@ namespace System.Text.RegularExpressions { TraceRegexp ("branch next {0}", next); } + public void EmitJumpTest (LinkRef target, LinkRef ElseTarget) { + BeginLink (target); + BeginLink (ElseTarget); + Emit (OpCode.JumpTest, 0); + EmitLink (target); + EmitLink (ElseTarget); + + TraceRegexp ("jmp test target {0} if not already tried else {1} ", target,ElseTarget); + } public void EmitJump (LinkRef target) { BeginLink (target); Emit (OpCode.Jump, 0); diff --git a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs b/mcs/class/System/System.Text.RegularExpressions/interpreter.cs index cd0e5aef9f1..2fe01c6041e 100644 --- a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs +++ b/mcs/class/System/System.Text.RegularExpressions/interpreter.cs @@ -29,6 +29,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -78,8 +79,50 @@ namespace System.Text.RegularExpressions { ResetGroups (); fast = repeat = null; } + + private class JumpTestEntry { + public int pc; + public int ptr; + } - private bool Eval (Mode mode, ref int ref_ptr, int pc) { + private bool Eval (Mode mode, ref int ref_ptr, int pc, + List JumpTestList = null, + List> TriedCombos = null, + bool BypassJumpTest = false) + { + if (TriedCombos == null) { + TriedCombos = new List> (); + } + if (JumpTestList == null) { + JumpTestList = new List (); + } else { + return Eval_Real (mode, ref ref_ptr, pc, + JumpTestList,TriedCombos, + BypassJumpTest); + } + bool OutOfOptions = false; + bool retval = false; + while (!OutOfOptions) { + retval = Eval_Real(mode, ref ref_ptr, pc, + JumpTestList,TriedCombos,false); + if (retval == true) { + OutOfOptions = false; + return true; + } + //else + if (JumpTestList.Count == 0) { + OutOfOptions = true; + return false; + } else { + TriedCombos.Add(JumpTestList); + JumpTestList = new + List (); + } + + } + return retval; + } + private bool Eval_Real (Mode mode, ref int ref_ptr, int pc, List JumpTestList, List> TriedCombos,bool BypassJumpTest) { int ptr = ref_ptr; Begin: for (;;) { @@ -116,7 +159,7 @@ namespace System.Text.RegularExpressions { if (anch_reverse || anch_offset == 0) { if (anch_reverse) ptr = anch_offset; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList ,TriedCombos, BypassJumpTest)) goto Pass; } break; @@ -124,7 +167,7 @@ namespace System.Text.RegularExpressions { case Position.StartOfLine: if (anch_ptr == 0) { ptr = 0; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; ++ anch_ptr; @@ -136,7 +179,7 @@ namespace System.Text.RegularExpressions { ptr = anch_ptr == anch_end ? anch_ptr : anch_ptr + anch_offset; else ptr = anch_ptr == 0 ? anch_ptr : anch_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; } @@ -150,7 +193,7 @@ namespace System.Text.RegularExpressions { case Position.StartOfScan: if (anch_ptr == scan_ptr) { ptr = anch_reverse ? scan_ptr + anch_offset : scan_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; } break; @@ -189,7 +232,7 @@ namespace System.Text.RegularExpressions { break; ptr = reverse ? anch_ptr + anch_offset : anch_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; if (reverse) @@ -207,7 +250,7 @@ namespace System.Text.RegularExpressions { || (!anch_reverse && anch_ptr <= anch_end)) { ptr = anch_ptr; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; if (anch_reverse) -- anch_ptr; @@ -224,11 +267,11 @@ namespace System.Text.RegularExpressions { || (!anch_reverse && anch_ptr <= anch_end)) { ptr = anch_ptr; - if (Eval (Mode.Match, ref ptr, pc + 3)) { + if (Eval (Mode.Match, ref ptr, pc + 3, JumpTestList, TriedCombos, BypassJumpTest)) { // anchor expression passed: try real expression at the correct offset ptr = anch_reverse ? anch_ptr + anch_offset : anch_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) + if (TryMatch (ref ptr, pc + skip, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; } @@ -355,7 +398,7 @@ namespace System.Text.RegularExpressions { int start = ptr; //point before the balancing group - if (!Eval (Mode.Match, ref ptr, pc + 5)) + if (!Eval (Mode.Match, ref ptr, pc + 5, JumpTestList, TriedCombos, BypassJumpTest)) goto Fail; @@ -383,7 +426,7 @@ namespace System.Text.RegularExpressions { } case OpCode.Sub: { - if (!Eval (Mode.Match, ref ptr, pc + 2)) + if (!Eval (Mode.Match, ref ptr, pc + 2, JumpTestList, TriedCombos, BypassJumpTest)) goto Fail; pc += program[pc + 1]; @@ -393,7 +436,7 @@ namespace System.Text.RegularExpressions { case OpCode.Test: { int cp = Checkpoint (); int test_ptr = ptr; - if (Eval (Mode.Match, ref test_ptr, pc + 3)) + if (Eval (Mode.Match, ref test_ptr, pc + 3, JumpTestList, TriedCombos, true)) pc += program[pc + 1]; else { Backtrack (cp); @@ -406,7 +449,7 @@ namespace System.Text.RegularExpressions { OpCode branch_op; do { int cp = Checkpoint (); - if (Eval (Mode.Match, ref ptr, pc + 2)) + if (Eval (Mode.Match, ref ptr, pc + 2, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; Backtrack (cp); @@ -417,6 +460,32 @@ namespace System.Text.RegularExpressions { goto Fail; } + case OpCode.JumpTest: { + /*This reached when we have a "|" (or) + *condition and we don't want to short + *circuit every time - i.e. after a + *full trip through, if we fail tr + *another path */ + + if (!BypassJumpTest) { + JumpTestEntry jte = new JumpTestEntry(); + jte.ptr = ptr; + jte.pc = pc; + bool Match = false; + Match = CheckComboMatch (TriedCombos, JumpTestList, pc, ptr); + if (!Match) { + JumpTestList.Add(jte); + pc += program[pc + 1]; + } else { + //else + pc += program[pc + 2];//pc+2 before + } + break; + } else { + pc += program[pc + 1]; + break; + } + } case OpCode.Jump: { pc += program[pc + 1]; @@ -432,7 +501,7 @@ namespace System.Text.RegularExpressions { pc + 6 // subexpression ); - if (Eval (Mode.Match, ref ptr, pc + program[pc + 1])) + if (Eval (Mode.Match, ref ptr, pc + program[pc + 1], JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; else { this.repeat = this.repeat.Previous; @@ -463,7 +532,7 @@ namespace System.Text.RegularExpressions { ++ current.Count; current.Start = ptr; deep = current; - if (!Eval (Mode.Match, ref ptr, current.Expression)) { + if (!Eval (Mode.Match, ref ptr, current.Expression, JumpTestList, TriedCombos, BypassJumpTest)) { current.Start = start; current.Count = start_count; goto Fail; @@ -476,7 +545,7 @@ namespace System.Text.RegularExpressions { // degenerate match ... match tail or fail this.repeat = current.Previous; deep = null; - if (Eval (Mode.Match, ref ptr, pc + 1)) + if (Eval (Mode.Match, ref ptr, pc + 1, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; this.repeat = current; @@ -489,7 +558,7 @@ namespace System.Text.RegularExpressions { this.repeat = current.Previous; deep = null; int cp = Checkpoint (); - if (Eval (Mode.Match, ref ptr, pc + 1)) + if (Eval (Mode.Match, ref ptr, pc + 1, JumpTestList, TriedCombos, BypassJumpTest)) goto Pass; Backtrack (cp); @@ -501,7 +570,7 @@ namespace System.Text.RegularExpressions { ++ current.Count; current.Start = ptr; deep = current; - if (!Eval (Mode.Match, ref ptr, current.Expression)) { + if (!Eval (Mode.Match, ref ptr, current.Expression, JumpTestList, TriedCombos, BypassJumpTest)) { current.Start = start; current.Count = start_count; goto Fail; @@ -525,7 +594,7 @@ namespace System.Text.RegularExpressions { ++ current.Count; current.Start = ptr; deep = current; - if (!Eval (Mode.Match, ref ptr, current.Expression)) { + if (!Eval (Mode.Match, ref ptr, current.Expression, JumpTestList, TriedCombos, BypassJumpTest)) { -- current.Count; current.Start = old_start; Backtrack (cp); @@ -548,7 +617,7 @@ namespace System.Text.RegularExpressions { this.repeat = current.Previous; for (;;) { deep = null; - if (Eval (Mode.Match, ref ptr, pc + 1)) { + if (Eval (Mode.Match, ref ptr, pc + 1, JumpTestList, TriedCombos, BypassJumpTest)) { stack.Count = stack_size; goto Pass; } @@ -618,8 +687,7 @@ namespace System.Text.RegularExpressions { skip: if (fast.IsLazy) { - if (!fast.IsMinimum && !Eval (Mode.Count, ref ptr, fast.Expression)) { - //Console.WriteLine ("lazy fast: failed mininum."); + if (!fast.IsMinimum && !Eval (Mode.Count, ref ptr, fast.Expression, JumpTestList, TriedCombos, BypassJumpTest)) { fast = fast.Previous; goto Fail; } @@ -628,19 +696,17 @@ namespace System.Text.RegularExpressions { int p = ptr + coff; if (c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) { deep = null; - if (Eval (Mode.Match, ref ptr, pc)) + if (Eval (Mode.Match, ref ptr, pc, JumpTestList, TriedCombos, BypassJumpTest)) break; } if (fast.IsMaximum) { - //Console.WriteLine ("lazy fast: failed with maximum."); fast = fast.Previous; goto Fail; } Backtrack (cp); - if (!Eval (Mode.Count, ref ptr, fast.Expression)) { - //Console.WriteLine ("lazy fast: no more."); + if (!Eval (Mode.Count, ref ptr, fast.Expression, JumpTestList, TriedCombos, BypassJumpTest)) { fast = fast.Previous; goto Fail; } @@ -649,7 +715,7 @@ namespace System.Text.RegularExpressions { goto Pass; } else { - if (!Eval (Mode.Count, ref ptr, fast.Expression)) { + if (!Eval (Mode.Count, ref ptr, fast.Expression, JumpTestList, TriedCombos, BypassJumpTest)) { fast = fast.Previous; goto Fail; } @@ -664,7 +730,7 @@ namespace System.Text.RegularExpressions { int p = ptr + coff; if (c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) { deep = null; - if (Eval (Mode.Match, ref ptr, pc)) + if (Eval (Mode.Match, ref ptr, pc, JumpTestList, TriedCombos, BypassJumpTest)) break; } @@ -820,12 +886,70 @@ namespace System.Text.RegularExpressions { return negate; } - private bool TryMatch (ref int ref_ptr, int pc) { + private bool CheckComboMatch (List> TriedCombos, List JumpTestList, int pc, int ptr) + { + bool Match = false; + if (TriedCombos != null && TriedCombos.Count > 0) + { + for (int i = 0;i < TriedCombos.Count;i++) + { + if ((TriedCombos[i] != null) && + (TriedCombos[i].Count > 0)) + { + int j = TriedCombos[i].Count - 1; + if ((TriedCombos[i][j].pc == pc) && (TriedCombos[i][j].ptr == ptr)) + { + if (CheckSubCmb( TriedCombos, JumpTestList, + i,j,ref Match)) + { + return true; + } + } + } + } + } + return Match; + } + + + private bool CheckSubCmb(List> TriedCombos, + List JumpTestList,int i,int j,ref bool Match) + { + if ((JumpTestList.Count <= TriedCombos[i].Count-1)) + { + Match=false; + if (TriedCombos[i].Count > 1) + { + for (j = 0;j < JumpTestList.Count;j++) + { + if ((TriedCombos[i][j].pc == JumpTestList[j].pc) && + (TriedCombos[i][j].ptr == JumpTestList[j].ptr)) + { + Match = true; + }else{ + Match = false; + break; + } + } + if (Match == true) { + //must shortcircuit + return Match; + + } + } else { + Match = true; + //must shortcircuit + return Match; + } + } + return Match; + } + private bool TryMatch (ref int ref_ptr, int pc, List JumpTestList,List> TriedCombos, bool BypassJumpTest) { Reset (); int ptr = ref_ptr; marks [groups [0]].Start = ptr; - if (Eval (Mode.Match, ref ptr, pc)) { + if (Eval (Mode.Match, ref ptr, pc, JumpTestList, TriedCombos, BypassJumpTest)) { marks [groups [0]].End = ptr; ref_ptr = ptr; return true; diff --git a/mcs/class/System/System.Text.RegularExpressions/syntax.cs b/mcs/class/System/System.Text.RegularExpressions/syntax.cs index a3ab80cc5c1..6248b4afec9 100644 --- a/mcs/class/System/System.Text.RegularExpressions/syntax.cs +++ b/mcs/class/System/System.Text.RegularExpressions/syntax.cs @@ -674,7 +674,7 @@ namespace System.Text.RegularExpressions.Syntax { LinkRef next = cmp.NewLink (); cmp.EmitBranch (next); e.Compile (cmp, reverse); - cmp.EmitJump (tail); + cmp.EmitJumpTest (tail, next); cmp.ResolveLink (next); cmp.EmitBranchEnd(); } diff --git a/mcs/class/System/System.Threading/Semaphore.cs b/mcs/class/System/System.Threading/Semaphore.cs index ec5e2abbe45..d39cb280b42 100644 --- a/mcs/class/System/System.Threading/Semaphore.cs +++ b/mcs/class/System/System.Threading/Semaphore.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Security.AccessControl; @@ -171,4 +169,3 @@ namespace System.Threading { } } -#endif diff --git a/mcs/class/System/System.Web/AspNetHostingPermission.cs b/mcs/class/System/System.Web/AspNetHostingPermission.cs index f139599f97b..6cfb7b9c668 100644 --- a/mcs/class/System/System.Web/AspNetHostingPermission.cs +++ b/mcs/class/System/System.Web/AspNetHostingPermission.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System.Security; using System.Security.Permissions; @@ -107,10 +105,8 @@ namespace System.Web { public override SecurityElement ToXml () { SecurityElement se = PermissionHelper.Element (typeof (AspNetHostingPermission), version); -#if NET_2_0 if (IsUnrestricted ()) se.AddAttribute ("Unrestricted", "true"); // FDBK15156 fixed in 2.0 RC -#endif se.AddAttribute ("Level", _level.ToString ()); return se; } @@ -161,5 +157,3 @@ namespace System.Web { } } } - -#endif diff --git a/mcs/class/System/System.Web/AspNetHostingPermissionAttribute.cs b/mcs/class/System/System.Web/AspNetHostingPermissionAttribute.cs index 80b59455f3e..8a299d48b06 100644 --- a/mcs/class/System/System.Web/AspNetHostingPermissionAttribute.cs +++ b/mcs/class/System/System.Web/AspNetHostingPermissionAttribute.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System.Security; using System.Security.Permissions; @@ -67,5 +65,3 @@ namespace System.Web { } } } - -#endif diff --git a/mcs/class/System/System.Web/AspNetHostingPermissionLevel.cs b/mcs/class/System/System.Web/AspNetHostingPermissionLevel.cs index beeb1959f57..4fa8edb2531 100644 --- a/mcs/class/System/System.Web/AspNetHostingPermissionLevel.cs +++ b/mcs/class/System/System.Web/AspNetHostingPermissionLevel.cs @@ -26,13 +26,9 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - namespace System.Web { -#if NET_2_0 [Serializable] -#endif public enum AspNetHostingPermissionLevel { None = 100, Minimal = 200, @@ -42,5 +38,3 @@ namespace System.Web { Unrestricted = 600 } } - -#endif diff --git a/mcs/class/System/System.Windows.Input/ICommand.cs b/mcs/class/System/System.Windows.Input/ICommand.cs new file mode 100644 index 00000000000..c36fea25f02 --- /dev/null +++ b/mcs/class/System/System.Windows.Input/ICommand.cs @@ -0,0 +1,41 @@ +// +// System.Windows.Input.ICommand +// +// Contact: +// Moonlight List (moonlight-list@lists.ximian.com) +// +// Copyright 2008 Novell, Inc. +// Copyright 2012 Xamarin Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_4_5 || MOBILE + +namespace System.Windows.Input { + + public interface ICommand { + bool CanExecute (object parameter); + void Execute (object parameter); + event EventHandler CanExecuteChanged; + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources index 6d7dc002dc2..7f64af222f3 100644 --- a/mcs/class/System/System.dll.sources +++ b/mcs/class/System/System.dll.sources @@ -763,6 +763,7 @@ System.Net.Mime/ContentType.cs System.Net.Mime/DispositionTypeNames.cs System.Net.Mime/MediaTypeNames.cs System.Net.Mime/TransferEncoding.cs +System.Net/MacProxy.cs System.Net/MonoHttpDate.cs System.Net/NetConfig.cs System.Net/NetworkAccess.cs @@ -1001,6 +1002,8 @@ System/UriKind.cs System/UriParser.cs System/UriPartial.cs System/UriTypeConverter.cs +System/UriElements.cs +System/UriParseComponents.cs System.Web/AspNetHostingPermissionAttribute.cs System.Web/AspNetHostingPermission.cs System.Web/AspNetHostingPermissionLevel.cs @@ -1076,3 +1079,4 @@ Mono.Net.Dns/SimpleResolver.cs Mono.Net.Dns/ResolverError.cs Mono.Net.Dns/SimpleResolverEventArgs.cs System.Net/DnsAsyncResult.cs +System.Windows.Input/ICommand.cs \ No newline at end of file diff --git a/mcs/class/System/System/FileStyleUriParser.cs b/mcs/class/System/System/FileStyleUriParser.cs index b8a3341689c..f7a0fdf7ce1 100644 --- a/mcs/class/System/System/FileStyleUriParser.cs +++ b/mcs/class/System/System/FileStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { public class FileStyleUriParser : UriParser { @@ -38,4 +36,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/FtpStyleUriParser.cs b/mcs/class/System/System/FtpStyleUriParser.cs index 41013ad8338..c31d279a1e2 100644 --- a/mcs/class/System/System/FtpStyleUriParser.cs +++ b/mcs/class/System/System/FtpStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { public class FtpStyleUriParser : UriParser { @@ -38,4 +36,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/GenericUriParser.cs b/mcs/class/System/System/GenericUriParser.cs index 64d078d38cc..38ef72808fa 100644 --- a/mcs/class/System/System/GenericUriParser.cs +++ b/mcs/class/System/System/GenericUriParser.cs @@ -27,10 +27,7 @@ // namespace System { -#if NET_2_0 - public -#endif - class GenericUriParser : UriParser { + public class GenericUriParser : UriParser { public GenericUriParser (GenericUriParserOptions options) { diff --git a/mcs/class/System/System/GenericUriParserOptions.cs b/mcs/class/System/System/GenericUriParserOptions.cs index acd940952dd..91e912775ce 100644 --- a/mcs/class/System/System/GenericUriParserOptions.cs +++ b/mcs/class/System/System/GenericUriParserOptions.cs @@ -29,10 +29,7 @@ namespace System { [Flags] -#if NET_2_0 - public -#endif - enum GenericUriParserOptions { + public enum GenericUriParserOptions { Default = 0, GenericAuthority = 1, diff --git a/mcs/class/System/System/GopherStyleUriParser.cs b/mcs/class/System/System/GopherStyleUriParser.cs index e0211d8142f..801c1d330db 100644 --- a/mcs/class/System/System/GopherStyleUriParser.cs +++ b/mcs/class/System/System/GopherStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { public class GopherStyleUriParser : UriParser { @@ -38,4 +36,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/HttpStyleUriParser.cs b/mcs/class/System/System/HttpStyleUriParser.cs index f413e191f4a..15b3fc749f9 100644 --- a/mcs/class/System/System/HttpStyleUriParser.cs +++ b/mcs/class/System/System/HttpStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { public class HttpStyleUriParser : UriParser { @@ -38,4 +36,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/LdapStyleUriParser.cs b/mcs/class/System/System/LdapStyleUriParser.cs index d7965a89713..c19bce92809 100644 --- a/mcs/class/System/System/LdapStyleUriParser.cs +++ b/mcs/class/System/System/LdapStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { public class LdapStyleUriParser : UriParser { @@ -38,4 +36,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/NetPipeStyleUriParser.cs b/mcs/class/System/System/NetPipeStyleUriParser.cs index f047bb44092..b3f6ea863f6 100644 --- a/mcs/class/System/System/NetPipeStyleUriParser.cs +++ b/mcs/class/System/System/NetPipeStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { [MonoTODO] @@ -39,4 +37,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/NetTcpStyleUriParser.cs b/mcs/class/System/System/NetTcpStyleUriParser.cs index c771fd673cd..6c4c1d9ff17 100644 --- a/mcs/class/System/System/NetTcpStyleUriParser.cs +++ b/mcs/class/System/System/NetTcpStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { [MonoTODO] @@ -39,4 +37,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/NewsStyleUriParser.cs b/mcs/class/System/System/NewsStyleUriParser.cs index 06c00ec988b..e1f99989aef 100644 --- a/mcs/class/System/System/NewsStyleUriParser.cs +++ b/mcs/class/System/System/NewsStyleUriParser.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - namespace System { [MonoTODO] @@ -39,4 +37,3 @@ namespace System { } } -#endif diff --git a/mcs/class/System/System/Uri.cs b/mcs/class/System/System/Uri.cs index 0978cafb21b..40ff6eafb09 100644 --- a/mcs/class/System/System/Uri.cs +++ b/mcs/class/System/System/Uri.cs @@ -773,6 +773,7 @@ namespace System { if (i + 1 < len && name [i + 1] == '.') return false; count = 0; + continue; } else if (!Char.IsLetterOrDigit (c) && c != '-' && c != '_') { return false; } diff --git a/mcs/class/System/System/UriBuilder.cs b/mcs/class/System/System/UriBuilder.cs index 412948431bf..ca28836b77e 100644 --- a/mcs/class/System/System/UriBuilder.cs +++ b/mcs/class/System/System/UriBuilder.cs @@ -230,7 +230,7 @@ namespace System get { if (!modified) return uri; - uri = new Uri (ToString (), true); + uri = new Uri (ToString ()); // some properties are updated once the Uri is created - see unit tests host = uri.Host; path = uri.AbsolutePath; diff --git a/mcs/class/System/System/UriComponents.cs b/mcs/class/System/System/UriComponents.cs index 82578ac24af..03a8553dba6 100644 --- a/mcs/class/System/System/UriComponents.cs +++ b/mcs/class/System/System/UriComponents.cs @@ -29,10 +29,7 @@ namespace System { [Flags] -#if NET_2_0 - public -#endif - enum UriComponents { + public enum UriComponents { Scheme = 1, UserInfo = 2, diff --git a/mcs/class/System/System/UriElements.cs b/mcs/class/System/System/UriElements.cs new file mode 100644 index 00000000000..52319c64114 --- /dev/null +++ b/mcs/class/System/System/UriElements.cs @@ -0,0 +1,52 @@ +// +// Internal UriElements class +// +// Author: +// Vinicius Jarina +// +// Copyright (C) 2012 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. +// + +namespace System { + + internal class UriElements + { + public UriElements() + { + scheme = String.Empty; + user = String.Empty; + host = String.Empty; + port = String.Empty; + path = String.Empty; + query = String.Empty; + fragment = String.Empty; + } + + public string scheme; + public string user; + public string host; + public string port; + public string path; + public string query; + public string fragment; + } +} diff --git a/mcs/class/System/System/UriFormat.cs b/mcs/class/System/System/UriFormat.cs index 79b03cae44c..67c6eebd145 100644 --- a/mcs/class/System/System/UriFormat.cs +++ b/mcs/class/System/System/UriFormat.cs @@ -28,10 +28,7 @@ namespace System { -#if NET_2_0 - public -#endif - enum UriFormat { + public enum UriFormat { UriEscaped = 1, Unescaped, diff --git a/mcs/class/System/System/UriIdnScope.cs b/mcs/class/System/System/UriIdnScope.cs index 372e70cd61a..6c385676a99 100644 --- a/mcs/class/System/System/UriIdnScope.cs +++ b/mcs/class/System/System/UriIdnScope.cs @@ -27,8 +27,6 @@ // // Net 3.5 type -#if NET_2_0 || NET_2_1 - namespace System { public enum UriIdnScope @@ -39,4 +37,3 @@ namespace System } } -#endif diff --git a/mcs/class/System/System/UriKind.cs b/mcs/class/System/System/UriKind.cs index 5e6e694cdaa..a6ddc2f7b3b 100644 --- a/mcs/class/System/System/UriKind.cs +++ b/mcs/class/System/System/UriKind.cs @@ -28,12 +28,7 @@ namespace System { -#if NET_2_0 - public -#else - internal -#endif - enum UriKind { + public enum UriKind { RelativeOrAbsolute, Absolute, diff --git a/mcs/class/System/System/UriParseComponents.cs b/mcs/class/System/System/UriParseComponents.cs new file mode 100644 index 00000000000..32ec00e0bbe --- /dev/null +++ b/mcs/class/System/System/UriParseComponents.cs @@ -0,0 +1,270 @@ +// +// Internal UriParseComponents class +// +// Author: +// Vinicius Jarina +// +// Copyright (C) 2012 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.Text; + + +namespace System { + + internal class ParserState + { + public ParserState (string uri) + { + remaining = uri; + elements = new UriElements (); + } + + public string remaining; + public UriElements elements; + } + + // Parse Uri components (scheme, userinfo, host, query, fragment) + // http://www.ietf.org/rfc/rfc3986.txt + internal static class UriParseComponents + { + public static UriElements ParseComponents (string uri) + { + ParserState state = new ParserState (uri); + + bool ok = ParseScheme (ref state); + if (ok) + ok = ParseAuthority (ref state); + if (ok) + ok = ParsePath (ref state); + if (ok) + ok = ParseQuery (ref state); + if (ok) + ParseFragment (ref state); + + return state.elements; + } + // ALPHA + private static bool IsAlpha (char ch) + { + return (('a' <= ch) && (ch <= 'z')) || + (('A' <= ch) && (ch <= 'Z')); + } + + // 3.1) scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + private static bool ParseScheme (ref ParserState state) + { + string part = state.remaining; + + if (!IsAlpha (part [0])) + return part.Length > 0; + + StringBuilder sb = new StringBuilder (); + sb.Append (part [0]); + + int index; + for (index = 1; index < part.Length; index++ ) { + char ch = part [index]; + if (ch != '.' && ch != '-' && ch != '+' && !IsAlpha (ch)) + break; + + sb.Append (ch); + } + + if (index + 1 <= part.Length && part [index] == ':') { + state.elements.scheme = sb.ToString (); + state.remaining = part.Substring (index + 1); + } + + return state.remaining.Length > 0; + } + + private static bool ParseAuthority (ref ParserState state) + { + string part = state.remaining; + + if (part.Length < 2 || part [0] != '/' || part [1] != '/') + return part.Length > 0; + + state.remaining = part.Substring (2); + + bool ok = ParseUser (ref state); + if (ok) + ok = ParseHost (ref state); + if (ok) + ok = ParsePort (ref state); + return ok; + } + + // userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) + private static bool ParseUser (ref ParserState state) + { + string part = state.remaining; + StringBuilder sb = new StringBuilder (); + + int index; + for (index = 0; index < part.Length; index++) { + + char ch = part [index]; + + if (ch == '@' || ch == '/' && ch == '#' && ch == '?') + break; + + sb.Append (ch); + } + + if (index + 1 <= part.Length && part [index] == '@') { + + state.elements.user = sb.ToString (); + state.remaining = state.remaining.Substring (index + 1); + } + + return state.remaining.Length > 0; + } + + // host = IP-literal / IPv4address / reg-name + private static bool ParseHost (ref ParserState state) + { + string part = state.remaining; + StringBuilder sb = new StringBuilder (); + + int index; + for (index = 0; index < part.Length; index++) { + + char ch = part [index]; + + if (ch == '/' || ch == ':' || ch == '#' || ch == '?') + break; + + sb.Append (ch); + } + + if (index <= part.Length) + state.remaining = part.Substring (index); + + state.elements.host = sb.ToString(); + + return state.remaining.Length > 0; + } + + // port = *DIGIT + private static bool ParsePort (ref ParserState state) + { + string part = state.remaining; + if (part.Length == 0 || part [0] != ':') + return part.Length > 0; + + StringBuilder sb = new StringBuilder (); + + int index; + for (index = 1; index < part.Length; index++ ) { + char ch = part [index]; + + if (!char.IsDigit (ch)) + break; + + sb.Append (ch); + } + + if (index <= part.Length) + state.remaining = part.Substring (index); + + state.elements.port = sb.ToString(); + + return state.remaining.Length > 0; + } + + private static bool ParsePath (ref ParserState state) + { + string part = state.remaining; + StringBuilder sb = new StringBuilder (); + + int index; + for (index = 0; index < part.Length; index++) { + + char ch = part [index]; + + if (ch == '#' || ch == '?') + break; + + sb.Append (ch); + } + + if (index <= part.Length) + state.remaining = part.Substring (index); + + state.elements.path = sb.ToString (); + + return state.remaining.Length > 0; + } + + private static bool ParseQuery (ref ParserState state) + { + string part = state.remaining; + + if (part.Length == 0 || part [0] != '?') + return part.Length > 0; + + StringBuilder sb = new StringBuilder (); + + int index; + for (index = 1; index < part.Length; index++) { + + char ch = part [index]; + + if (ch == '#') + break; + + sb.Append (ch); + } + + if (index <= part.Length) + state.remaining = part.Substring (index); + + state.elements.query = sb.ToString (); + + return state.remaining.Length > 0; + } + + private static bool ParseFragment (ref ParserState state) + { + string part = state.remaining; + + if (part.Length == 0 || part [0] != '#') + return part.Length > 0; + + StringBuilder sb = new StringBuilder (); + + int index; + for (index = 1; index < part.Length; index++) { + + char ch = part [index]; + + sb.Append (ch); + } + + state.elements.fragment = sb.ToString (); + + return false; + } + } +} diff --git a/mcs/class/System/System/UriParser.cs b/mcs/class/System/System/UriParser.cs index 1a85b7d8a10..d5786bb04a6 100644 --- a/mcs/class/System/System/UriParser.cs +++ b/mcs/class/System/System/UriParser.cs @@ -30,13 +30,9 @@ using System.Collections; using System.Globalization; using System.Security.Permissions; using System.Text; -using System.Text.RegularExpressions; namespace System { -#if NET_2_0 - public -#endif - abstract class UriParser { + public abstract class UriParser { static object lock_object = new object (); static Hashtable table; @@ -44,42 +40,26 @@ namespace System { internal string scheme_name; private int default_port; - // Regexp from RFC 2396 -#if NET_2_1 - readonly static Regex uri_regex = new Regex (@"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?"); -#else - // Groups: 12 3 4 5 6 7 8 9 - readonly static Regex uri_regex = new Regex (@"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?", RegexOptions.Compiled); -#endif - - // Groups: 12 3 4 5 - readonly static Regex auth_regex = new Regex (@"^(([^@]+)@)?(.*?)(:([0-9]+))?$"); - protected UriParser () { } - static Match ParseAuthority (Group g) - { - return auth_regex.Match (g.Value); - } - // protected methods protected internal virtual string GetComponents (Uri uri, UriComponents components, UriFormat format) { if ((format < UriFormat.UriEscaped) || (format > UriFormat.SafeUnescaped)) throw new ArgumentOutOfRangeException ("format"); - Match m = uri_regex.Match (uri.OriginalString.Trim ()); + UriElements elements = UriParseComponents.ParseComponents (uri.OriginalString.Trim ()); string scheme = scheme_name; int dp = default_port; if ((scheme == null) || (scheme == "*")) { - scheme = m.Groups [2].Value; + scheme = elements.scheme; dp = Uri.GetDefaultPort (scheme); - } else if (String.Compare (scheme, m.Groups [2].Value, true) != 0) { - throw new SystemException ("URI Parser: scheme mismatch: " + scheme + " vs. " + m.Groups [2].Value); + } else if (String.Compare (scheme, elements.scheme, true) != 0) { + throw new SystemException ("URI Parser: scheme mismatch: " + scheme + " vs. " + elements.scheme); } // it's easier to answer some case directly (as the output isn't identical @@ -88,32 +68,29 @@ namespace System { case UriComponents.Scheme: return scheme; case UriComponents.UserInfo: - return ParseAuthority (m.Groups [4]).Groups [2].Value; + return elements.user; case UriComponents.Host: - return ParseAuthority (m.Groups [4]).Groups [3].Value; + return elements.host; case UriComponents.Port: { - string p = ParseAuthority (m.Groups [4]).Groups [5].Value; - if (p != null && p != String.Empty && p != dp.ToString ()) + string p = elements.port; + if (p != null && p.Length != 0 && p != dp.ToString ()) return p; return String.Empty; } case UriComponents.Path: - return Format (IgnoreFirstCharIf (m.Groups [5].Value, '/'), format); + return Format (IgnoreFirstCharIf (elements.path, '/'), format); case UriComponents.Query: - return Format (m.Groups [7].Value, format); + return Format (elements.query, format); case UriComponents.Fragment: - return Format (m.Groups [9].Value, format); + return Format (elements.fragment, format); case UriComponents.StrongPort: { - Group g = ParseAuthority (m.Groups [4]).Groups [5]; - return g.Success ? g.Value : dp.ToString (); + return elements.port.Length != 0 ? elements.port : dp.ToString (); } case UriComponents.SerializationInfoString: components = UriComponents.AbsoluteUri; break; } - Match am = ParseAuthority (m.Groups [4]); - // now we deal with multiple flags... StringBuilder sb = new StringBuilder (); @@ -123,41 +100,55 @@ namespace System { sb.Append (Uri.GetSchemeDelimiter (scheme)); } - if ((components & UriComponents.UserInfo) != 0) - sb.Append (am.Groups [1].Value); + if ((components & UriComponents.UserInfo) != 0) { + string userinfo = elements.user; + if (!String.IsNullOrEmpty (userinfo)) { + sb.Append (elements.user); + sb.Append ('@'); + } + } if ((components & UriComponents.Host) != 0) - sb.Append (am.Groups [3].Value); + sb.Append (elements.host); // for StrongPort always show port - even if -1 // otherwise only display if ut's not the default port if ((components & UriComponents.StrongPort) != 0) { - Group g = am.Groups [4]; - sb.Append (g.Success ? g.Value : ":" + dp); + sb.Append (":"); + if (elements.port.Length != 0) { + sb.Append (elements.port); + } else { + sb.Append (dp); + } } if ((components & UriComponents.Port) != 0) { - string p = am.Groups [5].Value; - if (p != null && p != String.Empty && p != dp.ToString ()) - sb.Append (am.Groups [4].Value); + string p = elements.port; + if (p != null && p.Length != 0 && p != dp.ToString ()) { + sb.Append (":"); + sb.Append (elements.port); + } } if ((components & UriComponents.Path) != 0) { if ((components & UriComponents.PathAndQuery) != 0 && - (m.Groups [5].Value == null || !m.Groups [5].Value.StartsWith ("/"))) + (elements.path.Length == 0 || !elements.path.StartsWith ("/"))) sb.Append ("/"); - sb.Append (m.Groups [5]); + sb.Append (elements.path); } - if ((components & UriComponents.Query) != 0) - sb.Append (m.Groups [6]); + if ((components & UriComponents.Query) != 0) { + string query = elements.query; + if (!String.IsNullOrEmpty (query)) { + sb.Append ("?"); + sb.Append (elements.query); + } + } string result = Format (sb.ToString (), format); if ((components & UriComponents.Fragment) != 0) { - string f = m.Groups [8].Value; + string f = elements.fragment; if (!String.IsNullOrEmpty (f)) { - // make sure the '#' does not get escaped by 'format' - f = f.Substring (1); result += "#" + Format (f, format); } } @@ -174,7 +165,6 @@ namespace System { parsingError = null; } -#if NET_2_0 protected internal virtual bool IsBaseOf (Uri baseUri, Uri relativeUri) { // compare, not case sensitive, the scheme, host and port (+ user informations) @@ -194,7 +184,6 @@ namespace System { // Though this class does not seem to do anything. Even null arguments aren't checked :/ return uri.IsWellFormedOriginalString (); } -#endif protected internal virtual UriParser OnNewUri () { // nice time for init diff --git a/mcs/class/System/System/UriPartial.cs b/mcs/class/System/System/UriPartial.cs index 07a0a2c4a32..b4ce130fdb2 100644 --- a/mcs/class/System/System/UriPartial.cs +++ b/mcs/class/System/System/UriPartial.cs @@ -37,8 +37,6 @@ namespace System { Scheme = 0, Authority = 1, Path = 2, -#if NET_2_0 Query -#endif } } diff --git a/mcs/class/System/System/UriTypeConverter.cs b/mcs/class/System/System/UriTypeConverter.cs index 6d8b74e424d..c4f660b2e98 100644 --- a/mcs/class/System/System/UriTypeConverter.cs +++ b/mcs/class/System/System/UriTypeConverter.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 - using System.ComponentModel; #if !NET_2_1 using System.ComponentModel.Design.Serialization; @@ -150,5 +148,3 @@ namespace System { #endif } } - -#endif diff --git a/mcs/class/System/System_test.dll.sources b/mcs/class/System/System_test.dll.sources index c800abcd726..f98abde459d 100644 --- a/mcs/class/System/System_test.dll.sources +++ b/mcs/class/System/System_test.dll.sources @@ -234,6 +234,7 @@ System.Net/WebPermissionTest.cs System.Net/WebProxyTest.cs System.Net/WebRequestTest.cs System.Net/WebClientTest.cs +System.Net/WebClientTestAsync.cs System.Net/WebUtilityTest.cs System.Net.Configuration/ConnectionManagementSectionTest.cs System.Net.Configuration/HttpWebRequestElementTest.cs @@ -246,6 +247,7 @@ System.Net.Sockets/TcpListenerTest.cs System.Net.Sockets/SocketTest.cs System.Net.Sockets/SocketAsyncEventArgsTest.cs System.Net.Sockets/UdpClientTest.cs +System.Net.Sockets/SocketAsyncTest.cs System.Net.Mail/LinkedResourceTest.cs System.Net.Mail/AttachmentCollectionTest.cs System.Net.Mail/MailAddressCollectionTest.cs @@ -263,6 +265,7 @@ System.Net.Mail/SmtpServer.cs System.Net.Mime/ContentDispositionTest.cs System.Net.Mime/ContentTypeTest.cs System.Net.NetworkInformation/PhysicalAddressTest.cs +System.Net.Security/SslStreamTest.cs System.Runtime.Versioning/FrameworkNameTest.cs System.Security.Cryptography/AsnEncodedDataTest.cs System.Security.Cryptography/OidCollectionTest.cs diff --git a/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs b/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs index ced822e6ed1..dcacc78373d 100644 --- a/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs +++ b/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs @@ -463,6 +463,46 @@ namespace MonoTests.System.Collections.Generic Assert.IsTrue(sl.Keys[1] == 2, "NCIC #D2"); Assert.IsTrue(sl.Keys[2] == 3, "NCIC #D3"); } + + class Uncomparable : IComparer + { + public int Compare (double x, double y) + { + throw new DivideByZeroException (); + } + } + + [Test] + // Bug #4327 + public void UncomparableList () + { + var list = new SortedList (new Uncomparable ()); + + list.Add (Math.PI, 1); + + try { + list.Add (Math.E, 2); + Assert.Fail ("UC #1"); + } catch (Exception ex) { + Assert.IsInstanceOfType ( + typeof (InvalidOperationException), ex, "UC #2"); + Assert.That (ex.InnerException != null, "UC #3"); + Assert.IsInstanceOfType ( + typeof (DivideByZeroException), ex.InnerException, "UC #4"); + } + + try { + int a; + list.TryGetValue (Math.E, out a); + Assert.Fail ("UC #5"); + } catch (Exception ex) { + Assert.IsInstanceOfType ( + typeof (InvalidOperationException), ex, "UC #5"); + Assert.That (ex.InnerException != null, "UC #6"); + Assert.IsInstanceOfType ( + typeof (DivideByZeroException), ex.InnerException, "UC #7"); + } + } } } diff --git a/mcs/class/System/Test/System.ComponentModel/DateTimeOffsetConverterTests.cs b/mcs/class/System/Test/System.ComponentModel/DateTimeOffsetConverterTests.cs index 5fb4a9c5c65..f0c2c63ca6e 100644 --- a/mcs/class/System/Test/System.ComponentModel/DateTimeOffsetConverterTests.cs +++ b/mcs/class/System/Test/System.ComponentModel/DateTimeOffsetConverterTests.cs @@ -165,6 +165,7 @@ namespace MonoTests.System.ComponentModel } [Test] + [SetCulture("en-US")] public void ConvertToString () { CultureInfo ciUS = new CultureInfo("en-US"); diff --git a/mcs/class/System/Test/System.IO.Ports/SerialPortTest.cs b/mcs/class/System/Test/System.IO.Ports/SerialPortTest.cs index a87f15feb82..12ccfa3e67c 100644 --- a/mcs/class/System/Test/System.IO.Ports/SerialPortTest.cs +++ b/mcs/class/System/Test/System.IO.Ports/SerialPortTest.cs @@ -53,6 +53,7 @@ namespace MonoTests.System.IO.Ports Assert.AreEqual (false, sp.DiscardNull, "#C1"); } + [Category ("NotWorking")] [Test] public void NonstandardBaudRate () { diff --git a/mcs/class/System/Test/System.Net.Security/SslStreamTest.cs b/mcs/class/System/Test/System.Net.Security/SslStreamTest.cs new file mode 100644 index 00000000000..fd1139f2e63 --- /dev/null +++ b/mcs/class/System/Test/System.Net.Security/SslStreamTest.cs @@ -0,0 +1,122 @@ +// +// SslStream.cs +// - Unit tests for System.Net.Security.SslStream +// +// Author: +// Maciej Paszta (maciej.paszta@gmail.com) +// +// Copyright (C) Maciej Paszta, 2012 +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +#if NET_2_0 +using System.Net.Security; +using NUnit.Framework; +using System; +using System.Net.Sockets; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using System.Threading; + +namespace MonoTests.System.Net.Security +{ + +[TestFixture] +public class SslStreamTest { + + byte[] m_serverCertRaw = { 48, 130, 5, 165, 2, 1, 3, 48, 130, 5, 95, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 5, 80, 4, 130, 5, 76, 48, 130, 5, 72, 48, 130, 2, 87, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 130, 2, 72, 48, 130, 2, 68, 2, 1, 0, 48, 130, 2, 61, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 211, 176, 234, 3, 252, 26, 32, 15, 2, 2, 7, 208, 128, 130, 2, 16, 183, 149, 35, 180, 127, 95, 163, 122, 138, 244, 29, 177, 220, 173, 46, 73, 208, 217, 211, 190, 164, 183, 21, 110, 33, 122, 98, 163, 251, 16, 23, 106, 154, 14, 52, 177, 3, 12, 248, 226, 48, 123, 211, 6, 216, 6, 192, 175, 203, 142, 141, 143, 252, 178, 7, 162, 81, 232, 159, 42, 56, 177, 191, 53, 7, 146, 189, 236, 75, 140, 210, 143, 11, 103, 64, 58, 10, 73, 123, 39, 97, 119, 166, 114, 123, 65, 68, 214, 42, 17, 156, 122, 8, 58, 184, 134, 255, 48, 64, 20, 229, 247, 196, 12, 130, 56, 176, 69, 179, 254, 216, 45, 25, 244, 240, 116, 88, 137, 66, 13, 18, 202, 199, 59, 200, 245, 19, 175, 232, 217, 211, 12, 191, 222, 26, 162, 253, 73, 201, 48, 61, 3, 248, 117, 16, 71, 233, 183, 90, 110, 91, 116, 56, 133, 223, 148, 19, 78, 140, 123, 159, 203, 78, 15, 172, 39, 190, 39, 71, 180, 155, 48, 156, 116, 212, 52, 1, 231, 201, 196, 73, 87, 68, 104, 208, 40, 104, 32, 218, 235, 245, 84, 136, 168, 51, 9, 93, 126, 46, 80, 180, 240, 144, 79, 88, 87, 159, 24, 108, 186, 9, 20, 48, 100, 148, 250, 4, 163, 115, 131, 44, 13, 38, 222, 117, 196, 196, 128, 114, 149, 97, 93, 37, 191, 3, 192, 231, 88, 80, 218, 147, 8, 192, 165, 27, 206, 56, 42, 157, 230, 223, 130, 253, 169, 182, 245, 192, 181, 18, 212, 133, 168, 73, 92, 66, 197, 117, 245, 107, 127, 23, 146, 249, 41, 66, 219, 210, 207, 221, 205, 205, 15, 110, 92, 12, 207, 76, 239, 4, 13, 129, 127, 170, 205, 253, 148, 208, 24, 129, 24, 210, 220, 85, 45, 179, 137, 66, 134, 142, 22, 112, 48, 160, 236, 232, 38, 83, 101, 55, 51, 18, 110, 99, 69, 41, 173, 107, 233, 11, 199, 23, 61, 135, 222, 94, 74, 29, 219, 80, 128, 167, 186, 254, 235, 42, 96, 134, 5, 13, 90, 59, 231, 137, 195, 207, 28, 165, 12, 218, 5, 72, 102, 61, 135, 198, 73, 250, 97, 89, 214, 179, 244, 194, 23, 142, 157, 4, 243, 90, 69, 54, 10, 139, 76, 95, 40, 225, 219, 59, 15, 54, 182, 206, 142, 228, 248, 79, 156, 129, 246, 63, 6, 6, 236, 44, 67, 116, 213, 170, 47, 193, 186, 139, 25, 80, 166, 57, 99, 231, 156, 191, 117, 65, 76, 7, 243, 244, 127, 225, 210, 190, 164, 141, 46, 36, 99, 111, 203, 133, 127, 80, 28, 61, 160, 36, 132, 182, 16, 41, 39, 185, 232, 123, 32, 57, 189, 100, 152, 38, 205, 5, 189, 240, 65, 3, 191, 73, 85, 12, 209, 180, 1, 194, 70, 124, 57, 71, 48, 230, 235, 122, 175, 157, 35, 233, 83, 40, 20, 169, 224, 14, 11, 216, 48, 194, 105, 25, 187, 210, 182, 6, 184, 73, 95, 85, 210, 227, 113, 58, 10, 186, 175, 254, 25, 102, 39, 3, 2, 200, 194, 197, 200, 224, 77, 164, 8, 36, 114, 48, 130, 2, 233, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 2, 218, 4, 130, 2, 214, 48, 130, 2, 210, 48, 130, 2, 206, 6, 11, 42, 134, 72, 134, 247, 13, 1, 12, 10, 1, 2, 160, 130, 2, 166, 48, 130, 2, 162, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 178, 13, 52, 135, 85, 49, 79, 105, 2, 2, 7, 208, 4, 130, 2, 128, 21, 84, 227, 109, 230, 144, 140, 170, 117, 250, 179, 207, 129, 100, 126, 126, 29, 231, 94, 140, 45, 26, 168, 45, 240, 4, 170, 73, 98, 115, 109, 96, 177, 206, 6, 80, 170, 22, 237, 144, 58, 95, 59, 26, 85, 135, 178, 69, 184, 44, 122, 81, 213, 135, 149, 198, 246, 83, 68, 129, 2, 186, 118, 33, 44, 214, 227, 240, 220, 51, 175, 220, 220, 180, 113, 216, 101, 138, 81, 54, 38, 0, 216, 30, 29, 187, 213, 230, 12, 181, 130, 21, 241, 98, 120, 41, 150, 176, 69, 37, 169, 249, 123, 212, 254, 135, 154, 214, 127, 39, 105, 149, 180, 218, 41, 207, 75, 70, 105, 169, 185, 169, 132, 173, 188, 82, 251, 71, 234, 136, 5, 254, 110, 223, 34, 4, 145, 7, 19, 51, 123, 140, 75, 226, 0, 21, 220, 228, 223, 218, 8, 169, 210, 194, 139, 93, 218, 55, 40, 174, 50, 238, 38, 166, 222, 103, 0, 209, 88, 131, 51, 222, 154, 217, 18, 172, 73, 17, 133, 54, 173, 208, 118, 104, 167, 113, 153, 223, 251, 154, 120, 176, 18, 127, 51, 206, 164, 77, 86, 9, 82, 212, 86, 162, 206, 230, 79, 217, 178, 42, 217, 162, 152, 188, 217, 59, 212, 117, 200, 135, 75, 74, 43, 1, 42, 79, 180, 164, 250, 122, 103, 103, 157, 11, 14, 33, 48, 8, 108, 155, 46, 124, 223, 204, 169, 124, 104, 11, 246, 213, 226, 16, 125, 17, 228, 15, 178, 141, 79, 78, 115, 76, 131, 122, 166, 124, 154, 1, 174, 178, 176, 213, 208, 188, 71, 118, 220, 168, 64, 218, 176, 134, 38, 229, 14, 109, 162, 125, 16, 57, 249, 201, 180, 17, 182, 143, 184, 12, 248, 113, 65, 70, 109, 79, 249, 34, 170, 35, 228, 219, 121, 202, 228, 121, 127, 255, 22, 173, 202, 171, 33, 232, 4, 240, 142, 216, 80, 56, 177, 83, 93, 123, 217, 213, 157, 99, 34, 194, 61, 228, 239, 194, 20, 27, 9, 53, 132, 79, 19, 97, 107, 31, 51, 39, 176, 223, 90, 88, 67, 138, 194, 169, 176, 144, 202, 119, 146, 74, 27, 118, 63, 129, 230, 101, 104, 75, 116, 49, 223, 254, 225, 70, 206, 183, 11, 134, 148, 10, 55, 57, 50, 178, 144, 164, 139, 233, 169, 109, 186, 211, 95, 123, 75, 111, 192, 187, 127, 240, 45, 226, 194, 240, 128, 10, 79, 178, 192, 66, 21, 197, 24, 171, 141, 255, 185, 230, 84, 206, 151, 9, 93, 115, 162, 12, 115, 129, 218, 103, 219, 183, 142, 123, 3, 110, 139, 208, 4, 146, 76, 99, 246, 240, 32, 169, 148, 16, 146, 172, 230, 36, 56, 145, 23, 94, 209, 92, 38, 244, 127, 70, 121, 253, 66, 55, 36, 140, 98, 105, 233, 112, 24, 23, 230, 112, 62, 244, 12, 48, 30, 51, 0, 18, 244, 139, 66, 245, 234, 203, 195, 52, 119, 255, 84, 82, 204, 100, 176, 167, 24, 224, 8, 127, 214, 148, 115, 242, 56, 190, 72, 221, 68, 252, 36, 74, 254, 57, 52, 96, 20, 173, 32, 236, 87, 15, 16, 76, 9, 48, 3, 61, 2, 137, 137, 9, 68, 213, 99, 163, 63, 201, 83, 241, 98, 7, 117, 108, 4, 123, 170, 18, 10, 19, 198, 31, 170, 15, 247, 216, 145, 172, 239, 137, 181, 80, 160, 24, 11, 35, 131, 58, 218, 22, 250, 215, 52, 160, 246, 197, 183, 92, 137, 0, 245, 63, 49, 183, 246, 195, 58, 63, 4, 75, 10, 92, 131, 181, 59, 78, 247, 44, 150, 49, 49, 107, 211, 62, 71, 62, 222, 159, 161, 118, 236, 55, 219, 49, 0, 3, 82, 236, 96, 20, 83, 39, 245, 208, 240, 245, 174, 218, 49, 21, 48, 19, 6, 9, 42, 134, 72, 134, 247, 13, 1, 9, 21, 49, 6, 4, 4, 1, 0, 0, 0, 48, 61, 48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 30, 154, 48, 126, 198, 239, 114, 62, 12, 58, 129, 172, 67, 156, 76, 214, 62, 205, 89, 28, 4, 20, 135, 177, 105, 83, 79, 93, 181, 149, 169, 49, 112, 201, 70, 212, 153, 79, 198, 163, 137, 90, 2, 2, 7, 208 }; + byte[] m_clientCertRaw = { 48, 130, 5, 173, 2, 1, 3, 48, 130, 5, 103, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 5, 88, 4, 130, 5, 84, 48, 130, 5, 80, 48, 130, 2, 95, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 130, 2, 80, 48, 130, 2, 76, 2, 1, 0, 48, 130, 2, 69, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 35, 249, 113, 131, 30, 42, 21, 176, 2, 2, 7, 208, 128, 130, 2, 24, 78, 185, 144, 242, 231, 15, 133, 251, 122, 86, 61, 132, 148, 253, 47, 83, 198, 14, 11, 70, 79, 14, 21, 66, 91, 72, 147, 159, 95, 245, 240, 210, 194, 174, 25, 112, 171, 126, 126, 143, 64, 173, 63, 224, 49, 172, 100, 129, 84, 86, 91, 50, 28, 29, 118, 139, 22, 251, 248, 181, 110, 246, 226, 92, 108, 178, 25, 199, 62, 90, 12, 5, 189, 249, 22, 230, 37, 230, 190, 97, 50, 12, 252, 4, 66, 204, 92, 12, 98, 222, 69, 230, 221, 64, 163, 106, 194, 113, 223, 40, 81, 138, 123, 212, 171, 160, 178, 153, 29, 108, 64, 110, 166, 82, 26, 157, 63, 69, 66, 93, 231, 232, 228, 189, 85, 63, 11, 53, 192, 171, 124, 148, 0, 31, 106, 146, 207, 71, 16, 138, 214, 79, 0, 103, 133, 199, 116, 45, 127, 230, 199, 230, 11, 179, 9, 253, 45, 23, 194, 122, 217, 20, 200, 214, 127, 138, 133, 190, 29, 110, 129, 29, 20, 186, 106, 182, 114, 134, 120, 170, 120, 137, 111, 200, 137, 10, 43, 139, 183, 217, 245, 38, 165, 126, 142, 233, 20, 238, 238, 185, 12, 71, 4, 54, 128, 28, 70, 139, 94, 119, 25, 243, 241, 161, 125, 97, 132, 19, 225, 249, 117, 226, 108, 58, 163, 221, 126, 111, 192, 157, 65, 104, 134, 83, 92, 26, 143, 23, 112, 12, 94, 111, 59, 138, 79, 93, 98, 49, 239, 77, 99, 119, 89, 127, 176, 12, 217, 67, 46, 84, 74, 10, 63, 227, 18, 153, 118, 104, 92, 31, 198, 187, 91, 139, 239, 231, 154, 111, 254, 75, 172, 166, 87, 251, 152, 231, 61, 101, 115, 121, 190, 52, 95, 195, 134, 176, 248, 143, 13, 145, 141, 107, 166, 175, 231, 243, 27, 105, 150, 61, 179, 89, 134, 182, 140, 243, 116, 170, 255, 110, 26, 137, 79, 102, 45, 225, 160, 67, 75, 19, 58, 188, 168, 11, 98, 149, 139, 164, 93, 236, 115, 245, 59, 183, 177, 3, 115, 218, 35, 117, 62, 172, 172, 179, 230, 209, 116, 119, 41, 144, 90, 242, 74, 107, 153, 130, 250, 38, 236, 33, 11, 117, 51, 42, 213, 15, 24, 57, 193, 250, 76, 41, 79, 229, 249, 215, 236, 131, 136, 160, 186, 142, 7, 70, 197, 21, 148, 57, 136, 70, 89, 15, 157, 231, 130, 24, 80, 99, 64, 144, 75, 210, 255, 101, 51, 200, 237, 180, 238, 195, 173, 187, 225, 177, 212, 99, 176, 28, 51, 33, 37, 230, 79, 112, 142, 174, 75, 183, 125, 207, 108, 88, 9, 76, 173, 254, 165, 193, 97, 39, 245, 80, 0, 131, 225, 116, 179, 67, 168, 171, 143, 11, 49, 153, 244, 185, 253, 9, 42, 40, 53, 225, 137, 184, 37, 31, 53, 121, 28, 140, 27, 145, 84, 182, 40, 176, 152, 135, 77, 232, 20, 144, 74, 81, 227, 29, 26, 179, 50, 80, 244, 181, 54, 146, 224, 25, 233, 70, 0, 153, 227, 72, 140, 142, 185, 141, 177, 127, 252, 107, 240, 146, 255, 122, 194, 92, 147, 69, 52, 67, 124, 144, 207, 146, 182, 131, 48, 130, 2, 233, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 2, 218, 4, 130, 2, 214, 48, 130, 2, 210, 48, 130, 2, 206, 6, 11, 42, 134, 72, 134, 247, 13, 1, 12, 10, 1, 2, 160, 130, 2, 166, 48, 130, 2, 162, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 46, 213, 31, 185, 121, 55, 235, 182, 2, 2, 7, 208, 4, 130, 2, 128, 62, 51, 182, 78, 208, 241, 24, 1, 167, 56, 187, 181, 138, 26, 252, 10, 43, 143, 17, 4, 102, 205, 177, 108, 52, 174, 60, 135, 233, 89, 184, 112, 5, 43, 87, 209, 148, 146, 224, 83, 167, 26, 165, 130, 202, 139, 251, 183, 156, 167, 251, 209, 127, 169, 91, 124, 18, 171, 5, 47, 145, 51, 113, 161, 84, 123, 26, 149, 11, 79, 8, 14, 242, 162, 215, 239, 51, 120, 85, 183, 144, 208, 130, 198, 4, 98, 217, 54, 29, 168, 103, 60, 50, 72, 92, 160, 51, 107, 153, 40, 15, 143, 75, 78, 212, 77, 206, 188, 176, 134, 213, 101, 109, 116, 238, 215, 26, 90, 33, 134, 160, 56, 21, 200, 6, 27, 185, 239, 8, 193, 188, 61, 114, 101, 76, 224, 75, 28, 18, 149, 83, 33, 100, 103, 59, 246, 21, 236, 141, 241, 126, 163, 126, 236, 180, 106, 98, 6, 196, 11, 19, 12, 81, 153, 79, 221, 230, 199, 176, 95, 8, 124, 189, 242, 151, 182, 126, 250, 227, 53, 55, 86, 39, 85, 171, 57, 157, 14, 215, 226, 204, 195, 59, 121, 85, 54, 213, 45, 101, 164, 38, 112, 114, 168, 20, 28, 152, 139, 43, 146, 15, 84, 64, 46, 39, 55, 56, 110, 160, 32, 120, 156, 253, 64, 79, 163, 3, 156, 85, 80, 197, 214, 26, 250, 200, 63, 212, 4, 119, 96, 32, 25, 1, 121, 112, 170, 87, 75, 163, 32, 175, 195, 82, 64, 74, 247, 4, 152, 203, 18, 129, 201, 221, 98, 35, 84, 148, 57, 15, 121, 90, 195, 79, 50, 99, 73, 163, 162, 131, 26, 203, 106, 237, 135, 203, 239, 43, 253, 187, 68, 33, 82, 101, 121, 61, 9, 223, 54, 67, 138, 11, 146, 175, 102, 163, 112, 51, 63, 124, 248, 183, 89, 81, 250, 15, 159, 161, 201, 38, 6, 243, 224, 61, 143, 117, 144, 157, 184, 242, 248, 155, 150, 17, 13, 158, 1, 91, 33, 107, 65, 106, 153, 211, 18, 7, 138, 230, 8, 84, 56, 110, 227, 0, 47, 33, 181, 141, 185, 119, 93, 72, 192, 100, 76, 145, 40, 163, 185, 96, 154, 151, 172, 86, 249, 167, 237, 97, 28, 137, 27, 127, 114, 218, 49, 106, 92, 40, 201, 252, 219, 52, 129, 17, 105, 198, 29, 166, 30, 229, 103, 216, 102, 84, 146, 210, 114, 32, 186, 205, 252, 253, 142, 103, 75, 83, 122, 72, 42, 118, 210, 41, 113, 227, 206, 27, 79, 83, 5, 31, 201, 245, 165, 18, 210, 112, 215, 144, 78, 91, 84, 3, 61, 236, 192, 152, 78, 16, 254, 242, 67, 46, 228, 98, 102, 20, 2, 43, 134, 97, 180, 17, 189, 30, 214, 167, 32, 128, 106, 61, 227, 166, 41, 81, 51, 208, 245, 114, 147, 66, 34, 212, 35, 152, 26, 173, 133, 0, 207, 88, 5, 171, 175, 5, 75, 207, 50, 153, 141, 141, 2, 47, 236, 252, 132, 87, 173, 163, 208, 119, 213, 77, 58, 145, 12, 21, 40, 4, 23, 114, 204, 89, 136, 152, 123, 159, 205, 149, 51, 21, 146, 219, 75, 25, 199, 22, 210, 203, 66, 19, 10, 188, 98, 152, 60, 161, 234, 122, 109, 232, 197, 79, 77, 185, 80, 210, 87, 120, 232, 158, 103, 124, 88, 110, 47, 4, 67, 123, 72, 230, 160, 33, 1, 146, 163, 54, 149, 79, 54, 21, 124, 163, 210, 38, 150, 176, 100, 53, 56, 220, 190, 98, 203, 250, 122, 34, 213, 17, 101, 203, 37, 231, 176, 182, 65, 196, 42, 169, 76, 21, 27, 87, 95, 88, 82, 52, 234, 179, 82, 207, 62, 185, 251, 85, 225, 70, 245, 220, 29, 177, 64, 146, 94, 216, 101, 226, 10, 116, 209, 44, 10, 49, 21, 48, 19, 6, 9, 42, 134, 72, 134, 247, 13, 1, 9, 21, 49, 6, 4, 4, 1, 0, 0, 0, 48, 61, 48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 200, 225, 57, 176, 214, 252, 236, 240, 126, 231, 49, 34, 77, 228, 178, 235, 151, 135, 242, 52, 4, 20, 251, 225, 117, 50, 254, 96, 240, 190, 40, 228, 34, 104, 253, 203, 163, 169, 25, 46, 239, 103, 2, 2, 7, 208 }; + X509Certificate2 m_serverCert; + X509Certificate2 m_clientCert; + + [SetUp] + public void GetReady () { + m_serverCert = new X509Certificate2 (m_serverCertRaw, "server"); + m_clientCert = new X509Certificate2 (m_clientCertRaw, "client"); + } + + [Test] //bug https://bugzilla.novell.com/show_bug.cgi?id=457120 + public void AuthenticateClientAndServer_ClientSendsNoData () { + IPEndPoint endPoint = new IPEndPoint (IPAddress.Parse ("127.0.0.1"), 10000); + ClientServerState state = new ClientServerState (); + state.Client = new TcpClient (); + state.Listener = new TcpListener (endPoint); + state.Listener.Start (); + state.ServerAuthenticated = new AutoResetEvent (false); + state.ClientAuthenticated = new AutoResetEvent (false); + try { + Thread serverThread = new Thread (() => StartServerAndAuthenticate (state)); + serverThread.Start (null); + Thread clientThread = new Thread (() => StartClientAndAuthenticate (state, endPoint)); + clientThread.Start (null); + Assert.IsTrue (state.ServerAuthenticated.WaitOne (TimeSpan.FromSeconds (2)), + "server not authenticated"); + Assert.IsTrue (state.ClientAuthenticated.WaitOne (TimeSpan.FromSeconds (2)), + "client not authenticated"); + } finally { + if (state.ClientStream != null) + state.ClientStream.Dispose (); + state.Client.Close (); + if (state.ServerStream != null) + state.ServerStream.Dispose (); + if (state.ServerClient != null) + state.ServerClient.Close (); + state.Listener.Stop (); + } + } + + private void StartClientAndAuthenticate (ClientServerState state, + IPEndPoint endPoint) { + try { + state.Client.Connect (endPoint.Address, endPoint.Port); + NetworkStream s = state.Client.GetStream (); + state.ClientStream = new SslStream (s, false, + (a1, a2, a3, a4) => true, + (a1, a2, a3, a4, a5) => m_clientCert); + state.ClientStream.AuthenticateAsClient ("test_host"); + state.ClientAuthenticated.Set (); + } catch (ObjectDisposedException) { /* this can happen when closing connection it's irrelevant for the test result*/} + } + + private void StartServerAndAuthenticate (ClientServerState state) { + try { + state.ServerClient = state.Listener.AcceptTcpClient (); + NetworkStream s = state.ServerClient.GetStream (); + state.ServerStream = new SslStream (s, false, + (a1, a2, a3, a4) => true, + (a1, a2, a3, a4, a5) => m_serverCert); + state.ServerStream.AuthenticateAsServer (m_serverCert); + state.ServerAuthenticated.Set (); + } catch (ObjectDisposedException) { /* this can happen when closing connection it's irrelevant for the test result*/} + } + + private class ClientServerState { + public TcpListener Listener { get; set; } + public TcpClient Client { get; set; } + public TcpClient ServerClient { get; set; } + public SslStream ServerStream { get; set; } + public SslStream ClientStream { get; set; } + public AutoResetEvent ServerAuthenticated { get; set; } + public AutoResetEvent ClientAuthenticated { get; set; } + } +} +} +#endif diff --git a/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs b/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs index 684dd391f94..eaadb513d6e 100644 --- a/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs @@ -211,6 +211,7 @@ namespace MonoTests.System.Net.Sockets #endif [Test] + [Category ("NotOnMac")] public void Group () { IPAddress group; @@ -251,6 +252,7 @@ namespace MonoTests.System.Net.Sockets #if NET_2_0 [Test] + [Category ("NotOnMac")] public void InterfaceIndex () { IPAddress group; @@ -314,6 +316,7 @@ namespace MonoTests.System.Net.Sockets #endif [Test] + [Category ("NotOnMac")] public void LocalAddress () { IPAddress group; diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketAsyncTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketAsyncTest.cs new file mode 100644 index 00000000000..f137139a55f --- /dev/null +++ b/mcs/class/System/Test/System.Net.Sockets/SocketAsyncTest.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections; +using System.Threading; +using System.Net; +using System.Net.Sockets; +using NUnit.Framework; + +namespace MonoTests.System.Net.Sockets +{ + [TestFixture] + public class SocketAsyncTest + { + Socket serverSocket; + Socket clientSocket; + ManualResetEvent readyEvent; + ManualResetEvent mainEvent; + Exception error; + + [TestFixtureSetUp] + public void SetUp () + { + readyEvent = new ManualResetEvent (false); + mainEvent = new ManualResetEvent (false); + + ThreadPool.QueueUserWorkItem (_ => DoWork ()); + readyEvent.WaitOne (); + + clientSocket = new Socket ( + AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + clientSocket.Connect (serverSocket.LocalEndPoint); + clientSocket.NoDelay = true; + } + + [TestFixtureTearDown] + public void TearDown () + { + if (serverSocket != null) + serverSocket.Close (); + readyEvent.Close (); + mainEvent.Close (); + } + + void DoWork () + { + serverSocket = new Socket ( + AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + serverSocket.Bind (new IPEndPoint (IPAddress.Loopback, 0)); + serverSocket.Listen (1); + + var async = new SocketAsyncEventArgs (); + async.Completed += (s,e) => OnAccepted (e); + + readyEvent.Set (); + + if (!serverSocket.AcceptAsync (async)) + OnAccepted (async); + } + + void OnAccepted (SocketAsyncEventArgs e) + { + var acceptSocket = e.AcceptSocket; + + try { + var header = new byte [4]; + acceptSocket.Receive (header); + if ((header [0] != 0x12) || (header [1] != 0x34) || + (header [2] != 0x56) || (header [3] != 0x78)) + throw new InvalidOperationException (); + } catch (Exception ex) { + error = ex; + return; + } + + var recvAsync = new SocketAsyncEventArgs (); + recvAsync.Completed += (sender, args) => OnReceived (args); + recvAsync.SetBuffer (new byte [4], 0, 4); + if (!acceptSocket.ReceiveAsync (recvAsync)) + OnReceived (recvAsync); + + mainEvent.Set (); + } + + void OnReceived (SocketAsyncEventArgs e) + { + if (e.SocketError != SocketError.Success) + error = new SocketException ((int) e.SocketError); + else if (e.Buffer [0] != 0x9a) + error = new InvalidOperationException (); + + mainEvent.Set (); + } + + [Test] + [Category("Test")] + public void SendAsync () + { + var buffer = new byte [] { 0x12, 0x34, 0x56, 0x78 }; + var m = new ManualResetEvent (false); + var e = new SocketAsyncEventArgs (); + e.SetBuffer (buffer, 0, buffer.Length); + e.Completed += (s,o) => { + if (o.SocketError != SocketError.Success) + error = new SocketException ((int)o.SocketError); + m.Set (); + }; + bool res = clientSocket.SendAsync (e); + if (res) { + if (!m.WaitOne (1500)) + throw new TimeoutException (); + } + + if (!mainEvent.WaitOne (1500)) + throw new TimeoutException (); + if (error != null) + throw error; + + m.Reset (); + mainEvent.Reset (); + + buffer [0] = 0x9a; + buffer [1] = 0xbc; + buffer [2] = 0xde; + buffer [3] = 0xff; + res = clientSocket.SendAsync (e); + if (res) { + if (!m.WaitOne (1500)) + throw new TimeoutException (); + } + + if (!mainEvent.WaitOne (1500)) + throw new TimeoutException (); + if (error != null) + throw error; + } + } +} \ No newline at end of file diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs index 4402ff26ac3..13294437a1a 100644 --- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs @@ -1737,6 +1737,7 @@ namespace MonoTests.System.Net.Sockets } [Test] + [Category ("NotOnMac")] public void BeginConnectMultiple () { Socket sock = new Socket (AddressFamily.InterNetwork, @@ -3341,6 +3342,7 @@ namespace MonoTests.System.Net.Sockets #if NET_2_0 [Test] + [Category ("NotOnMac")] public void ConnectedProperty () { TcpListener listener = new TcpListener (IPAddress.Loopback, 23456); @@ -3616,6 +3618,7 @@ namespace MonoTests.System.Net.Sockets } [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object) + [Category ("NotOnMac")] public void SetSocketOption3_AddMembershipIPv6_IPv6MulticastOption () { #if NET_2_0 @@ -3896,6 +3899,7 @@ namespace MonoTests.System.Net.Sockets } [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object) + [Category ("NotOnMac")] public void SetSocketOption3_DropMembershipIPv6_IPv6MulticastOption () { #if NET_2_0 @@ -3918,6 +3922,7 @@ namespace MonoTests.System.Net.Sockets } [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object) + [Category ("NotOnMac")] public void SetSocketOption3_DropMembershipIPv6_MulticastOption () { #if NET_2_0 diff --git a/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs b/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs index 1b1c30b55db..1823f05a681 100644 --- a/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs @@ -262,6 +262,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] // .ctor (Int32, AddressFamily) + [Category ("NotOnMac")] public void Constructor5 () { MyUdpClient client; @@ -383,6 +384,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] // .ctor (String, Int32) + [Category ("NotOnMac")] public void Constructor6 () { MyUdpClient client; @@ -477,6 +479,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] + [Category ("NotOnMac")] public void UdpClientBroadcastTest () { UdpClient client = new UdpClient (new IPEndPoint (IPAddress.Loopback, 1234)); @@ -500,6 +503,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] // JoinMulticastGroup (IPAddress) + [Category ("NotOnMac")] public void JoinMulticastGroup1_IPv6 () { #if NET_2_0 @@ -609,6 +613,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] // JoinMulticastGroup (In32, IPAddress) + [Category ("NotOnMac")] public void JoinMulticastGroup2_IPv6 () { #if NET_2_0 @@ -700,6 +705,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] // JoinMulticastGroup (IPAddress, Int32) + [Category ("NotOnMac")] public void JoinMulticastGroup3_IPv6 () { #if NET_2_0 @@ -956,6 +962,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] + [Category ("NotOnMac")] public void BeginSend () { UdpClient client = new UdpClient (); @@ -1010,6 +1017,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] + [Category ("NotOnMac")] public void BeginReceive () { UdpClient client = new UdpClient (1237); @@ -1035,6 +1043,7 @@ namespace MonoTests.System.Net.Sockets { } [Test] + [Category ("NotOnMac")] public void Available () { UdpClient client = new UdpClient (1238); diff --git a/mcs/class/System/Test/System.Net/CookieContainerTest.cs b/mcs/class/System/Test/System.Net/CookieContainerTest.cs index 866d5a57286..78fd0e506d4 100644 --- a/mcs/class/System/Test/System.Net/CookieContainerTest.cs +++ b/mcs/class/System/Test/System.Net/CookieContainerTest.cs @@ -768,6 +768,7 @@ namespace MonoTests.System.Net { [Test] public void GetCookieHeader4 () { + Console.WriteLine ("CookieHeader4"); CookieContainer cc = new CookieContainer (); Cookie cookie = new Cookie ("Height", "178", "/Whatever", "mono.com"); cc.Add (cookie); @@ -1386,6 +1387,7 @@ namespace MonoTests.System.Net { { CookieContainer cc; CookieCollection cookies; + string hostname = Dns.GetHostName (); cc = new CookieContainer (); cc.SetCookies (new Uri ("http://localhost/Whatever/Do"), @@ -1396,9 +1398,9 @@ namespace MonoTests.System.Net { cookies = cc.GetCookies (new Uri ("http://127.0.0.1/Whatever/Do")); Assert.IsNotNull (cookies, "#A3"); Assert.AreEqual (0, cookies.Count, "#A4"); - cookies = cc.GetCookies (new Uri ("http://" + Dns.GetHostName () + "/Whatever/Do")); + cookies = cc.GetCookies (new Uri ("http://" + hostname + "/Whatever/Do")); Assert.IsNotNull (cookies, "#A5"); - Assert.AreEqual (0, cookies.Count, "#A6"); + Assert.AreEqual (hostname.EndsWith (".local") ? 1 : 0, cookies.Count, "#A6"); cc = new CookieContainer (); cc.SetCookies (new Uri ("http://127.0.0.1/Whatever/Do"), @@ -1409,12 +1411,12 @@ namespace MonoTests.System.Net { cookies = cc.GetCookies (new Uri ("http://127.0.0.1/Whatever/Do")); Assert.IsNotNull (cookies, "#B3"); Assert.AreEqual (0, cookies.Count, "#B4"); - cookies = cc.GetCookies (new Uri ("http://" + Dns.GetHostName () + "/Whatever/Do")); + cookies = cc.GetCookies (new Uri ("http://" + hostname + "/Whatever/Do")); Assert.IsNotNull (cookies, "#B5"); - Assert.AreEqual (0, cookies.Count, "#B6"); + Assert.AreEqual (hostname.EndsWith (".local") ? 1 : 0, cookies.Count, "#B6"); cc = new CookieContainer (); - cc.SetCookies (new Uri ("http://" + Dns.GetHostName () + "/Whatever/Do"), + cc.SetCookies (new Uri ("http://" + hostname + "/Whatever/Do"), "Age=26; path=/Whatever; domain=.local"); cookies = cc.GetCookies (new Uri ("http://localhost/Whatever/Do")); Assert.IsNotNull (cookies, "#C1"); @@ -1422,9 +1424,9 @@ namespace MonoTests.System.Net { cookies = cc.GetCookies (new Uri ("http://127.0.0.1/Whatever/Do")); Assert.IsNotNull (cookies, "#C3"); Assert.AreEqual (0, cookies.Count, "#C4"); - cookies = cc.GetCookies (new Uri ("http://" + Dns.GetHostName () + "/Whatever/Do")); + cookies = cc.GetCookies (new Uri ("http://" + hostname + "/Whatever/Do")); Assert.IsNotNull (cookies, "#C5"); - Assert.AreEqual (0, cookies.Count, "#C6"); + Assert.AreEqual (hostname.EndsWith (".local") ? 1 : 0, cookies.Count, "#C6"); } [Test] diff --git a/mcs/class/System/Test/System.Net/HttpListener2Test.cs b/mcs/class/System/Test/System.Net/HttpListener2Test.cs index f519c3fb1c1..6fefaa282f6 100644 --- a/mcs/class/System/Test/System.Net/HttpListener2Test.cs +++ b/mcs/class/System/Test/System.Net/HttpListener2Test.cs @@ -35,6 +35,7 @@ using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; + using NUnit.Framework; // *************************************************************************************** @@ -42,11 +43,15 @@ using NUnit.Framework; // unregister it even after explicitly closing the listener. // *************************************************************************************** namespace MonoTests.System.Net { + [TestFixture] #if TARGET_JVM [Ignore ("The class HttpListener is not supported")] #endif public class HttpListener2Test { + + private HttpListener _listener = null; + public class MyNetworkStream : NetworkStream { public MyNetworkStream (Socket sock) : base (sock, true) { @@ -121,29 +126,36 @@ namespace MonoTests.System.Net { return null; return listener.EndGetContext (ares); } + + [TearDown] + public void Dispose() + { + if (_listener != null) { + _listener.Close(); + _listener = null; + } + } [Test] public void Test1 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test1/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, "GET / HTTP/1.1\r\n\r\n"); // No host - string response = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 400")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test1/"); + NetworkStream ns = CreateNS (9000); + Send (ns, "GET / HTTP/1.1\r\n\r\n"); // No host + string response = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 400")); } [Test] public void Test2 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test2/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, "GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); // no prefix - string response = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 400")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test2/"); + NetworkStream ns = CreateNS (9000); + Send (ns, "GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); // no prefix + string response = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 400")); } [Test] @@ -173,158 +185,148 @@ namespace MonoTests.System.Net { bad.Append ('}'); foreach (char b in bad.ToString ()){ - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test3/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, String.Format ("MA{0} / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n", b)); // bad method - - string response = Receive (ns, 512); - ns.Close (); - Assert.AreEqual (true, response.StartsWith ("HTTP/1.1 400"), String.Format ("Failed on {0}", (int) b)); - } + HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test3/"); + NetworkStream ns = CreateNS (9000); + Send (ns, String.Format ("MA{0} / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n", b)); // bad method + + string response = Receive (ns, 512); + ns.Close (); + listener.Close (); + Assert.AreEqual (true, response.StartsWith ("HTTP/1.1 400"), String.Format ("Failed on {0}", (int) b)); } } [Test] public void Test4 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test4/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, "POST /test4/ HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); // length required - string response = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 411")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test4/"); + NetworkStream ns = CreateNS (9000); + Send (ns, "POST /test4/ HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); // length required + string response = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 411")); } [Test] public void Test5 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test5/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, "POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nTransfer-Encoding: pepe\r\n\r\n"); // not implemented - string response = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 501")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test5/"); + NetworkStream ns = CreateNS (9000); + Send (ns, "POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nTransfer-Encoding: pepe\r\n\r\n"); // not implemented + string response = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 501")); } [Test] public void Test6 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test6/")) { - NetworkStream ns = CreateNS (9000); - // not implemented! This is against the RFC. Should be a bad request/length required - Send (ns, "POST /test6/ HTTP/1.1\r\nHost: 127.0.0.1\r\nTransfer-Encoding: identity\r\n\r\n"); - string response = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 501")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test6/"); + NetworkStream ns = CreateNS (9000); + // not implemented! This is against the RFC. Should be a bad request/length required + Send (ns, "POST /test6/ HTTP/1.1\r\nHost: 127.0.0.1\r\nTransfer-Encoding: identity\r\n\r\n"); + string response = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 501")); } [Test] public void Test7 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test7/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, "POST /test7/ HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); - HttpListenerContext ctx = listener.GetContext (); - Send (ctx.Response.OutputStream, "%%%OK%%%"); - ctx.Response.Close (); - string response = Receive (ns, 1024); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 200")); - Assert.IsTrue (-1 != response.IndexOf ("Transfer-Encoding: chunked")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test7/"); + NetworkStream ns = CreateNS (9000); + Send (ns, "POST /test7/ HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); + HttpListenerContext ctx = _listener.GetContext (); + Send (ctx.Response.OutputStream, "%%%OK%%%"); + ctx.Response.Close (); + string response = Receive (ns, 1024); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 200")); + Assert.IsTrue (-1 != response.IndexOf ("Transfer-Encoding: chunked")); } [Test] public void Test8 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test8/")) { - NetworkStream ns = CreateNS (9000); - // Just like Test7, but 1.0 - Send (ns, "POST /test8/ HTTP/1.0\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); - HttpListenerContext ctx = listener.GetContext (); - Send (ctx.Response.OutputStream, "%%%OK%%%"); - ctx.Response.Close (); - string response = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 200")); - Assert.IsTrue (-1 == response.IndexOf ("Transfer-Encoding: chunked")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test8/"); + NetworkStream ns = CreateNS (9000); + // Just like Test7, but 1.0 + Send (ns, "POST /test8/ HTTP/1.0\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); + HttpListenerContext ctx = _listener.GetContext (); + Send (ctx.Response.OutputStream, "%%%OK%%%"); + ctx.Response.Close (); + string response = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 200")); + Assert.IsTrue (-1 == response.IndexOf ("Transfer-Encoding: chunked")); } [Test] public void Test9 () { // 1.0 + "Transfer-Encoding: chunked" - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test9/")) { - NetworkStream ns = CreateNS (9000); - Send (ns, "POST /test9/ HTTP/1.0\r\nHost: 127.0.0.1\r\nTransfer-Encoding: chunked\r\n\r\n3\r\n123\r\n0\r\n\r\n"); - bool timeout; - string response = ReceiveWithTimeout (ns, 512, 1000, out timeout); - ns.Close (); - Assert.IsFalse (timeout); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 411")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test9/"); + NetworkStream ns = CreateNS (9000); + Send (ns, "POST /test9/ HTTP/1.0\r\nHost: 127.0.0.1\r\nTransfer-Encoding: chunked\r\n\r\n3\r\n123\r\n0\r\n\r\n"); + bool timeout; + string response = ReceiveWithTimeout (ns, 512, 1000, out timeout); + ns.Close (); + Assert.IsFalse (timeout); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 411")); } [Test] public void Test10 () { // Same as Test9, but now we shutdown the socket for sending. - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test10/")) { - MyNetworkStream ns = CreateNS (9000); - Send (ns, "POST /test10/ HTTP/1.0\r\nHost: 127.0.0.1\r\nTransfer-Encoding: chunked\r\n\r\n3\r\n123\r\n0\r\n\r\n"); - ns.GetSocket ().Shutdown (SocketShutdown.Send); - bool timeout; - string response = ReceiveWithTimeout (ns, 512, 1000, out timeout); - ns.Close (); - Assert.IsFalse (timeout); - Assert.IsTrue (response.StartsWith ("HTTP/1.1 411")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test10/"); + MyNetworkStream ns = CreateNS (9000); + Send (ns, "POST /test10/ HTTP/1.0\r\nHost: 127.0.0.1\r\nTransfer-Encoding: chunked\r\n\r\n3\r\n123\r\n0\r\n\r\n"); + ns.GetSocket ().Shutdown (SocketShutdown.Send); + bool timeout; + string response = ReceiveWithTimeout (ns, 512, 1000, out timeout); + ns.Close (); + Assert.IsFalse (timeout); + Assert.IsTrue (response.StartsWith ("HTTP/1.1 411")); } [Test] public void Test11 () { // 0.9 - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test11/")) { - MyNetworkStream ns = CreateNS (9000); - Send (ns, "POST /test11/ HTTP/0.9\r\nHost: 127.0.0.1\r\n\r\n123"); - ns.GetSocket ().Shutdown (SocketShutdown.Send); - string input = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (input.StartsWith ("HTTP/1.1 400")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test11/"); + MyNetworkStream ns = CreateNS (9000); + Send (ns, "POST /test11/ HTTP/0.9\r\nHost: 127.0.0.1\r\n\r\n123"); + ns.GetSocket ().Shutdown (SocketShutdown.Send); + string input = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (input.StartsWith ("HTTP/1.1 400")); } [Test] public void Test12 () { // 0.9 - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test12/")) { - MyNetworkStream ns = CreateNS (9000); - Send (ns, "POST /test12/ HTTP/0.9\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); - ns.GetSocket ().Shutdown (SocketShutdown.Send); - string input = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (input.StartsWith ("HTTP/1.1 400")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test12/"); + MyNetworkStream ns = CreateNS (9000); + Send (ns, "POST /test12/ HTTP/0.9\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); + ns.GetSocket ().Shutdown (SocketShutdown.Send); + string input = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (input.StartsWith ("HTTP/1.1 400")); } [Test] public void Test13 () { // 0.9 - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test13/")) { - MyNetworkStream ns = CreateNS (9000); - Send (ns, "GEt /test13/ HTTP/0.9\r\nHost: 127.0.0.1\r\n\r\n"); - ns.GetSocket ().Shutdown (SocketShutdown.Send); - string input = Receive (ns, 512); - ns.Close (); - Assert.IsTrue (input.StartsWith ("HTTP/1.1 400")); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test13/"); + MyNetworkStream ns = CreateNS (9000); + Send (ns, "GEt /test13/ HTTP/0.9\r\nHost: 127.0.0.1\r\n\r\n"); + ns.GetSocket ().Shutdown (SocketShutdown.Send); + string input = Receive (ns, 512); + ns.Close (); + Assert.IsTrue (input.StartsWith ("HTTP/1.1 400")); } HttpListenerRequest test14_request; @@ -333,24 +335,23 @@ namespace MonoTests.System.Net { [Test] public void Test14 () { - using (HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test14/")) { - MyNetworkStream ns = CreateNS (9000); - Send (ns, "POST /test14/ HTTP/1.0\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); - HttpListenerContext c = listener.GetContext (); - test14_request = c.Request; - test_evt = new ManualResetEvent (false); - Thread thread = new Thread (ReadToEnd); - thread.Start (); - if (test_evt.WaitOne (3000, false) == false) { - thread.Abort (); - test_evt.Close (); - Assert.IsTrue (false, "Timed out"); - } + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test14/"); + MyNetworkStream ns = CreateNS (9000); + Send (ns, "POST /test14/ HTTP/1.0\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); + HttpListenerContext c = _listener.GetContext (); + test14_request = c.Request; + test_evt = new ManualResetEvent (false); + Thread thread = new Thread (ReadToEnd); + thread.Start (); + if (test_evt.WaitOne (3000, false) == false) { + thread.Abort (); test_evt.Close (); - c.Response.Close (); - ns.Close (); - Assert.AreEqual ("123", read_to_end, "Did not get the expected input."); + Assert.IsTrue (false, "Timed out"); } + test_evt.Close (); + c.Response.Close (); + ns.Close (); + Assert.AreEqual ("123", read_to_end, "Did not get the expected input."); } string read_to_end; @@ -366,13 +367,13 @@ namespace MonoTests.System.Net { public void Test15 () { // 2 separate writes -> 2 packets. Body size > 8kB - HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test15/"); + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test15/"); MyNetworkStream ns = CreateNS (9000); Send (ns, "POST /test15/ HTTP/1.0\r\nHost: 127.0.0.1\r\nContent-Length: 8888\r\n\r\n"); Thread.Sleep (800); string data = new string ('a', 8888); Send (ns, data); - HttpListenerContext c = listener.GetContext (); + HttpListenerContext c = _listener.GetContext (); HttpListenerRequest req = c.Request; using (StreamReader r = new StreamReader (req.InputStream)) { read_to_end = r.ReadToEnd (); @@ -387,7 +388,7 @@ namespace MonoTests.System.Net { public void Test16 () { // 1 single write with headers + body (size > 8kB) - HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test16/"); + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test16/"); MyNetworkStream ns = CreateNS (9000); StringBuilder sb = new StringBuilder (); sb.Append ("POST /test16/ HTTP/1.0\r\nHost: 127.0.0.1\r\nContent-Length: 8888\r\n\r\n"); @@ -395,7 +396,7 @@ namespace MonoTests.System.Net { sb.Append (eights); string data = sb.ToString (); Send (ns, data); - HttpListenerContext c = listener.GetContext (); + HttpListenerContext c = _listener.GetContext (); HttpListenerRequest req = c.Request; using (StreamReader r = new StreamReader (req.InputStream)) { read_to_end = r.ReadToEnd (); @@ -409,15 +410,14 @@ namespace MonoTests.System.Net { [Test] public void Test17 () { - HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/test17/"); + _listener = CreateAndStartListener ("http://127.0.0.1:9000/test17/"); NetworkStream ns = CreateNS (9000); Send (ns, "RANDOM /test17/ HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Length: 3\r\n\r\n123"); - HttpListenerContext ctx = listener.GetContext (); + HttpListenerContext ctx = _listener.GetContext (); Send (ctx.Response.OutputStream, "%%%OK%%%"); ctx.Response.Close (); string response = Receive (ns, 1024); ns.Close (); - listener.Close (); Assert.IsTrue (response.StartsWith ("HTTP/1.1 200")); Assert.IsTrue (-1 != response.IndexOf ("Transfer-Encoding: chunked")); } @@ -425,16 +425,15 @@ namespace MonoTests.System.Net { [Test] public void Test_MultipleClosesOnOuputStreamAllowed () { - HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/MultipleCloses/"); + _listener = CreateAndStartListener ("http://127.0.0.1:9000/MultipleCloses/"); NetworkStream ns = CreateNS (9000); Send (ns, "GET /MultipleCloses/ HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); - HttpListenerContext ctx = listener.GetContext (); + HttpListenerContext ctx = _listener.GetContext (); ctx.Response.OutputStream.Close (); ctx.Response.OutputStream.Close (); ctx.Response.OutputStream.Close (); ctx.Response.Close (); - listener.Close (); } void SendCookie () @@ -455,11 +454,11 @@ namespace MonoTests.System.Net { [Test] public void ReceiveCookiesFromClient () { - HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/SendCookie/"); + _listener = CreateAndStartListener ("http://127.0.0.1:9000/SendCookie/"); Thread clientThread = new Thread (new ThreadStart (SendCookie)); clientThread.Start (); - HttpListenerContext context = listener.GetContext(); + HttpListenerContext context = _listener.GetContext(); HttpListenerRequest request = context.Request; Assert.AreEqual (3, request.Cookies.Count, "#1"); @@ -482,8 +481,6 @@ namespace MonoTests.System.Net { } else Assert.Fail ("Invalid cookie name " + c.Name); } - - listener.Close (); } private object _lock = new Object(); @@ -500,11 +497,11 @@ namespace MonoTests.System.Net { [Test] public void SendCookiestoClient () { - HttpListener listener = CreateAndStartListener ("http://127.0.0.1:9000/ReceiveCookie/"); + _listener = CreateAndStartListener ("http://127.0.0.1:9000/ReceiveCookie/"); Thread clientThread = new Thread (new ThreadStart (ReceiveCookie)); clientThread.Start (); - HttpListenerContext context = listener.GetContext(); + HttpListenerContext context = _listener.GetContext(); HttpListenerRequest request = context.Request; HttpListenerResponse response = context.Response; @@ -545,8 +542,6 @@ namespace MonoTests.System.Net { } Assert.IsTrue (foundCookie, "#6"); } - - listener.Close (); } [Test] @@ -581,14 +576,14 @@ namespace MonoTests.System.Net { void EchoServer () { - HttpListener listener = new HttpListener (); - listener.Prefixes.Add ("http://*:8888/foobar/"); - listener.Start (); + _listener = new HttpListener (); + _listener.Prefixes.Add ("http://*:8888/foobar/"); + _listener.Start (); manualReset = new ManualResetEvent (false); - IAsyncResult result = listener.BeginGetContext ( - new AsyncCallback (EchoCallback), listener); + IAsyncResult result = _listener.BeginGetContext ( + new AsyncCallback (EchoCallback), _listener); manualReset.WaitOne (); } diff --git a/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs b/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs index ce90511e115..99ad3345e05 100644 --- a/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs +++ b/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs @@ -43,6 +43,7 @@ namespace MonoTests.System.Net public class HttpListenerRequestTest { [Test] + [Category ("NotWorking")] // Bug #5742 public void HasEntityBody () { HttpListenerContext ctx; diff --git a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs index a61cbb49319..b8e637c940f 100644 --- a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs +++ b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs @@ -384,6 +384,7 @@ namespace MonoTests.System.Net HttpWebRequest req; req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "POST"; req.SendChunked = false; req.KeepAlive = false; @@ -392,6 +393,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "POST"; req.SendChunked = true; req.KeepAlive = false; @@ -401,6 +403,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "POST"; req.ContentLength = 5; req.SendChunked = false; @@ -411,6 +414,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "POST"; req.SendChunked = false; req.KeepAlive = true; @@ -420,6 +424,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "POST"; req.SendChunked = false; req.KeepAlive = false; @@ -429,6 +434,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "POST"; req.SendChunked = false; req.KeepAlive = true; @@ -438,6 +444,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "GET"; req.SendChunked = true; @@ -445,6 +452,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "GET"; req.ContentLength = 5; @@ -452,6 +460,7 @@ namespace MonoTests.System.Net req.Abort (); req = (HttpWebRequest) WebRequest.Create (url); + req.Timeout = 5000; req.Method = "GET"; req.ContentLength = 0; @@ -2289,6 +2298,7 @@ namespace MonoTests.System.Net } [Test] + [Category ("NotWorking")] // #5490 public void InvalidNamesThatWork () { HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com"); diff --git a/mcs/class/System/Test/System.Net/IPAddressTest.cs b/mcs/class/System/Test/System.Net/IPAddressTest.cs index 86d287acf08..650775db37b 100644 --- a/mcs/class/System/Test/System.Net/IPAddressTest.cs +++ b/mcs/class/System/Test/System.Net/IPAddressTest.cs @@ -150,7 +150,6 @@ public class IPAddressTest Assert.AreEqual ("255.255.255.255", IPAddress.None.ToString (), "#5"); } -#if NET_1_1 [Test] public void ToStringV6 () { @@ -162,7 +161,6 @@ public class IPAddressTest Assert.AreEqual (ipv6AddressList[i*2].ToLower(), addr, "ToStringIPv6 #" + i); } } -#endif [Test] public void IsLoopbackV4 () @@ -179,7 +177,6 @@ public class IPAddressTest Assert.IsFalse (IPAddress.IsLoopback (ip), "#4"); } -#if NET_1_1 [Test] public void IsLoopbackV6 () { @@ -218,7 +215,6 @@ public class IPAddressTest for (int i = 0; i < dataIn.Length; i++) Assert.AreEqual (dataOut [i], dataIn [i], "GetAddressBytesV6 #2"); } -#endif [Test] public void Address () @@ -257,7 +253,6 @@ public class IPAddressTest } } -#if NET_1_1 [Test] public void ParseOkV6 () { @@ -278,7 +273,6 @@ public class IPAddressTest ip.ToString ().ToLower (), source)); } } -#endif [Test] public void ParseWrongV4 () @@ -363,22 +357,9 @@ public class IPAddressTest public void Constructor0_Address_4Byte () { byte[] bytes = new byte[4] { 192, 202, 112, 37 }; -#if NET_2_0 IPAddress i = new IPAddress (bytes); Assert.AreEqual (bytes, i.GetAddressBytes (), "#1"); Assert.AreEqual ("192.202.112.37", i.ToString (), "#2"); -#else - try { - new IPAddress (bytes); - Assert.Fail ("#1"); - } catch (ArgumentException ex) { - Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2"); - Assert.IsNotNull (ex.Message, "#3"); - Assert.AreEqual ("address", ex.Message, "#4"); - Assert.IsNull (ex.ParamName, "#5"); - Assert.IsNull (ex.InnerException, "#6"); - } -#endif } [Test] @@ -394,14 +375,9 @@ public class IPAddressTest Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#A2"); Assert.IsNull (ex.InnerException, "#A3"); Assert.IsNotNull (ex.Message, "#A4"); -#if NET_2_0 Assert.IsFalse (ex.Message == "address", ex.Message, "#A5"); Assert.IsNotNull (ex.ParamName, "#A6"); Assert.AreEqual ("address", ex.ParamName, "#A7"); -#else - Assert.AreEqual ("address", ex.Message, "#A5"); - Assert.IsNull (ex.ParamName, "#A6"); -#endif } try { @@ -411,14 +387,9 @@ public class IPAddressTest Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#B2"); Assert.IsNull (ex.InnerException, "#B3"); Assert.IsNotNull (ex.Message, "#B4"); -#if NET_2_0 Assert.IsFalse (ex.Message == "address", ex.Message, "#B5"); Assert.IsNotNull (ex.ParamName, "#B6"); Assert.AreEqual ("address", ex.ParamName, "#B7"); -#else - Assert.AreEqual ("address", ex.Message, "#B5"); - Assert.IsNull (ex.ParamName, "#B6"); -#endif } try { @@ -428,14 +399,9 @@ public class IPAddressTest Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#C2"); Assert.IsNull (ex.InnerException, "#C3"); Assert.IsNotNull (ex.Message, "#C4"); -#if NET_2_0 Assert.IsFalse (ex.Message == "address", "#C5"); Assert.IsNotNull (ex.ParamName, "#C6"); Assert.AreEqual ("address", ex.ParamName, "#C7"); -#else - Assert.AreEqual ("address", ex.Message, "#C5"); - Assert.IsNull (ex.ParamName, "#C6"); -#endif } } @@ -467,14 +433,9 @@ public class IPAddressTest Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2"); Assert.IsNull (ex.InnerException, "#3"); Assert.IsNotNull (ex.Message, "#4"); -#if NET_2_0 Assert.IsFalse (ex.Message == "address", "#5"); Assert.IsNotNull (ex.ParamName, "#6"); Assert.AreEqual ("address", ex.ParamName, "#7"); -#else - Assert.AreEqual ("address", ex.Message, "#5"); - Assert.IsNull (ex.ParamName, "#6"); -#endif } } @@ -492,7 +453,6 @@ public class IPAddressTest } } -#if NET_2_0 [Test] public void FromBytes1 () { @@ -605,7 +565,6 @@ public class IPAddressTest Assert.IsTrue (IPAddress.Parse ("FF01::1").IsIPv6Multicast, "#2"); Assert.IsFalse (IPAddress.Parse ("FE00::1").IsIPv6Multicast, "#3"); } -#endif } } diff --git a/mcs/class/System/Test/System.Net/WebClientTestAsync.cs b/mcs/class/System/Test/System.Net/WebClientTestAsync.cs new file mode 100644 index 00000000000..b23bb098217 --- /dev/null +++ b/mcs/class/System/Test/System.Net/WebClientTestAsync.cs @@ -0,0 +1,274 @@ +// +// System.Net.WebClientTestAsync +// +// Authors: +// Martin Baulig (martin.baulig@googlemail.com) +// +// Copyright 2012 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 NET_4_5 +using System; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using System.Reflection; +using System.Net; +using NUnit.Framework; + +namespace MonoTests.System.Net +{ + [TestFixture] + public class WebClientTestAsync + { + [Test] + [Category("Async")] + public void DownloadData () + { + WebClient wc; + bool progress_changed = false; + bool completed = false; + bool progress_changed_error = false; + bool completed_error = false; + + int thread_id = Thread.CurrentThread.ManagedThreadId; + + wc = new WebClient (); + + wc.DownloadProgressChanged += delegate { + progress_changed = true; + if (Thread.CurrentThread.ManagedThreadId != thread_id) + progress_changed_error = true; + }; + wc.DownloadDataCompleted += delegate { + completed = true; + if (Thread.CurrentThread.ManagedThreadId != thread_id) + completed_error = true; + }; + + MessagePumpSyncContext.Run (async () => { + var url = Assembly.GetExecutingAssembly ().CodeBase; + await wc.DownloadDataTaskAsync (url); + Assert.AreEqual (Thread.CurrentThread.ManagedThreadId, thread_id); + }, () => progress_changed && completed, 10000); + + Assert.IsTrue (progress_changed, "#1"); + Assert.IsFalse (progress_changed_error, "#2"); + Assert.IsTrue (completed, "#3"); + Assert.IsFalse (completed_error, "#4"); + } + + [Test] + [Category("InetAccess")] + public void DownloadFileTaskAsync () + { + WebClient wc = new WebClient (); + string filename = Path.GetTempFileName (); + + var task = wc.DownloadFileTaskAsync ("http://www.mono-project.com/", filename); + Assert.IsTrue (task.Wait (15000)); + Assert.IsTrue (task.IsCompleted); + + File.Delete (filename); + } + + [Test] + [Category("InetAccess")] + public void Cancellation () + { + WebClient wc = new WebClient (); + var progress = new ManualResetEvent (false); + wc.DownloadProgressChanged += delegate { + progress.Set (); + }; + + // Try downloading some large file, so we don't finish early. + var url = "http://download.mono-project.com/archive/2.10.9/macos-10-x86/11/MonoFramework-MDK-2.10.9_11.macos10.xamarin.x86.dmg"; + var task = wc.DownloadDataTaskAsync (url); + Assert.IsTrue (progress.WaitOne (15000), "#1"); + wc.CancelAsync (); + + try { + task.Wait (); + Assert.Fail ("#2"); + } catch (Exception ex) { + if (ex is AggregateException) + ex = ((AggregateException)ex).InnerException; + Assert.That (ex is WebException || ex is OperationCanceledException, "#4"); + Assert.IsTrue (task.IsCanceled || task.IsFaulted, "#5"); + } + } + + [Test] + [Category("InetAccess")] + public void DownloadMultiple () + { + WebClient wc = new WebClient (); + var t1 = wc.OpenReadTaskAsync ("http://www.google.com/"); + Assert.That (t1.Wait (15000)); + Assert.IsTrue (t1.IsCompleted, "#1"); + + var t2 = wc.OpenReadTaskAsync ("http://www.mono-project.com/"); + Assert.That (t2.Wait (15000)); + Assert.IsTrue (t2.IsCompleted, "#2"); + + var t3 = wc.DownloadStringTaskAsync ("http://www.google.com/"); + Assert.That (t3.Wait (15000)); + Assert.IsTrue (t3.IsCompleted, "#3"); + } + + [Test] + [Category("InetAccess")] + public void DownloadMultiple2 () + { + WebClient wc = new WebClient (); + + MessagePumpSyncContext.Run (async () => { + await wc.DownloadStringTaskAsync ("http://www.google.com/"); + await wc.DownloadDataTaskAsync ("http://www.mono-project.com/"); + }, null, 15000); + } + + [Test] + [Category("InetAccess")] + public void DownloadMultiple3 () + { + WebClient wc = new WebClient (); + int thread_id = Thread.CurrentThread.ManagedThreadId; + bool data_completed = false; + bool string_completed = false; + bool error = false; + + wc.DownloadDataCompleted += delegate { + if (data_completed || (Thread.CurrentThread.ManagedThreadId != thread_id)) + error = true; + data_completed = true; + }; + wc.DownloadStringCompleted += delegate { + if (string_completed || (Thread.CurrentThread.ManagedThreadId != thread_id)) + error = true; + string_completed = true; + }; + + MessagePumpSyncContext.Run (async () => { + await wc.DownloadStringTaskAsync ("http://www.google.com/"); + await wc.DownloadDataTaskAsync ("http://www.mono-project.com/"); + }, () => data_completed && string_completed, 15000); + + Assert.IsTrue (data_completed, "#1"); + Assert.IsTrue (string_completed, "#2"); + Assert.IsFalse (error, "#3"); + } + + public sealed class MessagePumpSyncContext : SynchronizationContext + { + private delegate void MyAction (); + + private readonly Queue queue = new Queue (); + private readonly object sync = new object (); + private readonly Func completed; + private readonly int timeout; + private bool running = true; + + MessagePumpSyncContext (Func completed, int timeout) + { + this.completed = completed; + this.timeout = timeout; + } + + public override void Send (SendOrPostCallback d, object state) + { + throw new InvalidOperationException (); + } + + public override void Post (SendOrPostCallback d, object state) + { + lock (sync) { + queue.Enqueue (() => d (state)); + Monitor.Pulse (sync); + } + } + + bool IsCompleted { + get { + if (running) + return false; + if (completed != null) + return completed (); + return true; + } + } + + void RunMessagePump () + { + while (running) { + MyAction action; + lock (sync) { + while (queue.Count == 0) { + if (IsCompleted) + return; + if (!Monitor.Wait (sync, timeout)) + throw new TimeoutException (); + } + action = queue.Dequeue (); + } + action (); + } + } + + public void Cancel () + { + lock (sync) { + running = false; + Monitor.Pulse (sync); + } + } + + public static void Run (Func action, Func completed, int timeout) + { + var old_ctx = SynchronizationContext.Current; + + var ctx = new MessagePumpSyncContext (completed, timeout); + try { + SynchronizationContext.SetSynchronizationContext (ctx); + + var thread_id = Thread.CurrentThread.ManagedThreadId; + + var task = action (); + task.ContinueWith ((t) => { + ctx.running = false; + }, TaskScheduler.FromCurrentSynchronizationContext ()); + + ctx.RunMessagePump (); + + if (task.IsFaulted) + throw task.Exception; + } finally { + SynchronizationContext.SetSynchronizationContext (old_ctx); + } + } + + } + } +} +#endif diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs index c5053e139ec..b5f6a52585d 100644 --- a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs +++ b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs @@ -511,6 +511,61 @@ namespace MonoTests.System.Text.RegularExpressions Assert.AreEqual ("888", Regex.Match("888", "^*8.*").Value); } + [Test] + public void XamarinBug2663 () + { + var r = new Regex("^(S|SW)?$"); + Match m = r.Match("SW"); + Assert.AreEqual(true, m.Success, "#Bug2663-a"); + m = r.Match("S"); + Assert.AreEqual(true, m.Success, "#Bug2663-b"); + m = r.Match("SWT"); + Assert.AreEqual(false, m.Success, "#Bug2663-c"); + m = r.Match("SA"); + Assert.AreEqual(false, m.Success, "#Bug2663-d"); + + r=new Regex("^([0-9]{4})(N|E|W|S|NE|NW|SE|SW|NDV)?$"); + + m = r.Match("2663N"); + Assert.AreEqual(true, m.Success, "#Bug2663-e"); + m = r.Match("2663E"); + Assert.AreEqual(true, m.Success, "#Bug2663-f"); + m = r.Match("2663W"); + Assert.AreEqual(true, m.Success, "#Bug2663-g"); + m = r.Match("2663S"); + Assert.AreEqual(true, m.Success, "#Bug2663-h"); + m = r.Match("2663NE"); + Assert.AreEqual(true, m.Success, "#Bug2663-i"); + m = r.Match("2663NW"); + Assert.AreEqual(true, m.Success, "#Bug2663-j"); + m = r.Match("2663SE"); + Assert.AreEqual(true, m.Success, "#Bug2663-k"); + m = r.Match("2663SW"); + Assert.AreEqual(true, m.Success, "#Bug2663-l"); + m = r.Match("2663NDV"); + Assert.AreEqual(true, m.Success, "#Bug2663-m"); + + m = r.Match("2663NF"); + Assert.AreEqual(false, m.Success, "#Bug2663-n"); + m = r.Match("2663EF"); + Assert.AreEqual(false, m.Success, "#Bug2663-o"); + m = r.Match("2663WF"); + Assert.AreEqual(false, m.Success, "#Bug2663-p"); + m = r.Match("2663SF"); + Assert.AreEqual(false, m.Success, "#Bug2663-q"); + m = r.Match("2663NEF"); + Assert.AreEqual(false, m.Success, "#Bug2663-r"); + m = r.Match("2663NWF"); + Assert.AreEqual(false, m.Success, "#Bug2663-s"); + m = r.Match("2663SEF"); + Assert.AreEqual(false, m.Success, "#Bug2663-t"); + m = r.Match("2663SWF"); + Assert.AreEqual(false, m.Success, "#Bug2663-u"); + m = r.Match("2663NDVF"); + Assert.AreEqual(false, m.Success, "#Bug2663-v"); + + } + void Kill65535_1 (int length) { StringBuilder sb = new StringBuilder ("x"); diff --git a/mcs/class/System/Test/System/UriTest3.cs b/mcs/class/System/Test/System/UriTest3.cs index b31f15b2347..4667dff48c6 100644 --- a/mcs/class/System/Test/System/UriTest3.cs +++ b/mcs/class/System/Test/System/UriTest3.cs @@ -624,6 +624,19 @@ namespace MonoTests.System { } } + + [Test] + public void DomainLabelLength () + { + UriHostNameType type = Uri.CheckHostName ("3.141592653589793238462643383279502884197169399375105820974944592.com"); + Assert.AreEqual (UriHostNameType.Dns, type, "DomainLabelLength#1"); + type = Uri.CheckHostName ("3141592653589793238462643383279502884197169399375105820974944592.com"); + Assert.AreEqual (UriHostNameType.Unknown, type, "DomainLabelLength#2"); + type = Uri.CheckHostName ("3.1415926535897932384626433832795028841971693993751058209749445923.com"); + Assert.AreEqual (UriHostNameType.Unknown, type, "DomainLabelLength#2"); + type = Uri.CheckHostName ("3.141592653589793238462643383279502884197169399375105820974944592._om"); + Assert.AreEqual (UriHostNameType.Unknown, type, "DomainLabelLength#3"); + } } } diff --git a/mcs/class/System/mobile_System.dll.sources b/mcs/class/System/mobile_System.dll.sources index b36696dbb69..00b640ae9fd 100644 --- a/mcs/class/System/mobile_System.dll.sources +++ b/mcs/class/System/mobile_System.dll.sources @@ -122,6 +122,7 @@ System.ComponentModel/IDataErrorInfo.cs System.ComponentModel/IEditableObject.cs System.ComponentModel/IListSource.cs System.ComponentModel/INotifyPropertyChanged.cs +System.ComponentModel/INotifyPropertyChanging.cs System.ComponentModel/IRevertibleChangeTracking.cs System.ComponentModel/ISite.cs System.ComponentModel/ISupportInitialize.cs @@ -154,6 +155,8 @@ System.ComponentModel/ProgressChangedEventArgs.cs System.ComponentModel/ProgressChangedEventHandler.cs System.ComponentModel/PropertyChangedEventArgs.cs System.ComponentModel/PropertyChangedEventHandler.cs +System.ComponentModel/PropertyChangingEventArgs.cs +System.ComponentModel/PropertyChangingEventHandler.cs System.ComponentModel/PropertyDescriptor.cs System.ComponentModel/PropertyDescriptor.cs System.ComponentModel/PropertyDescriptorCollection.cs @@ -403,6 +406,7 @@ System.Net/IWebProxyScript.cs System.Net/IWebRequestCreate.cs System.Net/ListenerAsyncResult.cs System.Net/ListenerPrefix.cs +System.Net/MacProxy.cs System.Net/MonoHttpDate.cs System.Net/NetConfig.cs System.Net/NetworkAccess.cs @@ -549,3 +553,6 @@ System/UriKind.cs System/UriParser.cs System/UriPartial.cs System/UriTypeConverter.cs +System/UriElements.cs +System/UriParseComponents.cs +System.Windows.Input/ICommand.cs \ No newline at end of file diff --git a/mcs/class/WindowsBase/System.Windows/Rect.cs b/mcs/class/WindowsBase/System.Windows/Rect.cs index 4cf00e73576..2c5f3c0e619 100644 --- a/mcs/class/WindowsBase/System.Windows/Rect.cs +++ b/mcs/class/WindowsBase/System.Windows/Rect.cs @@ -278,10 +278,15 @@ namespace System.Windows { public void Union(Rect rect) { - x = Math.Min (x, rect.x); - y = Math.Min (y, rect.y); - width = Math.Max (Right, rect.Right) - x; - height = Math.Max (Bottom, rect.Bottom) - y; + var left = Math.Min (Left, rect.Left); + var top = Math.Min (Top, rect.Top); + var right = Math.Max (Right, rect.Right); + var bottom = Math.Max (Bottom, rect.Bottom); + + x = left; + y = top; + width = right - left; + height = bottom - top; } public void Union(Point point) diff --git a/mcs/class/WindowsBase/Test/System.Windows.Markup/DateTimeValueSerializerTest.cs b/mcs/class/WindowsBase/Test/System.Windows.Markup/DateTimeValueSerializerTest.cs index 5d5b94bd341..6a77804eb48 100644 --- a/mcs/class/WindowsBase/Test/System.Windows.Markup/DateTimeValueSerializerTest.cs +++ b/mcs/class/WindowsBase/Test/System.Windows.Markup/DateTimeValueSerializerTest.cs @@ -88,6 +88,13 @@ namespace MonoTests.System.Windows.Markup { } [Test] +#if NET_4_0 + [NUnit.Framework.CategoryAttribute ("NotWorking")] + // Since ValueSerializer has moved to System.Xaml.dll while the type + // this test expects is in WindowsBase, there should be some additional + // support code in this assembly. Until someone does that job, this + // test won't pass. +#endif public void CanConvertFromString () { Context context = new Context (); @@ -100,6 +107,13 @@ namespace MonoTests.System.Windows.Markup { Assert.IsTrue (serializer.CanConvertFromString ("2008-01-.106426-08:00", context), "4"); } +#if NET_4_0 + [NUnit.Framework.CategoryAttribute ("NotWorking")] + // Since ValueSerializer has moved to System.Xaml.dll while the type + // this test expects is in WindowsBase, there should be some additional + // support code in this assembly. Until someone does that job, this + // test won't pass. +#endif [Test] [ExpectedException (typeof (ArgumentException))] // Expected object of type 'DateTime'. public void CanConvertToString1 () diff --git a/mcs/class/WindowsBase/Test/System.Windows.Markup/ValueSerializerTest.cs b/mcs/class/WindowsBase/Test/System.Windows.Markup/ValueSerializerTest.cs index 8fc069dc3b3..eda87c17d9f 100644 --- a/mcs/class/WindowsBase/Test/System.Windows.Markup/ValueSerializerTest.cs +++ b/mcs/class/WindowsBase/Test/System.Windows.Markup/ValueSerializerTest.cs @@ -76,6 +76,13 @@ namespace MonoTests.System.Windows.Markup { } [Test] +#if NET_4_0 + [NUnit.Framework.CategoryAttribute ("NotWorking")] + // Since ValueSerializer has moved to System.Xaml.dll while the type + // this test expects is in WindowsBase, there should be some additional + // support code in this assembly. Until someone does that job, this + // test won't pass. +#endif public void GetSerializerForType () { Assert.IsNull (ValueSerializer.GetSerializerFor (typeof (DependencyObject))); diff --git a/mcs/class/WindowsBase/Test/System.Windows/RectTest.cs b/mcs/class/WindowsBase/Test/System.Windows/RectTest.cs index e5a4635f73e..e83008d4452 100644 --- a/mcs/class/WindowsBase/Test/System.Windows/RectTest.cs +++ b/mcs/class/WindowsBase/Test/System.Windows/RectTest.cs @@ -594,10 +594,12 @@ namespace MonoTests.System.Windows { // crosses bottom side r = new Rect (0, 0, 50, 50); r.Intersect (new Rect (5, 5, 10, 50)); + Assert.AreEqual(new Rect(5, 5, 10, 45), r); // crosses left side r = new Rect (0, 0, 50, 50); r.Intersect (new Rect (-5, 5, 10, 10)); + Assert.AreEqual(new Rect(0, 5, 5, 10), r); // completely outside (top) r = new Rect (0, 0, 50, 50); @@ -620,6 +622,56 @@ namespace MonoTests.System.Windows { Assert.AreEqual (Rect.Empty, r); } + [Test] + public void Union() + { + Rect r; + + // fully contained + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(10, 10, 10, 10)); + Assert.AreEqual(new Rect(0, 0, 50, 50), r); + + // crosses top side + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(5, -5, 10, 10)); + Assert.AreEqual(new Rect(0, -5, 50, 55), r); + + // crosses right side + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(5, 5, 50, 10)); + Assert.AreEqual(new Rect(0, 0, 55, 50), r); + + // crosses bottom side + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(5, 5, 10, 50)); + Assert.AreEqual(new Rect(0, 0, 50, 55), r); + + // crosses left side + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(-5, 5, 10, 10)); + Assert.AreEqual(new Rect(-5, 0, 55, 50), r); + + // completely outside (top) + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(5, -5, 1, 1)); + Assert.AreEqual(new Rect(0, -5, 50, 55), r); + + // completely outside (right) + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(75, 5, 1, 1)); + Assert.AreEqual(new Rect(0, 0, 76, 50), r); + + // completely outside (bottom) + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(5, 75, 1, 1)); + Assert.AreEqual(new Rect(0,0, 50, 76), r); + + // completely outside (left) + r = new Rect(0, 0, 50, 50); + r.Union(new Rect(-25, 5, 1, 1)); + Assert.AreEqual(new Rect(-25, 0, 75, 50), r); + } [Test] public void Equals_Operator () diff --git a/mcs/class/corlib/Assembly/AssemblyInfo.cs b/mcs/class/corlib/Assembly/AssemblyInfo.cs index 3ee537e0c48..30028682c1a 100644 --- a/mcs/class/corlib/Assembly/AssemblyInfo.cs +++ b/mcs/class/corlib/Assembly/AssemblyInfo.cs @@ -70,7 +70,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyFileVersion (Consts.FxFileVersion)] [assembly: ComVisible (false)] [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] -[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TypeLibVersion (2, 0)] [assembly: DefaultDependency (LoadHint.Always)] [assembly: StringFreezing] diff --git a/mcs/class/corlib/Mono.Security.Cryptography/MACAlgorithm.cs b/mcs/class/corlib/Mono.Security.Cryptography/MACAlgorithm.cs index 9cc924bea6d..aac44d26266 100644 --- a/mcs/class/corlib/Mono.Security.Cryptography/MACAlgorithm.cs +++ b/mcs/class/corlib/Mono.Security.Cryptography/MACAlgorithm.cs @@ -98,13 +98,7 @@ namespace Mono.Security.Cryptography { if ((blockCount > 0) || ((algo.Padding != PaddingMode.Zeros) && (algo.Padding != PaddingMode.None))) { result = enc.TransformFinalBlock (block, 0, blockCount); } else { -#if NET_1_0 - // add an empty (zeros) block for MAC padding - byte[] emptyBlock = new byte [blockSize]; - result = enc.TransformFinalBlock (emptyBlock, 0, blockSize); -#else result = (byte[]) block.Clone (); -#endif } if (!enc.CanReuseTransform) { diff --git a/mcs/class/corlib/Mono.Security.X509/X509Chain.cs b/mcs/class/corlib/Mono.Security.X509/X509Chain.cs index 027005ca2cb..6edd5feac45 100644 --- a/mcs/class/corlib/Mono.Security.X509/X509Chain.cs +++ b/mcs/class/corlib/Mono.Security.X509/X509Chain.cs @@ -203,7 +203,7 @@ namespace Mono.Security.X509 { // TODO - we should check for CRITICAL but unknown extensions // X509ChainStatusFlags.InvalidExtension -#if (!NET_1_0 && !INSIDE_CORLIB) +#if !INSIDE_CORLIB if (ServicePointManager.CheckCertificateRevocationList) { // TODO - check revocation (CRL, OCSP ...) // X509ChainStatusFlags.RevocationStatusUnknown diff --git a/mcs/class/corlib/System.Collections.Concurrent/ConcurrentStack.cs b/mcs/class/corlib/System.Collections.Concurrent/ConcurrentStack.cs index abc9e5822f1..05a5ad97616 100644 --- a/mcs/class/corlib/System.Collections.Concurrent/ConcurrentStack.cs +++ b/mcs/class/corlib/System.Collections.Concurrent/ConcurrentStack.cs @@ -139,11 +139,22 @@ namespace System.Collections.Concurrent public int TryPopRange (T[] items) { + if (items == null) + throw new ArgumentNullException ("items"); return TryPopRange (items, 0, items.Length); } public int TryPopRange (T[] items, int startIndex, int count) { + if (items == null) + throw new ArgumentNullException ("items"); + if (startIndex < 0 || startIndex >= items.Length) + throw new ArgumentOutOfRangeException ("startIndex"); + if (count < 0) + throw new ArgumentOutOfRangeException ("count"); + if (startIndex + count > items.Length) + throw new ArgumentException ("startIndex + count is greater than the length of items."); + Node temp; Node end; @@ -152,7 +163,7 @@ namespace System.Collections.Concurrent if (temp == null) return -1; end = temp; - for (int j = 0; j < count - 1; j++) { + for (int j = 0; j < count; j++) { end = end.Next; if (end == null) break; @@ -160,14 +171,15 @@ namespace System.Collections.Concurrent } while (Interlocked.CompareExchange (ref head, end, temp) != temp); int i; - for (i = startIndex; i < count && temp != null; i++) { + for (i = startIndex; i < startIndex + count && temp != null; i++) { items[i] = temp.Value; end = temp; temp = temp.Next; pool.Release (ZeroOut (end)); } + this.count -= (i - startIndex); - return i - 1; + return i - startIndex; } public bool TryPeek (out T result) diff --git a/mcs/class/corlib/System.Collections.Generic/IReadOnlyCollection.cs b/mcs/class/corlib/System.Collections.Generic/IReadOnlyCollection.cs new file mode 100644 index 00000000000..b65c15fde8a --- /dev/null +++ b/mcs/class/corlib/System.Collections.Generic/IReadOnlyCollection.cs @@ -0,0 +1,39 @@ +// +// IReadOnlyCollection.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2012 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 NET_4_5 + +namespace System.Collections.Generic +{ + public interface IReadOnlyCollection : IEnumerable + { + int Count { get; } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Collections.Generic/IReadOnlyDictionary.cs b/mcs/class/corlib/System.Collections.Generic/IReadOnlyDictionary.cs index e886c4cab02..4c9144fc5f1 100644 --- a/mcs/class/corlib/System.Collections.Generic/IReadOnlyDictionary.cs +++ b/mcs/class/corlib/System.Collections.Generic/IReadOnlyDictionary.cs @@ -30,9 +30,8 @@ namespace System.Collections.Generic { - public interface IReadOnlyDictionary : IEnumerable> + public interface IReadOnlyDictionary : IReadOnlyCollection> { - int Count { get; } TValue this [TKey key] { get; } IEnumerable Keys { get; } IEnumerable Values { get; } diff --git a/mcs/class/corlib/System.Collections.Generic/IReadOnlyList.cs b/mcs/class/corlib/System.Collections.Generic/IReadOnlyList.cs index 1363deb2502..91ddb84a7fc 100644 --- a/mcs/class/corlib/System.Collections.Generic/IReadOnlyList.cs +++ b/mcs/class/corlib/System.Collections.Generic/IReadOnlyList.cs @@ -30,9 +30,8 @@ namespace System.Collections.Generic { - public interface IReadOnlyList : IEnumerable + public interface IReadOnlyList : IReadOnlyCollection { - int Count { get; } T this [int index] { get; } } } diff --git a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs b/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs index 950a08ef0ad..0a273dacc8f 100644 --- a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs +++ b/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs @@ -107,11 +107,7 @@ namespace System.Collections #endif } -#if NET_1_1 public -#else - internal -#endif static CaseInsensitiveHashCodeProvider DefaultInvariant { get { return singletonInvariant; diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs index ca1eb6dfbf3..b64a1e1dd5f 100644 --- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs +++ b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs @@ -39,6 +39,11 @@ namespace System.Configuration.Assemblies { public enum AssemblyHashAlgorithm { None = 0, MD5 = 32771, - SHA1 = 32772 + SHA1 = 32772, +#if NET_4_5 + SHA256 = 32780, + SHA384 = 32781, + SHA512 = 32782, +#endif } } diff --git a/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs b/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs index fda19bc295c..64bd9822d6d 100644 --- a/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs +++ b/mcs/class/corlib/System.Diagnostics.Contracts.Internal/ContractHelper.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 using System; using System.Text; diff --git a/mcs/class/corlib/System.Diagnostics.Contracts/Contract.cs b/mcs/class/corlib/System.Diagnostics.Contracts/Contract.cs index 7a3da6840b9..0fbdcee919b 100644 --- a/mcs/class/corlib/System.Diagnostics.Contracts/Contract.cs +++ b/mcs/class/corlib/System.Diagnostics.Contracts/Contract.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 using System; using System.Collections.Generic; @@ -39,7 +39,12 @@ namespace System.Diagnostics.Contracts { public static class Contract { - public static event EventHandler ContractFailed; +#if NET_4_0 + public +#else + internal +#endif + static event EventHandler ContractFailed; // Used in test internal static EventHandler InternalContractFailedEvent { diff --git a/mcs/class/corlib/System.Diagnostics.Contracts/ContractException.cs b/mcs/class/corlib/System.Diagnostics.Contracts/ContractException.cs index afef0d613ac..fab04396362 100644 --- a/mcs/class/corlib/System.Diagnostics.Contracts/ContractException.cs +++ b/mcs/class/corlib/System.Diagnostics.Contracts/ContractException.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 using System; diff --git a/mcs/class/corlib/System.Diagnostics.Contracts/ContractFailedEventArgs.cs b/mcs/class/corlib/System.Diagnostics.Contracts/ContractFailedEventArgs.cs index 8583abad0e5..41aec848f80 100644 --- a/mcs/class/corlib/System.Diagnostics.Contracts/ContractFailedEventArgs.cs +++ b/mcs/class/corlib/System.Diagnostics.Contracts/ContractFailedEventArgs.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 using System; using System.Runtime.ConstrainedExecution; diff --git a/mcs/class/corlib/System.Diagnostics.Contracts/ContractShouldAssertException.cs b/mcs/class/corlib/System.Diagnostics.Contracts/ContractShouldAssertException.cs index 07cd519366e..acde1175d96 100644 --- a/mcs/class/corlib/System.Diagnostics.Contracts/ContractShouldAssertException.cs +++ b/mcs/class/corlib/System.Diagnostics.Contracts/ContractShouldAssertException.cs @@ -26,7 +26,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 using System; diff --git a/mcs/class/corlib/System.Diagnostics/StackTrace.cs b/mcs/class/corlib/System.Diagnostics/StackTrace.cs index 5fd14cc6d71..edd6a79d841 100644 --- a/mcs/class/corlib/System.Diagnostics/StackTrace.cs +++ b/mcs/class/corlib/System.Diagnostics/StackTrace.cs @@ -148,6 +148,9 @@ namespace System.Diagnostics { } [MonoLimitation ("Not possible to create StackTraces from other threads")] +#if NET_4_5 + [Obsolete] +#endif public StackTrace (Thread targetThread, bool needFileInfo) { if (targetThread == Thread.CurrentThread){ diff --git a/mcs/class/corlib/System.Globalization/CompareInfo.cs b/mcs/class/corlib/System.Globalization/CompareInfo.cs index e1ed19f3961..cb894d969f1 100644 --- a/mcs/class/corlib/System.Globalization/CompareInfo.cs +++ b/mcs/class/corlib/System.Globalization/CompareInfo.cs @@ -62,19 +62,21 @@ namespace System.Globalization /* This will build the ICU collator, and store * the pointer in ICU_collator */ + /* try { this.construct_compareinfo (icu_name); } catch { // ICU_collator=IntPtr.Zero; } + */ } } - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern void construct_compareinfo (string locale); + //[MethodImplAttribute (MethodImplOptions.InternalCall)] + //private extern void construct_compareinfo (string locale); - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern void free_internal_collator (); + //[MethodImplAttribute (MethodImplOptions.InternalCall)] + //private extern void free_internal_collator (); [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern int internal_compare (string str1, int offset1, @@ -113,15 +115,16 @@ namespace System.Globalization // Keep in synch with MonoCompareInfo in the runtime. private int culture; - [NonSerialized] - private string icu_name; +// [NonSerialized] +// private string icu_name; // [NonSerialized] // private IntPtr ICU_collator; #pragma warning disable 169 private int win32LCID; // Unused, but MS.NET serializes this - private string m_name; // Unused, but MS.NET serializes this #pragma warning restore 169 + + readonly string m_name; // MS.NET serializes this [NonSerialized] SimpleCollator collator; @@ -133,12 +136,10 @@ namespace System.Globalization // Protects access to 'collators' private static object monitor = new Object (); - /* Hide the .ctor() */ - CompareInfo() {} - internal CompareInfo (CultureInfo ci) { this.culture = ci.LCID; + this.m_name = ci.Name; if (UseManagedCollation) { lock (monitor) { if (collators == null) @@ -150,20 +151,22 @@ namespace System.Globalization } } } else { +/* #if !MOONLIGHT this.icu_name = ci.IcuName; this.construct_compareinfo (icu_name); #endif +*/ } } - +/* ~CompareInfo () { #if !MOONLIGHT free_internal_collator (); #endif } - +*/ #if !MOONLIGHT private int internal_compare_managed (string str1, int offset1, int length1, string str2, @@ -853,16 +856,15 @@ namespace System.Globalization * shows it. Some documentation about what it does * would be nice. */ - public int LCID - { + public int LCID { get { - return(culture); + return culture; } } [ComVisible (false)] public virtual string Name { - get { return icu_name; } + get { return m_name; } } } } diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs index 5fd87c1b821..12ab18df50b 100644 --- a/mcs/class/corlib/System.Globalization/CultureInfo.cs +++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs @@ -1,14 +1,14 @@ // // System.Globalization.CultureInfo.cs // +// Authors: // Miguel de Icaza (miguel@ximian.com) // Dick Porter (dick@ximian.com) +// Marek Safar (marek.safar@gmail.com) // // (C) 2001, 2002, 2003 Ximian, Inc. (http://www.ximian.com) -// - -// // Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright (C) 2012 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 @@ -46,21 +46,17 @@ namespace System.Globalization static object shared_table_lock = new object (); internal static int BootstrapCultureID; - const int NumOptionalCalendars = 5; - const int GregorianTypeMask = 0x00FFFFFF; - const int CalendarTypeBits = 24; - #pragma warning disable 169, 649 bool m_isReadOnly; int cultureID; [NonSerialized] int parent_lcid; [NonSerialized] - int specific_lcid; - [NonSerialized] int datetime_index; [NonSerialized] int number_index; + [NonSerialized] + int default_calendar_type; bool m_useUserOverride; [NonSerialized] volatile NumberFormatInfo numInfo; @@ -68,8 +64,6 @@ namespace System.Globalization volatile TextInfo textInfo; private string m_name; - [NonSerialized] - private string displayname; [NonSerialized] private string englishname; [NonSerialized] @@ -79,25 +73,24 @@ namespace System.Globalization [NonSerialized] private string iso2lang; [NonSerialized] - private string icu_name; - [NonSerialized] private string win3lang; [NonSerialized] private string territory; - volatile CompareInfo compareInfo; [NonSerialized] - private unsafe readonly int *calendar_data; + string[] native_calendar_names; + + volatile CompareInfo compareInfo; [NonSerialized] private unsafe readonly void *textinfo_data; - [NonSerialized] - private Calendar [] optional_calendars; - [NonSerialized] - CultureInfo parent_culture; int m_dataItem; // MS.NET serializes this. - Calendar calendar; // MS.NET serializes this. #pragma warning restore 169, 649 + Calendar calendar; + + [NonSerialized] + CultureInfo parent_culture; + // Deserialized instances will set this to false [NonSerialized] bool constructed; @@ -107,41 +100,23 @@ namespace System.Globalization internal byte[] cached_serialized_form; const int InvariantCultureId = 0x7F; + const int CalendarTypeBits = 8; - private static readonly string MSG_READONLY = "This instance is read only"; + const string MSG_READONLY = "This instance is read only"; - static public CultureInfo InvariantCulture { + public static CultureInfo InvariantCulture { get { return invariant_culture_info; } } - public static CultureInfo CreateSpecificCulture (string name) - { - if (name == null) { - throw new ArgumentNullException ("name"); - } - - if (name == String.Empty) - return InvariantCulture; - - CultureInfo ci = new CultureInfo (); - if (!ConstructInternalLocaleFromSpecificName (ci, name.ToLowerInvariant ())) - throw new ArgumentException ("Culture name " + name + - " is not supported.", name); - - return ci; - } - - public static CultureInfo CurrentCulture - { + public static CultureInfo CurrentCulture { get { return Thread.CurrentThread.CurrentCulture; } } - public static CultureInfo CurrentUICulture - { + public static CultureInfo CurrentUICulture { get { return Thread.CurrentThread.CurrentUICulture; } @@ -272,29 +247,35 @@ namespace System.Globalization } } - public virtual string NativeName - { + public virtual string NativeName { get { if (!constructed) Construct (); - return(nativename); + return nativename; + } + } + + internal string NativeCalendarName { + get { + if (!constructed) Construct (); + return native_calendar_names[(default_calendar_type >> CalendarTypeBits) - 1]; } } - public virtual Calendar Calendar - { - get { return DateTimeFormat.Calendar; } + public virtual Calendar Calendar { + get { + if (calendar == null) { + if (!constructed) Construct (); + calendar = CreateCalendar (default_calendar_type); + } + + return calendar; + } } - public virtual Calendar[] OptionalCalendars - { + [MonoLimitation ("Optional calendars are not supported only default calendar is returned")] + public virtual Calendar[] OptionalCalendars { get { - if (optional_calendars == null) { - lock (this) { - if (optional_calendars == null) - ConstructCalendars (); - } - } - return optional_calendars; + return new[] { Calendar }; } } @@ -334,11 +315,10 @@ namespace System.Globalization } } - public virtual string ThreeLetterISOLanguageName - { + public virtual string ThreeLetterISOLanguageName { get { if (!constructed) Construct (); - return(iso3lang); + return iso3lang; } } @@ -350,8 +330,7 @@ namespace System.Globalization } } - public virtual string TwoLetterISOLanguageName - { + public virtual string TwoLetterISOLanguageName { get { if (!constructed) Construct (); return(iso2lang); @@ -365,13 +344,6 @@ namespace System.Globalization } } - internal string IcuName { - get { - if (!constructed) Construct (); - return icu_name; - } - } - public void ClearCachedData() { Thread.CurrentThread.CurrentCulture = null; @@ -419,9 +391,9 @@ namespace System.Globalization } #endif - public override int GetHashCode() + public override int GetHashCode () { - return cultureID; + return cultureID.GetHashCode (); } public static CultureInfo ReadOnly(CultureInfo ci) @@ -439,7 +411,6 @@ namespace System.Globalization new_ci.numInfo = NumberFormatInfo.ReadOnly (new_ci.numInfo); if (new_ci.dateTimeInfo != null) new_ci.dateTimeInfo = DateTimeFormatInfo.ReadOnly (new_ci.dateTimeInfo); - // TextInfo doesn't have a ReadOnly method in 1.1... if (new_ci.textInfo != null) new_ci.textInfo = TextInfo.ReadOnly (new_ci.textInfo); return(new_ci); @@ -469,22 +440,13 @@ namespace System.Globalization } } - internal static bool IsIDNeutralCulture (int lcid) - { - bool ret; - if (!internal_is_lcid_neutral (lcid, out ret)) - throw new ArgumentException (String.Format ("Culture id 0x{:x4} is not supported.", lcid)); - - return ret; - } - public virtual bool IsNeutralCulture { get { - if (!constructed) Construct (); if (cultureID == InvariantCultureId) return false; - return ((cultureID & 0xff00) == 0 || specific_lcid == 0); + if (!constructed) Construct (); + return territory == null; } } @@ -527,30 +489,29 @@ namespace System.Globalization } } - public virtual DateTimeFormatInfo DateTimeFormat - { - get - { + public virtual DateTimeFormatInfo DateTimeFormat { + get { + if (dateTimeInfo != null) + return dateTimeInfo; + if (!constructed) Construct (); CheckNeutral (); - if (dateTimeInfo == null) - { - lock (this) - { - if (dateTimeInfo == null) { - dateTimeInfo = new DateTimeFormatInfo(m_isReadOnly); + + // TODO: Have to lock because construct_datetime_format is not atomic + lock (this) { + if (cultureID == InvariantCultureId && m_isReadOnly) + dateTimeInfo = DateTimeFormatInfo.InvariantInfo; + else if (dateTimeInfo == null) { + dateTimeInfo = new DateTimeFormatInfo (this, m_isReadOnly); + if (cultureID != InvariantCultureId) construct_datetime_format (); - if (optional_calendars != null) - dateTimeInfo.Calendar = optional_calendars [0]; - } } } return dateTimeInfo; } - set - { + set { if (!constructed) Construct (); if (m_isReadOnly) throw new InvalidOperationException(MSG_READONLY); @@ -561,19 +522,17 @@ namespace System.Globalization } } - public virtual string DisplayName - { + public virtual string DisplayName { get { - if (!constructed) Construct (); - return(displayname); + // Mono is not localized and will always return english name regardless of OS locale + return EnglishName; } } - public virtual string EnglishName - { + public virtual string EnglishName { get { if (!constructed) Construct (); - return(englishname); + return englishname; } } @@ -581,10 +540,10 @@ namespace System.Globalization { get { return GetCultureInfo (BootstrapCultureID); } } - public bool IsReadOnly - { + + public bool IsReadOnly { get { - return(m_isReadOnly); + return m_isReadOnly; } } @@ -610,43 +569,6 @@ namespace System.Globalization constructed = true; } - bool ConstructInternalLocaleFromName (string locale) - { - // It is sort of hack to get those new pseudo-alias - // culture names that are not supported in good old - // Windows. -#if MOONLIGHT - if (locale == "zh-chs" || locale == "zh-cht") - return false; -#endif - switch (locale) { - case "zh-hans": - locale = "zh-chs"; - break; - case "zh-hant": - locale = "zh-cht"; - break; - } - - if (!construct_internal_locale_from_name (locale)) - return false; - return true; - } - - bool ConstructInternalLocaleFromLcid (int lcid) - { - if (!construct_internal_locale_from_lcid (lcid)) - return false; - return true; - } - - static bool ConstructInternalLocaleFromSpecificName (CultureInfo ci, string name) - { - if (!construct_internal_locale_from_specific_name (ci, name)) - return false; - return true; - } - static bool ConstructInternalLocaleFromCurrentLocale (CultureInfo ci) { if (!construct_internal_locale_from_current_locale (ci)) @@ -660,9 +582,8 @@ namespace System.Globalization [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern bool construct_internal_locale_from_name (string name); - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern static bool construct_internal_locale_from_specific_name (CultureInfo ci, - string name); +// [MethodImplAttribute (MethodImplOptions.InternalCall)] +// private extern static bool construct_internal_locale_from_specific_name (CultureInfo ci, string name); [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static bool construct_internal_locale_from_current_locale (CultureInfo ci); @@ -676,34 +597,26 @@ namespace System.Globalization [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern void construct_number_format (); - // Returns false if the culture can not be found, sets is_neutral if it is - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern static bool internal_is_lcid_neutral (int lcid, out bool is_neutral); - private void ConstructInvariant (bool read_only) { cultureID = InvariantCultureId; /* NumberFormatInfo defaults to the invariant data */ numInfo=NumberFormatInfo.InvariantInfo; - /* DateTimeFormatInfo defaults to the invariant data */ - dateTimeInfo=DateTimeFormatInfo.InvariantInfo; if (!read_only) { numInfo = (NumberFormatInfo) numInfo.Clone (); - dateTimeInfo = (DateTimeFormatInfo) dateTimeInfo.Clone (); } textInfo = CreateTextInfo (read_only); m_name=String.Empty; - displayname= englishname= nativename="Invariant Language (Invariant Country)"; iso3lang="IVL"; iso2lang="iv"; - icu_name="en_US_POSIX"; win3lang="IVL"; + default_calendar_type = 1 << CalendarTypeBits; } private unsafe TextInfo CreateTextInfo (bool readOnly) @@ -732,7 +645,7 @@ namespace System.Globalization return; } - if (!ConstructInternalLocaleFromLcid (culture)) { + if (!construct_internal_locale_from_lcid (culture)) { #if NET_4_0 throw new CultureNotFoundException ("culture", String.Format ("Culture ID {0} (0x{0:X4}) is not a " + @@ -765,7 +678,7 @@ namespace System.Globalization return; } - if (!ConstructInternalLocaleFromName (name.ToLowerInvariant ())) { + if (!construct_internal_locale_from_name (name.ToLowerInvariant ())) { #if NET_4_0 throw new CultureNotFoundException ("name", "Culture name " + name + " is not supported."); @@ -871,35 +784,221 @@ namespace System.Globalization return new CultureInfo (name, use_user_override, read_only); } - unsafe internal void ConstructCalendars () + public static CultureInfo CreateSpecificCulture (string name) { - if (calendar_data == null) { - optional_calendars = new Calendar [] {new GregorianCalendar (GregorianCalendarTypes.Localized)}; - return; - } + if (name == null) + throw new ArgumentNullException ("name"); - optional_calendars = new Calendar [NumOptionalCalendars]; - - for (int i=0; i> CalendarTypeBits); - switch (caltype) { - case 0: - GregorianCalendarTypes greg_type; - greg_type = (GregorianCalendarTypes) (caldata & GregorianTypeMask); - cal = new GregorianCalendar (greg_type); - break; - case 1: - cal = new HijriCalendar (); - break; - case 2: - cal = new ThaiBuddhistCalendar (); - break; - default: - throw new Exception ("invalid calendar type: " + caldata); + if (name.Length == 0) + return InvariantCulture; + + CultureInfo ci = null; + try { + ci = new CultureInfo (name); + } catch (Exception) { + // TODO: Use construct_internal_locale_from_name when it's not bound to constructor instead + // of try-catch + int idx = name.IndexOf ('-'); + if (idx > 0) { + try { + ci = new CultureInfo (name.Substring (0, idx)); + } catch { + } } - optional_calendars [i] = cal; + + if (ci == null) + throw; + } + + if (!ci.IsNeutralCulture) + return ci; + + return CreateSpecificCultureFromNeutral (ci.Name); + } + + // + // Creates specific culture from neutral culture. Used by CreateSpecificCulture + // only but using separate method we can delay switch underlying Dictionary + // initialization + // + static CultureInfo CreateSpecificCultureFromNeutral (string name) + { + int id; + + // + // For neutral cultures find predefined default specific culture + // + // Use managed switch because we need this for only some cultures + // and the method is not used frequently + // + // TODO: We could optimize for cultures with single specific culture + // + switch (name.ToLowerInvariant ()) { + case "af": id = 1078; break; + case "am": id = 1118; break; + case "ar": id = 1025; break; + case "arn": id = 1146; break; + case "as": id = 1101; break; + case "az": id = 1068; break; + case "az-Cyrl": id = 2092; break; + case "az-Latn": id = 1068; break; + case "ba": id = 1133; break; + case "be": id = 1059; break; + case "bg": id = 1026; break; + case "bn": id = 1093; break; + case "bo": id = 1105; break; + case "br": id = 1150; break; + case "bs": id = 5146; break; + case "bs-Cyrl": id = 8218; break; + case "bs-Latn": id = 5146; break; + case "ca": id = 1027; break; + case "co": id = 1155; break; + case "cs": id = 1029; break; + case "cy": id = 1106; break; + case "da": id = 1030; break; + case "de": id = 1031; break; + case "dsb": id = 2094; break; + case "dv": id = 1125; break; + case "el": id = 1032; break; + case "en": id = 1033; break; + case "es": id = 3082; break; + case "et": id = 1061; break; + case "eu": id = 1069; break; + case "fa": id = 1065; break; + case "fi": id = 1035; break; + case "fil": id = 1124; break; + case "fo": id = 1080; break; + case "fr": id = 1036; break; + case "fy": id = 1122; break; + case "ga": id = 2108; break; + case "gd": id = 1169; break; + case "gl": id = 1110; break; + case "gsw": id = 1156; break; + case "gu": id = 1095; break; + case "ha": id = 1128; break; + case "ha-Latn": id = 1128; break; + case "he": id = 1037; break; + case "hi": id = 1081; break; + case "hr": id = 1050; break; + case "hsb": id = 1070; break; + case "hu": id = 1038; break; + case "hy": id = 1067; break; + case "id": id = 1057; break; + case "ig": id = 1136; break; + case "ii": id = 1144; break; + case "is": id = 1039; break; + case "it": id = 1040; break; + case "iu": id = 2141; break; + case "iu-Cans": id = 1117; break; + case "iu-Latn": id = 2141; break; + case "ja": id = 1041; break; + case "ka": id = 1079; break; + case "kk": id = 1087; break; + case "kl": id = 1135; break; + case "km": id = 1107; break; + case "kn": id = 1099; break; + case "ko": id = 1042; break; + case "kok": id = 1111; break; + case "ky": id = 1088; break; + case "lb": id = 1134; break; + case "lo": id = 1108; break; + case "lt": id = 1063; break; + case "lv": id = 1062; break; + case "mi": id = 1153; break; + case "mk": id = 1071; break; + case "ml": id = 1100; break; + case "mn": id = 1104; break; + case "mn-Cyrl": id = 1104; break; + case "mn-Mong": id = 2128; break; + case "moh": id = 1148; break; + case "mr": id = 1102; break; + case "ms": id = 1086; break; + case "mt": id = 1082; break; + case "nb": id = 1044; break; + case "ne": id = 1121; break; + case "nl": id = 1043; break; + case "nn": id = 2068; break; + case "no": id = 1044; break; + case "nso": id = 1132; break; + case "oc": id = 1154; break; + case "or": id = 1096; break; + case "pa": id = 1094; break; + case "pl": id = 1045; break; + case "prs": id = 1164; break; + case "ps": id = 1123; break; + case "pt": id = 1046; break; + case "qut": id = 1158; break; + case "quz": id = 1131; break; + case "rm": id = 1047; break; + case "ro": id = 1048; break; + case "ru": id = 1049; break; + case "rw": id = 1159; break; + case "sa": id = 1103; break; + case "sah": id = 1157; break; + case "se": id = 1083; break; + case "si": id = 1115; break; + case "sk": id = 1051; break; + case "sl": id = 1060; break; + case "sma": id = 7227; break; + case "smj": id = 5179; break; + case "smn": id = 9275; break; + case "sms": id = 8251; break; + case "sq": id = 1052; break; + case "sr": id = 9242; break; + case "sr-Cyrl": id = 10266; break; + case "sr-Latn": id = 9242; break; + case "sv": id = 1053; break; + case "sw": id = 1089; break; + case "syr": id = 1114; break; + case "ta": id = 1097; break; + case "te": id = 1098; break; + case "tg": id = 1064; break; + case "tg-Cyrl": id = 1064; break; + case "th": id = 1054; break; + case "tk": id = 1090; break; + case "tn": id = 1074; break; + case "tr": id = 1055; break; + case "tt": id = 1092; break; + case "tzm": id = 2143; break; + case "tzm-Latn": id = 2143; break; + case "ug": id = 1152; break; + case "uk": id = 1058; break; + case "ur": id = 1056; break; + case "uz": id = 1091; break; + case "uz-Cyrl": id = 2115; break; + case "uz-Latn": id = 1091; break; + case "vi": id = 1066; break; + case "wo": id = 1160; break; + case "xh": id = 1076; break; + case "yo": id = 1130; break; + case "zh": id = 2052; break; + case "zh-CHS": case "zh-Hans": + id = 2052; break; + case "zh-CHT": case "zh-Hant": + id = 3076; break; + case "zu": id = 1077; break; + default: + throw new NotImplementedException ("Mapping for neutral culture " + name); + } + + return new CultureInfo (id); + } + + static Calendar CreateCalendar (int calendarType) + { + switch (calendarType >> CalendarTypeBits) { + case 1: + GregorianCalendarTypes greg_type; + greg_type = (GregorianCalendarTypes) (calendarType & 0xFF); + return new GregorianCalendar (greg_type); + case 2: + return new ThaiBuddhistCalendar (); + case 3: + return new UmAlQuraCalendar (); + case 4: + return new HijriCalendar (); + default: + throw new NotImplementedException ("Unknown calendar type: " + calendarType); } } } diff --git a/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs b/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs index 6ad391d1115..09c21f1fc4e 100644 --- a/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs +++ b/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs @@ -50,22 +50,20 @@ namespace System.Globalization [StructLayout (LayoutKind.Sequential)] public sealed class DateTimeFormatInfo : ICloneable, IFormatProvider { - private static readonly string MSG_READONLY = "This instance is read only"; + const string MSG_READONLY = "This instance is read only"; private static readonly string[] INVARIANT_ABBREVIATED_DAY_NAMES - = new string[7] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; + = new string[7] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; private static readonly string[] INVARIANT_DAY_NAMES - = new string[7] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; + = new string[7] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; private static readonly string[] INVARIANT_ABBREVIATED_MONTH_NAMES - = new string[13] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""}; + = new string[13] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" }; private static readonly string[] INVARIANT_MONTH_NAMES - = new string[13] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""}; + = new string[13] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" }; // private static readonly string[] INVARIANT_ERA_NAMES = {"A.D."}; - static readonly string [] INVARIANT_SHORT_DAY_NAMES = - new string [7] {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}; + static readonly string[] INVARIANT_SHORT_DAY_NAMES = + new string[7] { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" }; private static DateTimeFormatInfo theInvariantDateTimeFormatInfo; - private const string _RoundtripPattern = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK"; - #pragma warning disable 169 #region Sync with object-internals.h private bool m_isReadOnly; @@ -79,29 +77,29 @@ namespace System.Globalization private string longTimePattern; private string monthDayPattern; private string yearMonthPattern; - private string fullDateTimePattern; - private string _RFC1123Pattern; - private string _SortableDateTimePattern; - private string _UniversalSortableDateTimePattern; private int firstDayOfWeek; - private Calendar calendar; private int calendarWeekRule; private string[] abbreviatedDayNames; private string[] dayNames; private string[] monthNames; + private string[] genitiveMonthNames; private string[] abbreviatedMonthNames; + private string[] m_genitiveAbbreviatedMonthNames; - // FIXME: not supported other than invariant - private string [] allShortDatePatterns; - private string [] allLongDatePatterns; - private string [] allShortTimePatterns; - private string [] allLongTimePatterns; - private string [] monthDayPatterns; - private string [] yearMonthPatterns; - private string [] shortDayNames; + private string[] allShortDatePatterns; + private string[] allLongDatePatterns; + private string[] allShortTimePatterns; + private string[] allLongTimePatterns; + private string[] monthDayPatterns; + private string[] yearMonthPatterns; + private string[] shortestDayNames; #endregion + internal readonly CultureInfo culture; + Calendar calendar; + // MS Serialization needs this + private string fullDateTimePattern; private int nDataItem; private bool m_useUserOverride; private bool m_isDefaultCalendar; @@ -114,17 +112,19 @@ namespace System.Globalization private string[] m_abbrevEnglishEraNames; private string[] m_dateWords; private int[] optionalCalendars; - private string[] m_superShortDayNames; - private string[] genitiveMonthNames; - private string[] m_genitiveAbbreviatedMonthNames; private string[] leapYearMonthNames; private DateTimeFormatFlags formatFlags; private string m_name; // Unused, but MS.NET serializes this #pragma warning restore 169 - internal DateTimeFormatInfo(bool read_only) + internal DateTimeFormatInfo (CultureInfo culture, bool read_only) { + if (culture == null) + throw new ArgumentNullException ("culture"); + + this.culture = culture; m_isReadOnly = read_only; + amDesignator = "AM"; pmDesignator = "PM"; dateSeparator = "/"; @@ -135,24 +135,9 @@ namespace System.Globalization longTimePattern = "HH:mm:ss"; monthDayPattern = "MMMM dd"; yearMonthPattern = "yyyy MMMM"; - fullDateTimePattern = "dddd, dd MMMM yyyy HH:mm:ss"; - - // FIXME: for the following three pattern: "The - // default value of this property is derived - // from the calendar that is set for - // CultureInfo.CurrentCulture or the default - // calendar of CultureInfo.CurrentCulture." - - // Actually, no predefined culture has different values - // than those default values. - _RFC1123Pattern = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'"; - _SortableDateTimePattern = "yyyy'-'MM'-'dd'T'HH':'mm':'ss"; - _UniversalSortableDateTimePattern = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"; - - firstDayOfWeek = (int)DayOfWeek.Sunday; - calendar = new GregorianCalendar(); - calendarWeekRule = (int)CalendarWeekRule.FirstDay; + firstDayOfWeek = (int) DayOfWeek.Sunday; + calendarWeekRule = (int) CalendarWeekRule.FirstDay; abbreviatedDayNames = INVARIANT_ABBREVIATED_DAY_NAMES; dayNames = INVARIANT_DAY_NAMES; @@ -160,10 +145,11 @@ namespace System.Globalization monthNames = INVARIANT_MONTH_NAMES; m_genitiveAbbreviatedMonthNames = INVARIANT_ABBREVIATED_MONTH_NAMES; genitiveMonthNames = INVARIANT_MONTH_NAMES; - shortDayNames = INVARIANT_SHORT_DAY_NAMES; + shortestDayNames = INVARIANT_SHORT_DAY_NAMES; } - public DateTimeFormatInfo() : this (false) + public DateTimeFormatInfo () + : this (CultureInfo.InvariantCulture, false) { } @@ -207,9 +193,9 @@ namespace System.Globalization public string GetAbbreviatedEraName (int era) { - if (era < 0 || era >= calendar.AbbreviatedEraNames.Length) + if (era < 0 || era >= Calendar.AbbreviatedEraNames.Length) throw new ArgumentOutOfRangeException ("era", era.ToString ()); - return calendar.AbbreviatedEraNames [era]; + return Calendar.AbbreviatedEraNames [era]; } public string GetAbbreviatedMonthName(int month) @@ -222,28 +208,28 @@ namespace System.Globalization { if (eraName == null) throw new ArgumentNullException (); - string [] eras = calendar.EraNames; + string [] eras = Calendar.EraNames; for (int i = 0; i < eras.Length; i++) if (CultureInfo.InvariantCulture.CompareInfo .Compare (eraName, eras [i], CompareOptions.IgnoreCase) == 0) - return calendar.Eras [i]; + return Calendar.Eras [i]; - eras = calendar.AbbreviatedEraNames; + eras = Calendar.AbbreviatedEraNames; for (int i = 0; i < eras.Length; i++) if (CultureInfo.InvariantCulture.CompareInfo .Compare (eraName, eras [i], CompareOptions.IgnoreCase) == 0) - return calendar.Eras [i]; + return Calendar.Eras [i]; return -1; } public string GetEraName (int era) { - if (era < 0 || era > calendar.EraNames.Length) + if (era < 0 || era > Calendar.EraNames.Length) throw new ArgumentOutOfRangeException ("era", era.ToString ()); - return calendar.EraNames [era - 1]; + return Calendar.EraNames [era - 1]; } public string GetMonthName(int month) @@ -251,6 +237,11 @@ namespace System.Globalization if (month < 1 || month > 13) throw new ArgumentOutOfRangeException(); return monthNames[month-1]; } + + internal string GetMonthGenitiveName (int month) + { + return genitiveMonthNames [month - 1]; + } public string[] AbbreviatedDayNames { @@ -288,17 +279,9 @@ namespace System.Globalization } } - public string[] DayNames - { - get { return (string[]) RawDayNames.Clone (); } - set { RawDayNames = value; } - } - - internal string[] RawDayNames - { - get - { - return dayNames; + public string[] DayNames { + get { + return (string[]) dayNames.Clone (); } set { CheckDaysValue (value); @@ -306,25 +289,28 @@ namespace System.Globalization } } - public string[] MonthNames - { - get { return (string[]) RawMonthNames.Clone (); } - set { RawMonthNames = value; } + internal string[] RawDayNames { + get { + return dayNames; + } } - internal string[] RawMonthNames - { - get - { - return monthNames; + public string[] MonthNames { + get { + return (string[]) monthNames.Clone (); } set { CheckMonthsValue (value); monthNames = (string[]) value.Clone(); } } + + internal string[] RawMonthNames { + get { + return monthNames; + } + } - [MonoLimitation ("Returns only the English month abbreviated names")] [ComVisible (false)] public string[] AbbreviatedMonthGenitiveNames { get { @@ -336,7 +322,6 @@ namespace System.Globalization } } - [MonoLimitation ("Returns only the English month names")] [ComVisible (false)] public string[] MonthGenitiveNames { get { @@ -347,49 +332,46 @@ namespace System.Globalization genitiveMonthNames = value; } } - - [MonoLimitation ("Returns an empty string as if the calendar name wasn't available")] + + [MonoLimitation ("Only default calendar is supported")] [ComVisible (false)] public string NativeCalendarName { get { - return String.Empty; + if (Calendar != culture.Calendar) + return ""; + + return culture.NativeCalendarName; } } [ComVisible (false)] public string[] ShortestDayNames { get { - return (string[]) shortDayNames.Clone (); + return (string[]) shortestDayNames.Clone (); } set { CheckDaysValue (value); - shortDayNames = value; + shortestDayNames = value; } } - public string AMDesignator - { - get - { + public string AMDesignator { + get { return amDesignator; } - set - { + set { if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY); if (value == null) throw new ArgumentNullException(); amDesignator = value; } } - public string PMDesignator - { - get - { + public string PMDesignator { + get { return pmDesignator; } - set - { + set { if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY); if (value == null) throw new ArgumentNullException(); pmDesignator = value; @@ -510,13 +492,8 @@ namespace System.Globalization public string FullDateTimePattern { - get - { - if(fullDateTimePattern!=null) { - return fullDateTimePattern; - } else { - return(longDatePattern + " " + longTimePattern); - } + get { + return fullDateTimePattern ?? (longDatePattern + " " + longTimePattern); } set { @@ -536,13 +513,13 @@ namespace System.Globalization public static DateTimeFormatInfo InvariantInfo { - get - { + get { if (theInvariantDateTimeFormatInfo == null) { - theInvariantDateTimeFormatInfo = - DateTimeFormatInfo.ReadOnly(new DateTimeFormatInfo()); - theInvariantDateTimeFormatInfo.FillInvariantPatterns (); + var tmp = new DateTimeFormatInfo (CultureInfo.InvariantCulture, true); + tmp.FillInvariantPatterns (); + theInvariantDateTimeFormatInfo = tmp; } + return theInvariantDateTimeFormatInfo; } } @@ -561,14 +538,13 @@ namespace System.Globalization } } - public Calendar Calendar - { - get - { - return calendar; + public Calendar Calendar { + get { + return calendar ?? culture.Calendar; } - set - { + + [MonoLimitation ("Only default calendar specific data are available")] + set { if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY); if (value == null) throw new ArgumentNullException(); calendar = value; @@ -588,35 +564,27 @@ namespace System.Globalization } } - public string RFC1123Pattern - { - get - { - return _RFC1123Pattern; + public string RFC1123Pattern { + get { + return "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'"; } } - internal string RoundtripPattern - { - get - { - return _RoundtripPattern; + internal string RoundtripPattern { + get { + return "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK"; } } - public string SortableDateTimePattern - { - get - { - return _SortableDateTimePattern; + public string SortableDateTimePattern { + get { + return "yyyy'-'MM'-'dd'T'HH':'mm':'ss"; } } - public string UniversalSortableDateTimePattern - { - get - { - return _UniversalSortableDateTimePattern; + public string UniversalSortableDateTimePattern { + get { + return "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"; } } @@ -642,20 +610,17 @@ namespace System.Globalization if (all_date_time_patterns != null) return; - var al = new List (); + var al = new List (16); al.AddRange (GetAllRawDateTimePatterns ('d')); al.AddRange (GetAllRawDateTimePatterns ('D')); - al.AddRange (GetAllRawDateTimePatterns ('g')); - al.AddRange (GetAllRawDateTimePatterns ('G')); al.AddRange (GetAllRawDateTimePatterns ('f')); al.AddRange (GetAllRawDateTimePatterns ('F')); - // Yes, that is very meaningless, but that is what MS - // is doing (LAMESPEC: Since it is documented that - // 'M' and 'm' are equal, they should not cosider - // that there is a possibility that 'M' and 'm' are - // different.) + al.AddRange (GetAllRawDateTimePatterns ('g')); + al.AddRange (GetAllRawDateTimePatterns ('G')); al.AddRange (GetAllRawDateTimePatterns ('m')); al.AddRange (GetAllRawDateTimePatterns ('M')); + al.AddRange (GetAllRawDateTimePatterns ('o')); + al.AddRange (GetAllRawDateTimePatterns ('O')); al.AddRange (GetAllRawDateTimePatterns ('r')); al.AddRange (GetAllRawDateTimePatterns ('R')); al.AddRange (GetAllRawDateTimePatterns ('s')); @@ -682,7 +647,6 @@ namespace System.Globalization internal string[] GetAllRawDateTimePatterns (char format) { - string [] list; switch (format) { // Date case 'D': @@ -702,52 +666,50 @@ namespace System.Globalization if (allShortTimePatterns != null && allShortTimePatterns.Length > 0) return allShortTimePatterns; return new string [] {ShortTimePattern}; - // {Short|Long}Date + {Short|Long}Time - // FIXME: they should be the agglegation of the - // combination of the Date patterns and Time patterns. - case 'G': - list = PopulateCombinedList (allShortDatePatterns, allLongTimePatterns); - if (list != null && list.Length > 0) - return list; - return new string [] {ShortDatePattern + " " + LongTimePattern}; - case 'g': - list = PopulateCombinedList (allShortDatePatterns, allShortTimePatterns); - if (list != null && list.Length > 0) - return list; - return new string [] {ShortDatePattern + " " + ShortTimePattern}; - // The 'U' pattern strings are always the same as 'F'. - // (only differs in assuming UTC or not.) - case 'U': - case 'F': - list = PopulateCombinedList (allLongDatePatterns, allLongTimePatterns); - if (list != null && list.Length > 0) - return list; - return new string [] {LongDatePattern + " " + LongTimePattern}; - case 'f': - list = PopulateCombinedList (allLongDatePatterns, allShortTimePatterns); - if (list != null && list.Length > 0) - return list; - return new string [] {LongDatePattern + " " + ShortTimePattern}; // MonthDay case 'm': case 'M': if (monthDayPatterns != null && monthDayPatterns.Length > 0) return monthDayPatterns; - return new string [] {MonthDayPattern}; + return new string[] { MonthDayPattern }; // YearMonth case 'Y': case 'y': if (yearMonthPatterns != null && yearMonthPatterns.Length > 0) return yearMonthPatterns; - return new string [] {YearMonthPattern}; - // RFC1123 + return new string[] { YearMonthPattern }; case 'r': case 'R': - return new string [] {RFC1123Pattern}; + return new string[] { RFC1123Pattern }; + case 'O': + case 'o': + return new string[] { RoundtripPattern }; case 's': - return new string [] {SortableDateTimePattern}; + return new string[] { SortableDateTimePattern }; case 'u': - return new string [] {UniversalSortableDateTimePattern}; + return new string[] { UniversalSortableDateTimePattern }; + + // + // Following patterns are combinations of {Short|Long}Date + {Short|Long}Time. Patters can + // be null for non-readonly invariant culture + // + case 'G': + return allShortDatePatterns == null ? + new string [] { ShortDatePattern + " " + LongTimePattern } : + PopulateCombinedList (allShortDatePatterns, allLongTimePatterns); + case 'g': + return allShortDatePatterns == null ? + new string [] { ShortDatePattern + " " + ShortTimePattern } : + PopulateCombinedList (allShortDatePatterns, allShortTimePatterns); + case 'U': // The 'U' pattern strings are always the same as 'F' (only differs in assuming UTC or not.) + case 'F': + return allLongDatePatterns == null ? + new string [] { LongDatePattern + " " + ShortTimePattern } : + PopulateCombinedList (allLongDatePatterns, allLongTimePatterns); + case 'f': + return allLongDatePatterns == null ? + new string [] { LongDatePattern + " " + ShortTimePattern } : + PopulateCombinedList (allLongDatePatterns, allShortTimePatterns); } throw new ArgumentException ("Format specifier was invalid."); } @@ -766,7 +728,7 @@ namespace System.Globalization return abbreviatedDayNames[index]; } - private void FillInvariantPatterns () + void FillInvariantPatterns () { allShortDatePatterns = new string [] {"MM/dd/yyyy"}; allLongDatePatterns = new string [] {"dddd, dd MMMM yyyy"}; @@ -779,19 +741,18 @@ namespace System.Globalization }; monthDayPatterns = new string [] {"MMMM dd"}; yearMonthPatterns = new string [] {"yyyy MMMM"}; + + fullDateTimePattern = "dddd, dd MMMM yyyy HH:mm:ss"; } static string [] PopulateCombinedList (string [] dates, string [] times) { - if (dates != null && times != null) { - string [] list = new string [dates.Length * times.Length]; - int i = 0; - foreach (string d in dates) - foreach (string t in times) - list [i++] = d + " " + t; - return list; - } - return null; + string[] list = new string[dates.Length * times.Length]; + int i = 0; + foreach (string d in dates) + foreach (string t in times) + list[i++] = d + " " + t; + return list; } [ComVisible (false)] @@ -799,9 +760,9 @@ namespace System.Globalization { int index = (int) dayOfWeek; if (index < 0 || index > 6) - throw new ArgumentOutOfRangeException(); + throw new ArgumentOutOfRangeException ("dayOfWeek"); - return shortDayNames [index]; + return shortestDayNames [index]; } [ComVisible (false)] diff --git a/mcs/class/corlib/System.Globalization/RegionInfo.cs b/mcs/class/corlib/System.Globalization/RegionInfo.cs index 888a2d42ffd..b6165a661d0 100644 --- a/mcs/class/corlib/System.Globalization/RegionInfo.cs +++ b/mcs/class/corlib/System.Globalization/RegionInfo.cs @@ -1,12 +1,12 @@ // // System.Globalization.RegionInfo.cs // -// Author: +// Authors: // Atsushi Enomoto -// - +// Marek Safar (marek.safar@gmail.com) // // Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// Copyright (C) 2012 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 @@ -68,15 +68,13 @@ namespace System.Globalization string iso3Name; string win3Name; string englishName; + string nativeName; string currencySymbol; string isoCurrencySymbol; string currencyEnglishName; + string currencyNativeName; #pragma warning restore 649 - // new (instance) fields should be added here (and do not have to be duplicated in the runtime) - - int lcid; // it is used only for Equals() (not even used in GetHashCode()). - public RegionInfo (int culture) { if (!GetByTerritory (CultureInfo.GetCultureInfo (culture))) @@ -90,7 +88,6 @@ namespace System.Globalization throw new ArgumentNullException (); if (construct_internal_region_from_name (name.ToUpperInvariant ())) { - lcid = name.GetHashCode (); // random-ish return; } if (!GetByTerritory (CultureInfo.GetCultureInfo (name))) @@ -103,7 +100,7 @@ namespace System.Globalization throw new Exception ("INTERNAL ERROR: should not happen."); if (ci.IsNeutralCulture || ci.Territory == null) return false; - this.lcid = ci.LCID; + return construct_internal_region_from_name (ci.Territory.ToUpperInvariant ()); } @@ -149,15 +146,14 @@ namespace System.Globalization get { return isoCurrencySymbol; } } - [System.Runtime.InteropServices.ComVisible(false)] + [ComVisible(false)] public virtual string NativeName { - get { return DisplayName; } + get { return nativeName; } } - [MonoTODO ("Not implemented")] - [System.Runtime.InteropServices.ComVisible(false)] + [ComVisible(false)] public virtual string CurrencyNativeName { - get { throw new NotImplementedException (); } + get { return currencyNativeName; } } public virtual string Name { @@ -176,18 +172,15 @@ namespace System.Globalization get { return iso2Name; } } - // - // methods - public override bool Equals (object value) { RegionInfo other = value as RegionInfo; - return other != null && lcid == other.lcid; + return other != null && Name == other.Name; } public override int GetHashCode () { - return (int) (0x80000000 + (regionId << 3) + regionId); // it i still based on regionId + return Name.GetHashCode (); } public override string ToString () diff --git a/mcs/class/corlib/System.Globalization/TextInfo.cs b/mcs/class/corlib/System.Globalization/TextInfo.cs index 0fa0bf57b30..cd4b95be987 100644 --- a/mcs/class/corlib/System.Globalization/TextInfo.cs +++ b/mcs/class/corlib/System.Globalization/TextInfo.cs @@ -53,6 +53,7 @@ namespace System.Globalization { public int ebcdic; public int mac; public int oem; + public bool right_to_left; public byte list_sep; } @@ -175,39 +176,7 @@ namespace System.Globalization { [ComVisible (false)] public bool IsRightToLeft { get { - // hardcoded - switch (m_win32LangID) { - case 1: // ar - case 13: // he - case 32: // ur - case 41: // fa - case 90: // syr - case 101: // div - case 1025: // ar-SA - case 1037: // he-IL - case 1056: // ur-PK - case 1065: // ra-IR - case 1114: // syr-SY - case 1125: // div-MV - case 2049: // ar-IQ - case 3073: // ar-EG - case 4097: // ar-LY - case 5121: // ar-DZ - case 6145: // ar-MA - case 7169: // ar-TN - case 8193: // ar-OM - case 9217: // ar-YE - case 10241: // ar-SY - case 11265: // ar-JO - case 12289: // ar-LB - case 13313: // ar-KW - case 14337: // ar-AE - case 15361: // ar-BH - case 16385: // ar-QA - return true; - default: - return false; - } + return data.right_to_left; } } diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs index 4bc72182f76..47ce1efaa34 100644 --- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs +++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs @@ -579,7 +579,7 @@ namespace System.IO.IsolatedStorage { #endif directory.CreateSubdirectory (dir); } else { - string[] dirs = dir.Split (Path.PathSeparatorChars); + string[] dirs = dir.Split (Path.PathSeparatorChars, StringSplitOptions.RemoveEmptyEntries); DirectoryInfo dinfo = directory; for (int i = 0; i < dirs.Length; i++) { @@ -646,6 +646,8 @@ namespace System.IO.IsolatedStorage { public void DeleteDirectory (string dir) { try { + if (Path.IsPathRooted (dir)) + dir = dir.Substring (1); DirectoryInfo subdir = directory.CreateSubdirectory (dir); subdir.Delete (); } diff --git a/mcs/class/corlib/System.IO/BinaryWriter.cs b/mcs/class/corlib/System.IO/BinaryWriter.cs index b730b8ceb10..9650113c9dc 100644 --- a/mcs/class/corlib/System.IO/BinaryWriter.cs +++ b/mcs/class/corlib/System.IO/BinaryWriter.cs @@ -100,7 +100,7 @@ namespace System.IO { Dispose (true); } -#if NET_4_0 || MOONLIGHT +#if NET_4_0 || NET_2_1 public void Dispose () #else void IDisposable.Dispose() diff --git a/mcs/class/corlib/System.IO/Directory.cs b/mcs/class/corlib/System.IO/Directory.cs index 5730a45018c..f5e6742f375 100644 --- a/mcs/class/corlib/System.IO/Directory.cs +++ b/mcs/class/corlib/System.IO/Directory.cs @@ -547,6 +547,12 @@ namespace System.IO throw MonoIO.GetException (Path.GetDirectoryName (Path.Combine (path, searchPattern)), (MonoIOError) error); try { + // + // Convert any file specific flag to FileAttributes.Normal which is used as include files flag + // + if (((rattr & FileAttributes.Directory) == 0) && rattr != 0) + rattr |= FileAttributes.Normal; + bool first = true; if (((rattr & FileAttributes.ReparsePoint) == 0) && ((rattr & kind) != 0)) yield return s; diff --git a/mcs/class/corlib/System.IO/MemoryStream.cs b/mcs/class/corlib/System.IO/MemoryStream.cs index 117c3e915ef..fa874887d6f 100644 --- a/mcs/class/corlib/System.IO/MemoryStream.cs +++ b/mcs/class/corlib/System.IO/MemoryStream.cs @@ -56,6 +56,7 @@ namespace System.IO int position; int dirty_bytes; #if NET_4_5 + [NonSerialized] Task read_task; #endif diff --git a/mcs/class/corlib/System.IO/Stream.cs b/mcs/class/corlib/System.IO/Stream.cs index 28051acb21a..803220306ed 100644 --- a/mcs/class/corlib/System.IO/Stream.cs +++ b/mcs/class/corlib/System.IO/Stream.cs @@ -50,8 +50,11 @@ namespace System.IO { public static readonly Stream Null = new NullStream (); + [NonSerialized] Func async_read; + [NonSerialized] Action async_write; + [NonSerialized] AutoResetEvent async_event; protected Stream () diff --git a/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs b/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs index b038897d1db..5378f7e2a01 100644 --- a/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs +++ b/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs @@ -112,6 +112,9 @@ namespace System.Reflection.Emit { if (parameterTypes [i] == null) throw new ArgumentException ("Parameter " + i + " is null", "parameterTypes"); } + if (owner != null && (owner.IsArray || owner.IsInterface)) { + throw new ArgumentException ("Owner can't be an array or an interface."); + } if (m == null) m = AnonHostModuleHolder.AnonHostModule; diff --git a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs b/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs index 44288a869d1..9d5b22558cf 100644 --- a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs +++ b/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs @@ -1038,7 +1038,7 @@ namespace System.Reflection.Emit { return ig.code_len; } -#if NET_4_0 +#if NET_4_0 || MOBILE public #else internal diff --git a/mcs/class/corlib/System.Reflection/CustomAttributeExtensions.cs b/mcs/class/corlib/System.Reflection/CustomAttributeExtensions.cs new file mode 100644 index 00000000000..57fa4390bfa --- /dev/null +++ b/mcs/class/corlib/System.Reflection/CustomAttributeExtensions.cs @@ -0,0 +1,127 @@ +// +// CustomAttributeExtensions.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2012 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 NET_4_5 + +namespace System.Reflection +{ + public static class CustomAttributeExtensions + { + public static T GetCustomAttribute (this Assembly element) where T : Attribute + { + return (T) Attribute.GetCustomAttribute (element, typeof (T)); + } + + public static T GetCustomAttribute (this MemberInfo element) where T : Attribute + { + return (T) Attribute.GetCustomAttribute (element, typeof (T)); + } + + public static T GetCustomAttribute (this Module element) where T : Attribute + { + return (T) Attribute.GetCustomAttribute (element, typeof (T)); + } + + public static T GetCustomAttribute (this ParameterInfo element) where T : Attribute + { + return (T) Attribute.GetCustomAttribute (element, typeof (T)); + } + + public static T GetCustomAttribute (this MemberInfo element, bool inherit) where T : Attribute + { + return (T) Attribute.GetCustomAttribute (element, typeof (T), inherit); + } + + public static T GetCustomAttribute (this ParameterInfo element, bool inherit) where T : Attribute + { + return (T) Attribute.GetCustomAttribute (element, typeof (T), inherit); + } + + public static Attribute GetCustomAttribute (this Assembly element, Type attributeType) + { + return Attribute.GetCustomAttribute (element, attributeType); + } + + public static Attribute GetCustomAttribute (this MemberInfo element, Type attributeType) + { + return Attribute.GetCustomAttribute (element, attributeType); + } + + public static Attribute GetCustomAttribute (this MemberInfo element, Type attributeType, bool inherit) + { + return Attribute.GetCustomAttribute (element, attributeType, inherit); + } + + public static Attribute GetCustomAttribute (this Module element, Type attributeType) + { + return Attribute.GetCustomAttribute (element, attributeType); + } + + public static Attribute GetCustomAttribute (this ParameterInfo element, Type attributeType) + { + return Attribute.GetCustomAttribute (element, attributeType); + } + + public static Attribute GetCustomAttribute (this ParameterInfo element, Type attributeType, bool inherit) + { + return Attribute.GetCustomAttribute (element, attributeType, inherit); + } + + public static bool IsDefined (this Assembly element, Type attributeType) + { + return Attribute.IsDefined (element, attributeType); + } + + public static bool IsDefined (this MemberInfo element, Type attributeType) + { + return Attribute.IsDefined (element, attributeType); + } + + public static bool IsDefined (this Module element, Type attributeType) + { + return Attribute.IsDefined (element, attributeType); + } + + public static bool IsDefined (this ParameterInfo element, Type attributeType) + { + return Attribute.IsDefined (element, attributeType); + } + + public static bool IsDefined (this MemberInfo element, Type attributeType, bool inherit) + { + return Attribute.IsDefined (element, attributeType, inherit); + } + + public static bool IsDefined (this ParameterInfo element, Type attributeType, bool inherit) + { + return Attribute.IsDefined (element, attributeType, inherit); + } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncStateMachineAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncStateMachineAttribute.cs new file mode 100644 index 00000000000..b0ebad2bd03 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncStateMachineAttribute.cs @@ -0,0 +1,44 @@ +// +// AsyncStateMachineAttribute.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2012 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 NET_4_5 + +namespace System.Runtime.CompilerServices +{ + [AttributeUsage (AttributeTargets.Method)] + [Serializable] + public sealed class AsyncStateMachineAttribute : StateMachineAttribute + { + public AsyncStateMachineAttribute (Type stateMachineType) + : base (stateMachineType) + { + } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/IteratorStateMachineAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/IteratorStateMachineAttribute.cs new file mode 100644 index 00000000000..5612c4c9e35 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.CompilerServices/IteratorStateMachineAttribute.cs @@ -0,0 +1,44 @@ +// +// IteratorStateMachineAttribute.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2012 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 NET_4_5 + +namespace System.Runtime.CompilerServices +{ + [AttributeUsage (AttributeTargets.Method)] + [Serializable] + public sealed class IteratorStateMachineAttribute : StateMachineAttribute + { + public IteratorStateMachineAttribute (Type stateMachineType) + : base (stateMachineType) + { + } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/StateMachineAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/StateMachineAttribute.cs new file mode 100644 index 00000000000..06ff632ca04 --- /dev/null +++ b/mcs/class/corlib/System.Runtime.CompilerServices/StateMachineAttribute.cs @@ -0,0 +1,46 @@ +// +// StateMachineAttribute.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2012 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 NET_4_5 + +namespace System.Runtime.CompilerServices +{ + [AttributeUsage (AttributeTargets.Method)] + [Serializable] + public class StateMachineAttribute : Attribute + { + public StateMachineAttribute (Type stateMachineType) + { + StateMachineType = stateMachineType; + } + + public Type StateMachineType { get; private set; } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs index 5b95e94dd1e..39ac038dd88 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs @@ -48,13 +48,8 @@ namespace System.Runtime.InteropServices { public bool PreserveSig; public bool SetLastError; -#if NET_1_1 public bool BestFitMapping; public bool ThrowOnUnmappableChar; -#else - private bool BestFitMapping; - private bool ThrowOnUnmappableChar; -#endif #endregion public string Value { diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_Assembly.cs b/mcs/class/corlib/System.Runtime.InteropServices/_Assembly.cs index 3e9780a9885..29e234bf547 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_Assembly.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_Assembly.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System.IO; using System.Globalization; using System.Reflection; @@ -137,4 +135,3 @@ namespace System.Runtime.InteropServices } } -#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyBuilder.cs b/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyBuilder.cs index ac80562f233..db444ea3008 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyBuilder.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyBuilder.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System.Reflection.Emit; namespace System.Runtime.InteropServices { @@ -49,5 +47,3 @@ namespace System.Runtime.InteropServices { IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); } } - -#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyName.cs b/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyName.cs index a4ae7a34e9b..ab72a0da60b 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyName.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_AssemblyName.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System.Reflection; namespace System.Runtime.InteropServices { @@ -49,5 +47,3 @@ namespace System.Runtime.InteropServices { IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); } } - -#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_Attribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/_Attribute.cs index c162d9dd111..46671e3d00e 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_Attribute.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_Attribute.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System; namespace System.Runtime.InteropServices { @@ -48,5 +46,3 @@ namespace System.Runtime.InteropServices { IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); } } - -#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorBuilder.cs b/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorBuilder.cs index 622a0dcf706..bc8f5fbbf35 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorBuilder.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorBuilder.cs @@ -27,8 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_1_1 - using System.Reflection.Emit; namespace System.Runtime.InteropServices { @@ -49,5 +47,3 @@ namespace System.Runtime.InteropServices { IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); } } - -#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorInfo.cs b/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorInfo.cs index 5515f46b9c0..c11dbac76c5 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorInfo.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_ConstructorInfo.cs @@ -5,8 +5,6 @@ // Kazuki Oikawa (kazuki@panicode.com) // -#if NET_1_1 - using System; using System.Globalization; using System.Reflection; @@ -96,4 +94,3 @@ namespace System.Runtime.InteropServices Type ReflectedType {get;} } } -#endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_MemberInfo.cs b/mcs/class/corlib/System.Runtime.InteropServices/_MemberInfo.cs index 4e745e55ccf..0b7e269fbf6 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_MemberInfo.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_MemberInfo.cs @@ -5,8 +5,6 @@ // Kazuki Oikawa (kazuki@panicode.com) // -#if NET_1_1 - using System; using System.Reflection; @@ -51,4 +49,3 @@ namespace System.Runtime.InteropServices IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); } } -#endif diff --git a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs index 0d9f6142602..d15ea7d943f 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs @@ -403,10 +403,8 @@ namespace System.Runtime.Remoting.Channels return null; } -#if NET_1_1 if (RemotingConfiguration.CustomErrorsEnabled (IsLocalCall (msg))) replySink = new ExceptionFilterSink (msg, replySink); -#endif return _crossContextSink.AsyncProcessMessage (msg, replySink); } @@ -425,7 +423,6 @@ namespace System.Runtime.Remoting.Channels internal static IMessage CheckReturnMessage (IMessage callMsg, IMessage retMsg) { -#if NET_1_1 IMethodReturnMessage ret = retMsg as IMethodReturnMessage; if (ret != null && ret.Exception != null) { @@ -435,7 +432,6 @@ namespace System.Runtime.Remoting.Channels retMsg = new MethodResponse (ex, (IMethodCallMessage)callMsg); } } -#endif return retMsg; } diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs index 46e71422e04..33fef7a0a8d 100644 --- a/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs +++ b/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs @@ -364,14 +364,12 @@ namespace System.Runtime.Remoting } } -#if NET_1_1 public static bool CustomErrorsEnabled (bool isLocalRequest) { if (_errorMode == "off") return false; if (_errorMode == "on") return true; return !isLocalRequest; } -#endif internal static void SetCustomErrorsMode (string mode) { diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs index fd9c53307f1..e3962a3b715 100644 --- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs +++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs @@ -46,9 +46,7 @@ namespace System.Runtime.Serialization.Formatters.Binary StreamingContext _context; SerializationBinder _binder; -#if NET_1_1 TypeFilterLevel _filterLevel; -#endif ObjectManager _manager; Hashtable _registeredAssemblies = new Hashtable(); @@ -84,9 +82,7 @@ namespace System.Runtime.Serialization.Formatters.Binary _binder = formatter.Binder; _manager = new ObjectManager (_surrogateSelector, _context); -#if NET_1_1 _filterLevel = formatter.FilterLevel; -#endif } public void ReadObjectGraph (BinaryReader reader, bool readHeaders, out object result, out Header[] headers) @@ -701,10 +697,6 @@ namespace System.Runtime.Serialization.Formatters.Binary if (field != null) metadata.MemberInfos [n] = field; -#if ONLY_1_1 - else - throw new SerializationException ("Field \"" + names[n] + "\" not found in class " + metadata.Type.FullName); -#endif if (!hasTypeInfo) { types [n] = field.FieldType; diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs index 7b98be5a75c..e749a7cd719 100644 --- a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs +++ b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs @@ -31,6 +31,10 @@ using System.Globalization; using System.IO; using System.Runtime.InteropServices; +#if NET_4_5 +using System.Threading; +using System.Threading.Tasks; +#endif namespace System.Security.Cryptography { @@ -357,10 +361,28 @@ namespace System.Security.Cryptography { } } } + #if NET_4_0 public bool HasFlushedFinalBlock { get { return _flushedFinalBlock; } } #endif + +#if NET_4_5 + public override Task FlushAsync (CancellationToken cancellationToken) + { + return base.FlushAsync (cancellationToken); + } + + public override Task ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + return base.ReadAsync (buffer, offset, count, cancellationToken); + } + + public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + return base.WriteAsync (buffer, offset, count, cancellationToken); + } +#endif } } diff --git a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs index 41951ff66cc..3a1270cbd66 100644 --- a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs @@ -92,10 +92,8 @@ namespace System.Security.Cryptography { persistKey = (parameters != null); if (parameters == null) { parameters = new CspParameters (PROV_DSS_DH); -#if NET_1_1 if (useMachineKeyStore) parameters.Flags |= CspProviderFlags.UseMachineKeyStore; -#endif store = new KeyPairPersistence (parameters); // no need to load - it cannot exists } @@ -137,14 +135,12 @@ namespace System.Security.Cryptography { get { return "http://www.w3.org/2000/09/xmldsig#dsa-sha1"; } } -#if NET_1_1 private static bool useMachineKeyStore = false; public static bool UseMachineKeyStore { get { return useMachineKeyStore; } set { useMachineKeyStore = value; } } -#endif public override DSAParameters ExportParameters (bool includePrivateParameters) { diff --git a/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs index ade2b040e3e..7222512b08f 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs @@ -94,10 +94,6 @@ namespace System.Security.Cryptography { public RC2Transform (RC2 rc2Algo, bool encryption, byte[] key, byte[] iv) : base (rc2Algo, encryption, iv) { -#if ONLY_1_1 - if (key == null) - throw new ArgumentNullException ("key"); -#endif int t1 = rc2Algo.EffectiveKeySize; if (key == null) { key = KeyBuilder.Key (rc2Algo.KeySize >> 3); diff --git a/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs index 41bc61d907f..bf4de13a909 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs @@ -41,6 +41,8 @@ namespace System.Security.Cryptography { [ComVisible (true)] public sealed class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm { private const int PROV_RSA_FULL = 1; // from WinCrypt.h + private const int AT_KEYEXCHANGE = 1; + private const int AT_SIGNATURE = 2; private KeyPairPersistence store; private bool persistKey; @@ -96,10 +98,8 @@ namespace System.Security.Cryptography { persistKey = (p != null); if (p == null) { p = new CspParameters (PROV_RSA_FULL); -#if NET_1_1 if (useMachineKeyStore) p.Flags |= CspProviderFlags.UseMachineKeyStore; -#endif store = new KeyPairPersistence (p); // no need to load - it cannot exists } @@ -118,14 +118,12 @@ namespace System.Security.Cryptography { } } -#if NET_1_1 private static bool useMachineKeyStore = false; public static bool UseMachineKeyStore { get { return useMachineKeyStore; } set { useMachineKeyStore = value; } } -#endif ~RSACryptoServiceProvider () { @@ -166,10 +164,8 @@ namespace System.Security.Cryptography { public byte[] Decrypt (byte[] rgb, bool fOAEP) { -#if NET_1_1 if (m_disposed) throw new ObjectDisposedException ("rsa"); -#endif // choose between OAEP or PKCS#1 v.1.5 padding AsymmetricKeyExchangeDeformatter def = null; if (fOAEP) @@ -250,10 +246,8 @@ namespace System.Security.Cryptography { // HashAlgorithm descendant public byte[] SignData (byte[] buffer, object halg) { -#if NET_1_1 if (buffer == null) throw new ArgumentNullException ("buffer"); -#endif return SignData (buffer, 0, buffer.Length, halg); } @@ -377,7 +371,7 @@ namespace System.Security.Cryptography { // ALGID (bytes 4-7) - default is KEYX // 00 24 00 00 (for CALG_RSA_SIGN) // 00 A4 00 00 (for CALG_RSA_KEYX) - blob [5] = 0xA4; + blob [5] = (byte) (((store != null) && (store.Parameters.KeyNumber == AT_SIGNATURE)) ? 0x24 : 0xA4); return blob; } @@ -405,6 +399,12 @@ namespace System.Security.Cryptography { ImportParameters (rsap); } } + + var p = new CspParameters (PROV_RSA_FULL); + p.KeyNumber = keyBlob [5] == 0x24 ? AT_SIGNATURE : AT_KEYEXCHANGE; + if (useMachineKeyStore) + p.Flags |= CspProviderFlags.UseMachineKeyStore; + store = new KeyPairPersistence (p); } } } diff --git a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs index 4ae6491f2c8..c8160ad4b72 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs @@ -57,7 +57,16 @@ namespace System.Security.Cryptography { public abstract void GetBytes (byte[] data); +#if NET_4_5 + public virtual void GetNonZeroBytes (byte[] data) + { + throw new NotImplementedException (); + } +#else public abstract void GetNonZeroBytes (byte[] data); +#endif + + #if NET_4_0 || MOONLIGHT public void Dispose () { diff --git a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs index 629f5633c2e..3e1c714e375 100644 --- a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs +++ b/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs @@ -51,9 +51,7 @@ namespace System.Security.Permissions { // Properties public string All { -#if NET_1_1 get { throw new NotSupportedException ("All"); } -#endif set { read = value; write = value; diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs index 85bf6fa4f0a..78afc430071 100644 --- a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs +++ b/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs @@ -69,15 +69,13 @@ namespace System.Security.Permissions { RemotingConfiguration = 0x00000800, Infrastructure = 0x00001000, -#if ! NET_1_0 + BindingRedirects = 0x00002000, -#endif + AllFlags = Assertion | UnmanagedCode | SkipVerification | Execution | ControlThread | ControlAppDomain | ControlDomainPolicy | ControlEvidence | ControlPolicy | ControlPrincipal | Infrastructure | RemotingConfiguration | SerializationFormatter -#if ! NET_1_0 | BindingRedirects -#endif } // SecurityPermissionFlag } // System.Security.Permissions diff --git a/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs b/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs index 26d4b84f6c5..14f07dd98c8 100644 --- a/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs +++ b/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs @@ -76,7 +76,7 @@ namespace System.Security.Principal { // last - as it can override some fields SetToken (userToken); } -#if !NET_1_0 + [SecurityPermission (SecurityAction.Demand, ControlPrincipal=true)] public WindowsIdentity (string sUserPrincipalName) : this (sUserPrincipalName, null) @@ -107,7 +107,6 @@ namespace System.Security.Principal { { _info = info; } -#endif [ComVisible (false)] public void Dispose () @@ -252,7 +251,7 @@ namespace System.Security.Principal { _account = (WindowsAccountType) _info.GetValue ("m_acctType", typeof (WindowsAccountType)); _authenticated = _info.GetBoolean ("m_isAuthenticated"); } -#if !NET_1_0 + void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) { info.AddValue ("m_userToken", _token); @@ -262,7 +261,7 @@ namespace System.Security.Principal { info.AddValue ("m_acctType", _account); info.AddValue ("m_isAuthenticated", _authenticated); } -#endif + private void SetToken (IntPtr token) { if (Environment.IsUnix) { diff --git a/mcs/class/corlib/System.Security.Principal/WindowsPrincipal.cs b/mcs/class/corlib/System.Security.Principal/WindowsPrincipal.cs index f4cb14ba291..d5c1724ce75 100644 --- a/mcs/class/corlib/System.Security.Principal/WindowsPrincipal.cs +++ b/mcs/class/corlib/System.Security.Principal/WindowsPrincipal.cs @@ -118,17 +118,9 @@ namespace System.Security.Principal { if (m_roles == null) { m_roles = WindowsIdentity._GetRoles (Token); } -#if !NET_1_0 - role = role.ToUpperInvariant (); -#endif foreach (string check in m_roles) { -#if NET_1_0 - if (role == check) - return true; -#else if ((check != null) && (role == check.ToUpperInvariant ())) return true; -#endif } return false; } diff --git a/mcs/class/corlib/System.Security/SecurityElement.cs b/mcs/class/corlib/System.Security/SecurityElement.cs index 9ba34115463..ca0513ba86a 100644 --- a/mcs/class/corlib/System.Security/SecurityElement.cs +++ b/mcs/class/corlib/System.Security/SecurityElement.cs @@ -436,9 +436,6 @@ namespace System.Security { foreach (SecurityElement child in children) { child.ToXml (ref s, level + 1); } -#if ! NET_2_0 - s.Append (' ', level * 3); -#endif } s.Append (" end_bytes) @@ -883,7 +879,7 @@ fail_no_space: if (emitIdentifier) return new byte [] { 0xEF, 0xBB, 0xBF }; - return new byte [0]; + return empty; } // Determine if this object is equal to another. diff --git a/mcs/class/corlib/System.Text/UnicodeEncoding.cs b/mcs/class/corlib/System.Text/UnicodeEncoding.cs index c0f8ab716c5..216538d73bf 100644 --- a/mcs/class/corlib/System.Text/UnicodeEncoding.cs +++ b/mcs/class/corlib/System.Text/UnicodeEncoding.cs @@ -378,9 +378,9 @@ public class UnicodeEncoding : Encoding preamble[1] = (byte)0xFE; } return preamble; - } else { - return new byte [0]; } + + return empty; } // Determine if this object is equal to another. diff --git a/mcs/class/corlib/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs b/mcs/class/corlib/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs new file mode 100644 index 00000000000..8e98958571b --- /dev/null +++ b/mcs/class/corlib/System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs @@ -0,0 +1,273 @@ +// +// ConcurrentExclusiveSchedulerPair.cs +// +// Authors: +// Jérémie "Garuma" Laval +// Marek Safar +// +// Copyright (c) 2011 Jérémie "Garuma" Laval +// Copyright 2012 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 NET_4_5 + +using System; +using System.Threading; +using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Diagnostics; + +namespace System.Threading.Tasks +{ + [DebuggerDisplay ("Concurrent={ConcurrentTaskCount}, Exclusive={ExclusiveTaskCount}")] + [DebuggerTypeProxy (typeof (SchedulerDebuggerView))] + public class ConcurrentExclusiveSchedulerPair + { + sealed class SchedulerDebuggerView + { + readonly ConcurrentExclusiveSchedulerPair owner; + + public SchedulerDebuggerView (ConcurrentExclusiveSchedulerPair owner) + { + this.owner = owner; + } + + public IEnumerable ScheduledConcurrent { + get { + return owner.concurrentTasks; + } + } + + public IEnumerable ScheduledExclusive { + get { + return owner.exclusiveTasks; + } + } + + public TaskScheduler TargetScheduler { + get { + return owner.target; + } + } + + } + + readonly int maxConcurrencyLevel; + readonly int maxItemsPerTask; + + readonly TaskScheduler target; + readonly TaskFactory factory; + readonly Action taskHandler; + + readonly ConcurrentQueue concurrentTasks = new ConcurrentQueue (); + readonly ConcurrentQueue exclusiveTasks = new ConcurrentQueue (); + + //readonly ReaderWriterLockSlim rwl = new ReaderWriterLockSlim (); + readonly TaskCompletionSource completion = new TaskCompletionSource (); + readonly InnerTaskScheduler concurrent; + readonly InnerTaskScheduler exclusive; + + int numTask; + + class InnerTaskScheduler : TaskScheduler + { + readonly ConcurrentExclusiveSchedulerPair scheduler; + readonly ConcurrentQueue queue; + + public InnerTaskScheduler (ConcurrentExclusiveSchedulerPair scheduler, + ConcurrentQueue queue) + { + this.scheduler = scheduler; + this.queue = queue; + } + + public int TaskCount { + get { + return queue.Count; + } + } + + public override int MaximumConcurrencyLevel { + get { + return scheduler.maxConcurrencyLevel; + } + } + + protected internal override void QueueTask (Task t) + { + scheduler.DoQueue (t, queue); + } + + protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued) + { + if (task.Status != TaskStatus.Created) + return false; + + task.RunSynchronously (scheduler.target); + return true; + } + + public void Execute (Task t) + { + TryExecuteTask (t); + } + + [MonoTODO ("Only useful for debugger support")] + protected override IEnumerable GetScheduledTasks () + { + throw new NotImplementedException (); + } + } + + public ConcurrentExclusiveSchedulerPair () : this (TaskScheduler.Current) + { + } + + public ConcurrentExclusiveSchedulerPair (TaskScheduler taskScheduler) : this (taskScheduler, taskScheduler.MaximumConcurrencyLevel) + { + } + + public ConcurrentExclusiveSchedulerPair (TaskScheduler taskScheduler, int maxConcurrencyLevel) + : this (taskScheduler, maxConcurrencyLevel, -1) + { + } + + public ConcurrentExclusiveSchedulerPair (TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) + { + this.target = taskScheduler; + this.maxConcurrencyLevel = maxConcurrencyLevel; + this.maxItemsPerTask = maxItemsPerTask; + this.factory = new TaskFactory (taskScheduler); + this.taskHandler = InternalTaskProcesser; + this.concurrent = new InnerTaskScheduler (this, concurrentTasks); + this.exclusive = new InnerTaskScheduler (this, exclusiveTasks); + } + + public void Complete () + { + completion.SetResult (null); + } + + public TaskScheduler ConcurrentScheduler { + get { + return concurrent; + } + } + + private int ConcurrentTaskCount { + get { + return concurrent.TaskCount; + } + } + + public TaskScheduler ExclusiveScheduler { + get { + return exclusive; + } + } + + private int ExclusiveTaskCount { + get { + return exclusive.TaskCount; + } + } + + public Task Completion { + get { + return completion.Task; + } + } + + void DoQueue (Task task, ConcurrentQueue queue) + { + queue.Enqueue (task); + SpinUpTasks (); + } + + void InternalTaskProcesser () + { + int times = 0; + const int lockWaitTime = 2; + + while (!concurrentTasks.IsEmpty || !exclusiveTasks.IsEmpty) { + if (maxItemsPerTask != -1 && ++times == maxItemsPerTask) + break; + + throw new NotImplementedException (); +/* + bool locked = false; + + try { + if (!concurrentTasks.IsEmpty && rwl.TryEnterReadLock (lockWaitTime)) { + locked = true; + Task task; + while (concurrentTasks.TryDequeue (out task)) { + RunTask (task); + } + } + } finally { + if (locked) { + rwl.ExitReadLock (); + locked = false; + } + } + + try { + if (!exclusiveTasks.IsEmpty && rwl.TryEnterWriteLock (lockWaitTime)) { + locked = true; + Task task; + while (exclusiveTasks.TryDequeue (out task)) { + RunTask (task); + } + } + } finally { + if (locked) { + rwl.ExitWriteLock (); + } + } +*/ + } + + // TODO: there's a race here, task adding + spinup check may be done while here + Interlocked.Decrement (ref numTask); + } + + void SpinUpTasks () + { + int currentTaskNumber; + do { + currentTaskNumber = numTask; + if (currentTaskNumber >= maxConcurrencyLevel) + return; + } while (Interlocked.CompareExchange (ref numTask, currentTaskNumber + 1, currentTaskNumber) != currentTaskNumber); + + factory.StartNew (taskHandler); + } + + void RunTask (Task task) + { + concurrent.Execute (task); + } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Threading.Tasks/Task.cs b/mcs/class/corlib/System.Threading.Tasks/Task.cs index 9b759776134..7f6e461e85c 100644 --- a/mcs/class/corlib/System.Threading.Tasks/Task.cs +++ b/mcs/class/corlib/System.Threading.Tasks/Task.cs @@ -206,7 +206,7 @@ namespace System.Threading.Tasks Status = TaskStatus.WaitingToRun; try { - if (scheduler.RunInline (this)) + if (scheduler.RunInline (this, false)) return; } catch (Exception inner) { throw new TaskSchedulerException (inner); @@ -605,7 +605,7 @@ namespace System.Threading.Tasks if (!IsCompleted) { // If the task is ready to be run and we were supposed to wait on it indefinitely without cancellation, just run it if (Status == TaskStatus.WaitingToRun && millisecondsTimeout == Timeout.Infinite && scheduler != null && !cancellationToken.CanBeCanceled) - Execute (); + scheduler.RunInline (this, true); if (!IsCompleted) { var continuation = new ManualResetContinuation (); diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs b/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs index 4d7797cf4ae..373d6264d58 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs @@ -1,5 +1,5 @@ // -// Task.cs +// TaskExceptionSlot.cs // // Authors: // Marek Safar @@ -51,8 +51,14 @@ namespace System.Threading.Tasks ~TaskExceptionSlot () { if (Exception != null && !Observed && !TaskScheduler.FireUnobservedEvent (parent, Exception).Observed) { - parent = null; + // NET 4.5 changed the default exception behavior for unobserved exceptions. Unobserved exceptions still cause + // the UnobservedTaskException event to be raised but the process will not crash by default + // + // .NET allows to configure this using config element ThrowUnobservedTaskExceptions + // +#if !NET_4_5 throw Exception; +#endif } } } diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs b/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs index 98c5c70327d..71abd1c75bb 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskScheduler.cs @@ -133,9 +133,9 @@ namespace System.Threading.Tasks protected abstract bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued); - internal bool RunInline (Task task) + internal bool RunInline (Task task, bool taskWasPreviouslyQueued) { - if (!TryExecuteTaskInline (task, false)) + if (!TryExecuteTaskInline (task, taskWasPreviouslyQueued)) return false; if (!task.IsCompleted) diff --git a/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs b/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs index 95df5a5b16d..6959afd7082 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs @@ -31,6 +31,8 @@ #if NET_4_0 || MOBILE +using System.Collections.Generic; + namespace System.Threading.Tasks { sealed class TpScheduler: TaskScheduler @@ -57,18 +59,22 @@ namespace System.Threading.Tasks task.Execute (); } - protected override System.Collections.Generic.IEnumerable GetScheduledTasks () + protected override IEnumerable GetScheduledTasks () { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } + [MonoTODO ("Tasks cannot be dequeued")] protected internal override bool TryDequeue (Task task) { - throw new System.NotImplementedException(); + return false; } protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued) { + if (taskWasPreviouslyQueued && !TryDequeue (task)) + return false; + return TryExecuteTask(task); } } diff --git a/mcs/class/corlib/System.Threading/CancellationTokenRegistration.cs b/mcs/class/corlib/System.Threading/CancellationTokenRegistration.cs index f89329067c3..f9fe6b32269 100644 --- a/mcs/class/corlib/System.Threading/CancellationTokenRegistration.cs +++ b/mcs/class/corlib/System.Threading/CancellationTokenRegistration.cs @@ -67,7 +67,7 @@ namespace System.Threading public override int GetHashCode () { - return id.GetHashCode () ^ source.GetHashCode (); + return id.GetHashCode () ^ (source == null ? 0 : source.GetHashCode ()); } public override bool Equals (object obj) diff --git a/mcs/class/corlib/System.Threading/CancellationTokenSource.cs b/mcs/class/corlib/System.Threading/CancellationTokenSource.cs index 4c5b2b2196c..69e6e819a7c 100644 --- a/mcs/class/corlib/System.Threading/CancellationTokenSource.cs +++ b/mcs/class/corlib/System.Threading/CancellationTokenSource.cs @@ -118,7 +118,12 @@ namespace System.Threading { CheckDisposed (); + if (canceled) + return; + + Thread.MemoryBarrier (); canceled = true; + handle.Set (); List exceptions = null; @@ -229,9 +234,13 @@ namespace System.Threading void Dispose (bool disposing) { if (disposing && !disposed) { + Thread.MemoryBarrier (); disposed = true; - callbacks = null; + if (!canceled) { + Thread.MemoryBarrier (); + callbacks = null; + } #if NET_4_5 if (timer != null) timer.Dispose (); @@ -263,8 +272,13 @@ namespace System.Threading internal void RemoveCallback (CancellationTokenRegistration reg) { + // Ignore call if the source has been disposed + if (disposed) + return; Action dummy; - callbacks.TryRemove (reg, out dummy); + var cbs = callbacks; + if (cbs != null) + cbs.TryRemove (reg, out dummy); } } } diff --git a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs index 522c78c9e4b..d64983d34e5 100644 --- a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs +++ b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs @@ -118,11 +118,5 @@ namespace System.Threading } } -#if ONLY_1_1 - [MonoTODO] - ~RegisteredWaitHandle() { - // FIXME - } -#endif } } diff --git a/mcs/class/corlib/System.Threading/SynchronizationContext.cs b/mcs/class/corlib/System.Threading/SynchronizationContext.cs index cb7369fb0ff..3bbb7569ff3 100644 --- a/mcs/class/corlib/System.Threading/SynchronizationContext.cs +++ b/mcs/class/corlib/System.Threading/SynchronizationContext.cs @@ -50,7 +50,10 @@ namespace System.Threading public static SynchronizationContext Current { get { -#if NET_2_1 +#if MONODROID + if (currentContext == null) + currentContext = AndroidPlatform.GetDefaultSyncContext (); +#elif NET_2_1 if (currentContext == null) currentContext = new SynchronizationContext (); #endif diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index b433e4ca8e9..89b1a5a97c3 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -474,6 +474,12 @@ namespace System.Threading { private Thread (InternalThread it) { internal_thread = it; } + + // part of ".NETPortable,Version=v4.0,Profile=Profile3" i.e. FX4 and SL4 + [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] + ~Thread () + { + } #if !MOONLIGHT [Obsolete ("Deprecated in favor of GetApartmentState, SetApartmentState and TrySetApartmentState.")] @@ -677,10 +683,8 @@ namespace System.Threading { } #endif -#if NET_1_1 [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static void MemoryBarrier (); -#endif #if !MOONLIGHT [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -815,8 +819,6 @@ namespace System.Threading { [MethodImplAttribute (MethodImplOptions.InternalCall)] extern private static ThreadState GetState (InternalThread thread); -#if NET_1_1 - [MethodImplAttribute (MethodImplOptions.InternalCall)] extern public static byte VolatileRead (ref byte address); @@ -905,7 +907,6 @@ namespace System.Threading { [MethodImplAttribute (MethodImplOptions.InternalCall)] extern public static void VolatileWrite (ref UIntPtr address, UIntPtr value); -#endif static int CheckStackSize (int maxStackSize) { @@ -1044,11 +1045,7 @@ namespace System.Threading { [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)] [StrongNameIdentityPermission (SecurityAction.LinkDemand, PublicKey="00000000000000000400000000000000")] [Obsolete ("see CompressedStack class")] -#if NET_1_1 public -#else - internal -#endif CompressedStack GetCompressedStack () { // Note: returns null if no CompressedStack has been set. @@ -1064,11 +1061,7 @@ namespace System.Threading { [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)] [StrongNameIdentityPermission (SecurityAction.LinkDemand, PublicKey="00000000000000000400000000000000")] [Obsolete ("see CompressedStack class")] -#if NET_1_1 public -#else - internal -#endif void SetCompressedStack (CompressedStack stack) { ExecutionContext.SecurityContext.CompressedStack = stack; @@ -1076,7 +1069,6 @@ namespace System.Threading { #endif -#if NET_1_1 void _Thread.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) { throw new NotImplementedException (); @@ -1097,6 +1089,5 @@ namespace System.Threading { { throw new NotImplementedException (); } -#endif } } diff --git a/mcs/class/corlib/System/AndroidPlatform.cs b/mcs/class/corlib/System/AndroidPlatform.cs new file mode 100644 index 00000000000..d9e818b2b77 --- /dev/null +++ b/mcs/class/corlib/System/AndroidPlatform.cs @@ -0,0 +1,53 @@ +// +// System.AndroidPlatform.cs +// +// Author: +// Jonathan Pryor (jonp@xamarin.com) +// +// Copyright (C) 2012 Xamarin Inc (http://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 MONODROID +using System.Threading; + +namespace System { + + internal class AndroidPlatform { + + static readonly Func getDefaultSyncContext; + + static AndroidPlatform () + { + getDefaultSyncContext = (Func) + Delegate.CreateDelegate (typeof(Func), + Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true) + .GetMethod ("GetDefaultSyncContext", + System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)); + } + + internal static SynchronizationContext GetDefaultSyncContext () + { + return getDefaultSyncContext (); + } + } +} +#endif diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs index 5f3696e7af3..18865297cfe 100644 --- a/mcs/class/corlib/System/Array.cs +++ b/mcs/class/corlib/System/Array.cs @@ -2723,11 +2723,12 @@ namespace System while (iMin <= iMax) { // Be careful with overflows int iMid = iMin + ((iMax - iMin) / 2); - iCmp = comparer.Compare (value, array [iMid]); + iCmp = comparer.Compare (array [iMid], value); if (iCmp == 0) return iMid; - else if (iCmp < 0) + + if (iCmp > 0) iMax = iMid - 1; else iMin = iMid + 1; // compensate for the rounding down diff --git a/mcs/class/corlib/System/ArraySegment.cs b/mcs/class/corlib/System/ArraySegment.cs index 44a71391821..77d76ad069d 100644 --- a/mcs/class/corlib/System/ArraySegment.cs +++ b/mcs/class/corlib/System/ArraySegment.cs @@ -4,8 +4,10 @@ // Authors: // Ben Maurer (bmaurer@ximian.com) // Jensen Somers +// Marek Safar (marek.safar@gmail.com) // // Copyright (C) 2004 Novell +// Copyright (C) 2012 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 @@ -26,11 +28,20 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace System { + +using System.Collections; +using System.Collections.Generic; + +namespace System +{ [Serializable] - public struct ArraySegment { + public struct ArraySegment +#if NET_4_5 + : IList, IReadOnlyList +#endif + { T [] array; - int offset, count; + readonly int offset, count; public ArraySegment (T [] array, int offset, int count) { @@ -107,5 +118,87 @@ namespace System { { return !(a.Equals(b)); } + +#if NET_4_5 + bool ICollection.IsReadOnly { + get { + return true; + } + } + + T IReadOnlyList.this[int index] { + get { + return ((IList) this)[index]; + } + } + + T IList.this[int index] { + get { + if (index < 0 || count < index) + throw new ArgumentOutOfRangeException ("index"); + + return array[offset + index]; + } + set { + if (index < 0 || count < index) + throw new ArgumentOutOfRangeException ("index"); + + array[offset + index] = value; + } + } + + void ICollection.Add (T item) + { + throw new NotSupportedException (); + } + + void ICollection.Clear () + { + throw new NotSupportedException (); + } + + bool ICollection.Remove (T item) + { + throw new NotSupportedException (); + } + + void IList.Insert (int index, T item) + { + throw new NotSupportedException (); + } + + void IList.RemoveAt (int index) + { + throw new NotSupportedException (); + } + + bool ICollection.Contains (T item) + { + return System.Array.IndexOf (array, item, offset, count) >= 0; + } + + void ICollection.CopyTo (T[] array, int arrayIndex) + { + System.Array.Copy (this.array, offset, array, arrayIndex, count); + } + + IEnumerator IEnumerable.GetEnumerator () + { + for (int i = 0; i < count; ++i) + yield return array[offset + i]; + } + + IEnumerator IEnumerable.GetEnumerator () + { + return ((IEnumerable) this).GetEnumerator (); + } + + int IList.IndexOf (T item) + { + var res = System.Array.IndexOf (array, item, offset, count); + return res < 0 ? -1 : res - offset; + } + +#endif } } diff --git a/mcs/class/corlib/System/BitConverter.cs b/mcs/class/corlib/System/BitConverter.cs index 29db8e6bcb5..d030979b7b2 100644 --- a/mcs/class/corlib/System/BitConverter.cs +++ b/mcs/class/corlib/System/BitConverter.cs @@ -60,14 +60,14 @@ namespace System return b [2] == 0xf0; } - public static long DoubleToInt64Bits (double value) + public unsafe static long DoubleToInt64Bits (double value) { - return ToInt64 (GetBytes (value), 0); + return *(long *) &value; } - public static double Int64BitsToDouble (long value) + public unsafe static double Int64BitsToDouble (long value) { - return ToDouble (GetBytes (value), 0); + return *(double *) &value; } internal static double InternalInt64BitsToDouble (long value) diff --git a/mcs/class/corlib/System/DateTimeUtils.cs b/mcs/class/corlib/System/DateTimeUtils.cs index d46f0a1f8be..febaf23e4af 100644 --- a/mcs/class/corlib/System/DateTimeUtils.cs +++ b/mcs/class/corlib/System/DateTimeUtils.cs @@ -190,6 +190,7 @@ namespace System { dfi = inv; int i = 0; + bool saw_day_specifier = false; while (i < format.Length) { int tokLen; @@ -320,6 +321,7 @@ namespace System { else result.Append (dfi.GetDayName (dfi.Calendar.GetDayOfWeek (dt))); + saw_day_specifier = true; break; case 'M': // Month.m(m?) = month # (with leading 0 if two mm) @@ -331,8 +333,11 @@ namespace System { DateTimeUtils.ZeroPad (result, month, tokLen); else if (tokLen == 3) result.Append (dfi.GetAbbreviatedMonthName (month)); - else - result.Append (dfi.GetMonthName (month)); + else { + // NOTE: .NET ignores quoted 'd' and reads it as day specifier but I think + // that's wrong + result.Append (saw_day_specifier ? dfi.GetMonthGenitiveName (month) : dfi.GetMonthName (month)); + } break; case 'y': diff --git a/mcs/class/corlib/System/Decimal.cs b/mcs/class/corlib/System/Decimal.cs index a5952f3ba98..6aecb441dbc 100644 --- a/mcs/class/corlib/System/Decimal.cs +++ b/mcs/class/corlib/System/Decimal.cs @@ -766,6 +766,11 @@ namespace System string decimalSep = (hasCurrency) ? nfi.CurrencyDecimalSeparator : nfi.NumberDecimalSeparator; string groupSep = (hasCurrency) ? nfi.CurrencyGroupSeparator : nfi.NumberGroupSeparator; + string negativeSign = nfi.NegativeSign; + string positiveSign = nfi.PositiveSign; + + // If we don't have a group separator defined, it has the same effect as if it wasn't allowed. + if (string.IsNullOrEmpty(groupSep)) allowedThousands = false; int pos = 0; int len = s.Length; @@ -791,20 +796,20 @@ namespace System isNegative = true; pos++; } - else if (allowedLeadingSign && ch == nfi.NegativeSign[0] && !hasSign) + else if (allowedLeadingSign && !string.IsNullOrEmpty (negativeSign) && ch == negativeSign[0] && !hasSign) { - int slen = nfi.NegativeSign.Length; - if (slen == 1 || s.IndexOf (nfi.NegativeSign, pos, slen) == pos) + int slen = negativeSign.Length; + if (slen == 1 || s.IndexOf (negativeSign, pos, slen) == pos) { hasSign = true; isNegative = true; pos += slen; } } - else if (allowedLeadingSign && ch == nfi.PositiveSign[0] && !hasSign) + else if (allowedLeadingSign && !string.IsNullOrEmpty (positiveSign) && ch == positiveSign[0] && !hasSign) { - int slen = nfi.PositiveSign.Length; - if (slen == 1 || s.IndexOf (nfi.PositiveSign, pos, slen) == pos) + int slen = positiveSign.Length; + if (slen == 1 || s.IndexOf (positiveSign, pos, slen) == pos) { hasSign = true; pos += slen; @@ -891,10 +896,10 @@ namespace System } ch = s[pos]; bool isNegativeExp = false; - if (ch == nfi.PositiveSign[0]) + if (!string.IsNullOrEmpty (positiveSign) && ch == positiveSign[0]) { - int slen = nfi.PositiveSign.Length; - if (slen == 1 || s.IndexOf (nfi.PositiveSign, pos, slen) == pos) + int slen = positiveSign.Length; + if (slen == 1 || s.IndexOf (positiveSign, pos, slen) == pos) { pos += slen; if (pos >= len) { @@ -905,10 +910,10 @@ namespace System } } } - else if (ch == nfi.NegativeSign[0]) + else if (!string.IsNullOrEmpty (negativeSign) && ch == negativeSign[0]) { - int slen = nfi.NegativeSign.Length; - if (slen == 1 || s.IndexOf (nfi.NegativeSign, pos, slen) == pos) + int slen = negativeSign.Length; + if (slen == 1 || s.IndexOf (negativeSign, pos, slen) == pos) { pos += slen; if (pos >= len) { @@ -953,20 +958,20 @@ namespace System hasOpeningParentheses = false; pos++; } - else if (allowedTrailingSign && ch == nfi.NegativeSign[0] && !hasSign) + else if (allowedTrailingSign && !string.IsNullOrWhiteSpace (negativeSign) && ch == negativeSign[0] && !hasSign) { - int slen = nfi.NegativeSign.Length; - if (slen == 1 || s.IndexOf (nfi.NegativeSign, pos, slen) == pos) + int slen = negativeSign.Length; + if (slen == 1 || s.IndexOf(negativeSign, pos, slen) == pos) { hasSign = true; isNegative = true; pos += slen; } } - else if (allowedTrailingSign && ch == nfi.PositiveSign[0] && !hasSign) + else if (allowedTrailingSign && !string.IsNullOrWhiteSpace (positiveSign) && ch == positiveSign[0] && !hasSign) { - int slen = nfi.PositiveSign.Length; - if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos) + int slen = positiveSign.Length; + if (slen == 1 || s.IndexOf (positiveSign, pos, slen) == pos) { hasSign = true; pos += slen; diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index 66925c6cb96..cfb8fdf171d 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -487,7 +487,7 @@ namespace System return a; if (a.GetType () != b.GetType ()) - throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types.")); + throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types. First is {0} second is {1}.", a.GetType ().FullName, b.GetType ().FullName)); return a.CombineImpl (b); } diff --git a/mcs/class/corlib/System/Environment.cs b/mcs/class/corlib/System/Environment.cs index 585e4d09ff9..301df431e21 100644 --- a/mcs/class/corlib/System/Environment.cs +++ b/mcs/class/corlib/System/Environment.cs @@ -39,6 +39,7 @@ using System.Security; using System.Security.Permissions; using System.Text; using System.Runtime.InteropServices; +using System.Threading; namespace System { @@ -55,7 +56,7 @@ namespace System { * of icalls, do not require an increment. */ #pragma warning disable 169 - private const int mono_corlib_version = 100; + private const int mono_corlib_version = 101; #pragma warning restore 169 [ComVisible (true)] @@ -168,6 +169,14 @@ namespace System { Directory.SetCurrentDirectory (value); } } + +#if NET_4_5 + public static int CurrentManagedThreadId { + get { + return Thread.CurrentThread.ManagedThreadId; + } + } +#endif /// /// Gets or sets the exit code of this process diff --git a/mcs/class/corlib/System/Exception.cs b/mcs/class/corlib/System/Exception.cs index 9eb0f83cd98..cb5e7fea0d1 100644 --- a/mcs/class/corlib/System/Exception.cs +++ b/mcs/class/corlib/System/Exception.cs @@ -114,11 +114,17 @@ namespace System set { help_link = value; } } +#if NET_4_5 + public int HResult { + get { return hresult; } + protected set { hresult = value; } + } +#else protected int HResult { get { return hresult; } set { hresult = value; } } - +#endif internal void SetMessage (string s) { message = s; diff --git a/mcs/class/corlib/System/Guid.cs b/mcs/class/corlib/System/Guid.cs index 15562c3743b..6427c28e75a 100644 --- a/mcs/class/corlib/System/Guid.cs +++ b/mcs/class/corlib/System/Guid.cs @@ -5,9 +5,11 @@ // Duco Fijma (duco@lorentz.xs4all.nl) // Sebastien Pouliot (sebastien@ximian.com) // Jb Evain (jbevain@novell.com) +// Marek Safar (marek.safar@gmail.com) // // (C) 2002 Duco Fijma // Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) +// Copyright 2012 Xamarin, Inc (http://www.xamarin.com) // // References // 1. UUIDs and GUIDs (DRAFT), Section 3.4 @@ -93,7 +95,7 @@ namespace System { get { return _cur >= _length; } } - static bool HasHyphen (Format format) + public static bool HasHyphen (Format format) { switch (format) { case Format.D: @@ -372,12 +374,7 @@ namespace System { private static int Compare (int x, int y) { - if (x < y) { - return -1; - } - else { - return 1; - } + return ((uint)x < (uint)y) ? -1 : 1; } public int CompareTo (object value) @@ -405,34 +402,34 @@ namespace System { if (_a != value._a) { return Compare (_a, value._a); } - else if (_b != value._b) { + if (_b != value._b) { return Compare (_b, value._b); } - else if (_c != value._c) { + if (_c != value._c) { return Compare (_c, value._c); } - else if (_d != value._d) { + if (_d != value._d) { return Compare (_d, value._d); } - else if (_e != value._e) { + if (_e != value._e) { return Compare (_e, value._e); } - else if (_f != value._f) { + if (_f != value._f) { return Compare (_f, value._f); } - else if (_g != value._g) { + if (_g != value._g) { return Compare (_g, value._g); } - else if (_h != value._h) { + if (_h != value._h) { return Compare (_h, value._h); } - else if (_i != value._i) { + if (_i != value._i) { return Compare (_i, value._i); } - else if (_j != value._j) { + if (_j != value._j) { return Compare (_j, value._j); } - else if (_k != value._k) { + if (_k != value._k) { return Compare (_k, value._k); } return 0; @@ -573,48 +570,95 @@ namespace System { builder.Append (ToHex (value & 0xf)); } - private string BaseToString (bool h, bool p, bool b) + string ToString (Format format) { - StringBuilder res = new StringBuilder (40); + 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 (p) { + if (format == Format.P) { res.Append ('('); - } else if (b) { + } else if (format == Format.B) { res.Append ('{'); + } else if (format == Format.X) { + res.Append ('{').Append ('0').Append ('x'); } AppendInt (res, _a); - if (h) { + if (has_hyphen) { res.Append ('-'); + } else if (format == Format.X) { + res.Append (',').Append ('0').Append ('x'); } + AppendShort (res, _b); - if (h) { + if (has_hyphen) { res.Append ('-'); + } else if (format == Format.X) { + res.Append (',').Append ('0').Append ('x'); } + AppendShort (res, _c); - if (h) { + if (has_hyphen) { res.Append ('-'); } - AppendByte (res, _d); - AppendByte (res, _e); - - if (h) { - res.Append ('-'); - } - - AppendByte (res, _f); - AppendByte (res, _g); - AppendByte (res, _h); - AppendByte (res, _i); - AppendByte (res, _j); - AppendByte (res, _k); - + 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 (p) { - res.Append (')'); - } else if (b) { - res.Append ('}'); + if (format == Format.P) { + res.Append (')'); + } else if (format == Format.B) { + res.Append ('}'); + } } return res.ToString (); @@ -622,36 +666,15 @@ namespace System { public override string ToString () { - return BaseToString (true, false, false); + return ToString (Format.D); } public string ToString (string format) { - bool h = true; - bool p = false; - bool b = false; - - if (format != null) { - string f = format.ToLowerInvariant(); - - if (f == "b") { - b = true; - } - else if (f == "p") { - p = true; - } - else if (f == "n") { - h = false; - } - else if (f != "d" && f != String.Empty) { - throw new FormatException (Locale.GetText ( - "Argument to Guid.ToString(string format) should be \"b\", \"B\", \"d\", \"D\", \"n\", \"N\", \"p\" or \"P\"")); - } - } - - return BaseToString (h, p, b); + return ToString (ParseFormat (format)); } + // provider value is never used public string ToString (string format, IFormatProvider provider) { return ToString (format); @@ -705,27 +728,40 @@ namespace System { var parser = new GuidParser (input); return parser.Parse (ParseFormat (format), out result); } +#endif static Format ParseFormat (string format) { - if (format.Length != 1) - throw new ArgumentException ("Wrong 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; +#if NET_4_0 || MOONLIGHT || MOBILE case 'X': + case 'x': return Format.X; +#endif } - throw new ArgumentException ("Wrong format"); - } + throw new FormatException ( +#if NET_4_0 || MOONLIGHT || MOBILE + "Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\", \"b\", \"X\" or \"x\"" +#else + "Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\" or \"b\"" #endif + ); + } } } diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs index ba4d348eaba..fe8be265118 100644 --- a/mcs/class/corlib/System/MulticastDelegate.cs +++ b/mcs/class/corlib/System/MulticastDelegate.cs @@ -146,7 +146,7 @@ namespace System MulticastDelegate combined, orig, clone; if (this.GetType() != follow.GetType ()) - throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types.")); + throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types. First is {0} second is {1}.", this.GetType ().FullName, follow.GetType ().FullName)); combined = (MulticastDelegate)follow.Clone (); combined.SetMulticastInvoke (); diff --git a/mcs/class/corlib/System/TimeZone.cs b/mcs/class/corlib/System/TimeZone.cs index cb7caeff3f8..e0203f9a65c 100644 --- a/mcs/class/corlib/System/TimeZone.cs +++ b/mcs/class/corlib/System/TimeZone.cs @@ -131,7 +131,7 @@ namespace System if (time.Kind == DateTimeKind.Local) return time; - TimeSpan utcOffset = GetUtcOffset (time); + TimeSpan utcOffset = GetUtcOffset (new DateTime (time.Ticks)); if (utcOffset.Ticks > 0) { if (DateTime.MaxValue - utcOffset < time) return DateTime.SpecifyKind (DateTime.MaxValue, DateTimeKind.Local); @@ -140,7 +140,7 @@ namespace System return DateTime.SpecifyKind (DateTime.MinValue, DateTimeKind.Local); } - DateTime local = time.Add (utcOffset); + DateTime local = DateTime.SpecifyKind (time.Add (utcOffset), DateTimeKind.Local); DaylightTime dlt = GetDaylightChanges (time.Year); if (dlt.Delta.Ticks == 0) return DateTime.SpecifyKind (local, DateTimeKind.Local); @@ -354,6 +354,9 @@ namespace System public override TimeSpan GetUtcOffset (DateTime time) { + if (time.Kind == DateTimeKind.Utc) + return TimeSpan.Zero; + if (IsDaylightSavingTime (time)) return utcOffsetWithDLS; diff --git a/mcs/class/corlib/System/Type.cs b/mcs/class/corlib/System/Type.cs index 55e7d07727b..b27ffae5dc6 100644 --- a/mcs/class/corlib/System/Type.cs +++ b/mcs/class/corlib/System/Type.cs @@ -221,6 +221,14 @@ namespace System { return IsCOMObjectImpl (); } } + +#if NET_4_5 + public virtual bool IsConstructedGenericType { + get { + throw new NotImplementedException (); + } + } +#endif public bool IsContextful { get { @@ -1357,6 +1365,14 @@ namespace System { return _impl.Value != IntPtr.Zero; } } + +#if NET_4_5 + public virtual Type[] GenericTypeArguments { + get { + return IsGenericType ? GetGenericArguments () : EmptyTypes; + } + } +#endif public virtual Type[] GetGenericArguments () { @@ -1384,7 +1400,7 @@ namespace System { [MethodImplAttribute(MethodImplOptions.InternalCall)] get; } - + [MethodImplAttribute(MethodImplOptions.InternalCall)] static extern Type MakeGenericType (Type gt, Type [] types); diff --git a/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs b/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs index 93a4bc8928c..a2c030c0c92 100644 --- a/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs +++ b/mcs/class/corlib/Test/Microsoft.Win32/RegistryKeyTest.cs @@ -3209,6 +3209,7 @@ namespace MonoTests.Microsoft.Win32 createdKey.SetValue ("test-ulong", (ulong) 1, RegistryValueKind.DWord); createdKey.SetValue ("test-decimal", (decimal) 1, RegistryValueKind.DWord); createdKey.SetValue ("test-float", (float) 1, RegistryValueKind.DWord); + createdKey.SetValue ("test-bool", true, RegistryValueKind.DWord); createdKey.SetValue ("dtest-int", (int) 1, RegistryValueKind.QWord); createdKey.SetValue ("dtest-uint", (uint) 1, RegistryValueKind.QWord); @@ -3220,6 +3221,7 @@ namespace MonoTests.Microsoft.Win32 createdKey.SetValue ("dtest-ulong", (ulong) 1, RegistryValueKind.QWord); createdKey.SetValue ("dtest-decimal", (decimal) 1, RegistryValueKind.QWord); createdKey.SetValue ("dtest-float", (float) 1, RegistryValueKind.QWord); + createdKey.SetValue ("dtest-bool", true, RegistryValueKind.QWord); object r = createdKey.GetValue ("test-int"); Assert.AreEqual (r is int, true); @@ -3277,6 +3279,8 @@ namespace MonoTests.Microsoft.Win32 r = createdKey.GetValue ("dtest-float"); Assert.IsTrue (r is long); Assert.AreEqual ((long) r, 1); + r = createdKey.GetValue ("dtest-bool"); + Assert.AreEqual (typeof (long), r.GetType ()); try { createdKey.SetValue ("test-int", uint.MaxValue, RegistryValueKind.DWord); diff --git a/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentStackTests.cs b/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentStackTests.cs index 91d5c35cef0..f4808192d03 100644 --- a/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentStackTests.cs +++ b/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentStackTests.cs @@ -189,6 +189,76 @@ namespace MonoTests.System.Collections.Concurrent } Assert.IsTrue(s == "9876543210", "#1 : " + s); } + + [Test] + public void TryPopRangeTest () + { + int[] values = new int[3]; + Assert.AreEqual (3, stack.TryPopRange (values)); + CollectionAssert.AreEquivalent (new int[] { 9, 8, 7 }, values); + Assert.AreEqual (10 - values.Length, stack.Count); + for (int i = 9 - values.Length; i >= 0; i--) { + int outValue; + Assert.IsTrue (stack.TryPop (out outValue)); + Assert.AreEqual (i, outValue); + } + } + + [Test] + public void TryPopRangeTestWithOneElement () + { + int[] values = new int[1]; + Assert.AreEqual (1, stack.TryPopRange (values)); + CollectionAssert.AreEquivalent (new int[] { 9 }, values); + Assert.AreEqual (10 - values.Length, stack.Count); + for (int i = 9 - values.Length; i >= 0; i--) { + int outValue; + Assert.IsTrue (stack.TryPop (out outValue)); + Assert.AreEqual (i, outValue); + } + } + + [Test] + public void TryPopRangeFullTest () + { + int[] values = new int[10]; + Assert.AreEqual (10, stack.TryPopRange (values)); + CollectionAssert.AreEquivalent (Enumerable.Range (0, 10).Reverse ().ToArray (), values); + Assert.AreEqual (0, stack.Count); + } + + [Test] + public void TryPopRangePartialFillTest () + { + int[] values = new int[5]; + Assert.AreEqual (2, stack.TryPopRange (values, 3, 2)); + CollectionAssert.AreEquivalent (new int[] { 0, 0, 0, 9, 8 }, values); + Assert.AreEqual (8, stack.Count); + } + + [Test, ExpectedException (typeof (ArgumentOutOfRangeException))] + public void TryPopRange_NegativeIndex () + { + stack.TryPopRange (new int[3], -2, 3); + } + + [Test, ExpectedException (typeof (ArgumentOutOfRangeException))] + public void TryPopRange_LargeIndex () + { + stack.TryPopRange (new int[3], 200, 3); + } + + [Test, ExpectedException (typeof (ArgumentException))] + public void TryPopRange_LargeCount () + { + stack.TryPopRange (new int[3], 2, 5); + } + + [Test, ExpectedException (typeof (ArgumentNullException))] + public void TryPopRange_NullArray () + { + stack.TryPopRange (null); + } } } #endif diff --git a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs b/mcs/class/corlib/Test/System.Collections/SortedListTest.cs index 9c570daab68..a160d80863b 100644 --- a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs +++ b/mcs/class/corlib/Test/System.Collections/SortedListTest.cs @@ -186,11 +186,7 @@ namespace MonoTests.System.Collections SortedList list = new SortedList (1000); list.Capacity = new_capacity; -#if NET_1_1 Assert.AreEqual (new_capacity, list.Capacity); -#else - Assert.AreEqual (16, list.Capacity); -#endif } [Test] @@ -199,9 +195,6 @@ namespace MonoTests.System.Collections SortedList list = new SortedList (42); Assert.AreEqual (42, list.Capacity, "#1"); list.Capacity = 0; -#if !NET_2_0 // no such expectation as it is broken in .NET 2.0 - Assert.AreEqual (16, list.Capacity, "#2"); -#endif } [Test] diff --git a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs index 900ecc2d137..98f0ab65033 100644 --- a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs @@ -146,6 +146,46 @@ namespace MonoTests.System.Globalization } } + [Test] + public void CreateSpecificCulture () + { + var ci = CultureInfo.CreateSpecificCulture ("en"); + Assert.AreEqual ("en-US", ci.Name, "#1"); + + ci = CultureInfo.CreateSpecificCulture ("en-GB"); + Assert.AreEqual ("en-GB", ci.Name, "#2"); + + ci = CultureInfo.CreateSpecificCulture ("en-----"); + Assert.AreEqual ("en-US", ci.Name, "#3"); + + ci = CultureInfo.CreateSpecificCulture ("en-GB-"); + Assert.AreEqual ("en-US", ci.Name, "#4"); + + ci = CultureInfo.CreateSpecificCulture (""); + Assert.AreEqual (CultureInfo.InvariantCulture, ci, "#5"); + } + + [Test] + public void CreateSpecificCulture_Invalid () + { + try { + CultureInfo.CreateSpecificCulture ("uy32"); + Assert.Fail ("#1"); +#if NET_4_0 + } catch (CultureNotFoundException) { +#else + } catch (ArgumentException) { +#endif + } + + try { + CultureInfo.CreateSpecificCulture (null); + Assert.Fail ("#2"); + } catch (ArgumentNullException) { + // .NET throws NRE which is lame + } + } + [Test] public void DateTimeFormat_Neutral_Culture () { @@ -205,6 +245,18 @@ namespace MonoTests.System.Globalization Assert.IsTrue (culture.Equals (cultureClone)); } + [Test] + public void IsNeutral () + { + var ci = new CultureInfo (0x6C1A); + Assert.IsTrue (ci.IsNeutralCulture, "#1"); + Assert.AreEqual ("srp", ci.ThreeLetterISOLanguageName, "#2"); + + ci = new CultureInfo ("en-US"); + Assert.IsFalse (ci.IsNeutralCulture, "#1a"); + Assert.AreEqual ("eng", ci.ThreeLetterISOLanguageName, "#2a"); + } + [Test] // bug #81930 public void IsReadOnly () { @@ -340,7 +392,6 @@ namespace MonoTests.System.Globalization } } -#if NET_2_0 [Test] [Category ("NotDotNet")] // On MS, the NumberFormatInfo of the CultureInfo matching the current locale is not read-only public void GetCultureInfo_Identifier () @@ -438,7 +489,6 @@ namespace MonoTests.System.Globalization Assert.AreEqual ("name", ex.ParamName, "#6"); } } -#endif [Test] public void UseUserOverride_CurrentCulture () @@ -462,7 +512,6 @@ namespace MonoTests.System.Globalization Assert.AreEqual (expected, ci.UseUserOverride, "#2"); } -#if NET_2_0 [Test] public void UseUserOverride_GetCultureInfo () { @@ -476,21 +525,16 @@ namespace MonoTests.System.Globalization Assert.IsFalse (culture.UseUserOverride, "#2: " + cultureMsg); } } -#endif [Test] public void UseUserOverride_GetCultures () { foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.AllCultures)) { string cultureMsg = String.Format ("{0} {1}", ci.LCID, ci.Name); -#if NET_2_0 if (ci.LCID == CultureInfo.InvariantCulture.LCID) Assert.IsFalse (ci.UseUserOverride, cultureMsg); else Assert.IsTrue (ci.UseUserOverride, cultureMsg); -#else - Assert.IsTrue (ci.UseUserOverride, cultureMsg); -#endif } } @@ -519,9 +563,7 @@ namespace MonoTests.System.Globalization public void ZhHant () { Assert.AreEqual (31748, new CultureInfo ("zh-Hant").LCID); -#if NET_2_0 Assert.AreEqual (31748, CultureInfo.GetCultureInfo ("zh-Hant").LCID); -#endif } } } diff --git a/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs index 1258f15c9a9..0c6a8e247cb 100644 --- a/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/DateTimeFormatInfoTest.cs @@ -116,6 +116,13 @@ namespace MonoTests.System.Globalization Assert.AreEqual ("Jan", DateTimeFormatInfo.InvariantInfo.AbbreviatedMonthGenitiveNames[0], "#3"); } + [Test] + public void MonthGenitiveNames () + { + var dfi = new CultureInfo ("cs-CZ").DateTimeFormat; + Assert.AreEqual ("ledna", dfi.MonthGenitiveNames[0], "#1"); + } + #if !TARGET_JVM [Test] public void Bug78569 () diff --git a/mcs/class/corlib/Test/System.Globalization/RegionInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/RegionInfoTest.cs index dd44a01a33a..4c6104ca173 100644 --- a/mcs/class/corlib/Test/System.Globalization/RegionInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/RegionInfoTest.cs @@ -42,13 +42,15 @@ namespace MonoTests.System.Globalization } catch (ArgumentException) { } } + + try { + new RegionInfo ("2342#"); + Assert.Fail ("#2"); + } catch (ArgumentException) { + } } [Test] -#if NET_2_0 -#else - [ExpectedException (typeof (ArgumentException))] -#endif public void RegionByLocaleName () { string [] names = new string [] { @@ -73,5 +75,13 @@ namespace MonoTests.System.Globalization Assert.IsTrue (hk.ThreeLetterISORegionName.Length <= 3, "ThreeLetterISORegionName"); Assert.IsTrue (hk.ThreeLetterWindowsRegionName.Length <= 3, "ThreeLetterWindowsRegionName"); } + + [Test] + public void Equals () + { + var a = new RegionInfo (0x414); + var b = new RegionInfo (0x43B); + Assert.AreEqual (a, b); + } } } \ No newline at end of file diff --git a/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs index 301bcd296b3..5113cc5e981 100644 --- a/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/TextInfoTest.cs @@ -86,13 +86,11 @@ public class TextInfoTest { Assert.AreEqual (t1.ListSeparator, t2.ListSeparator, "ListSeparator"); Assert.AreEqual (t1.MacCodePage, t2.MacCodePage, "MacCodePage"); Assert.AreEqual (t1.OEMCodePage, t2.OEMCodePage, "OEMCodePage"); -#if NET_2_0 Assert.AreEqual (t1.CultureName, t2.CultureName, "CultureName"); if (compareReadOnly) Assert.AreEqual (t1.IsReadOnly, t2.IsReadOnly, "IsReadOnly"); //FIXME Assert.AreEqual (t1.IsRightToLeft, t2.IsRightToLeft, "IsRightToLeft"); Assert.AreEqual (t1.LCID, t2.LCID, "LCID"); -#endif } [Test] @@ -109,7 +107,6 @@ public class TextInfoTest { CompareProperties (enus, clone, true); } -#if NET_2_0 [Test] public void Clone () { @@ -148,6 +145,7 @@ public class TextInfoTest { case 13: // he case 32: // ur case 41: // fa + case 0x63: // ps case 90: // syr case 101: // div case 1025: // ar-SA @@ -171,6 +169,7 @@ public class TextInfoTest { case 14337: // ar-AE case 15361: // ar-BH case 16385: // ar-QA + case 0x463: // ps-AF Assert.IsTrue (ci.TextInfo.IsRightToLeft, ci.Name); break; default: @@ -179,7 +178,6 @@ public class TextInfoTest { } } } -#endif [Test] public void Deserialization () diff --git a/mcs/class/corlib/Test/System.IO.IsolatedStorage/IsolatedStorageFileTest.cs b/mcs/class/corlib/Test/System.IO.IsolatedStorage/IsolatedStorageFileTest.cs index 224e3058d40..10bf9bf1367 100644 --- a/mcs/class/corlib/Test/System.IO.IsolatedStorage/IsolatedStorageFileTest.cs +++ b/mcs/class/corlib/Test/System.IO.IsolatedStorage/IsolatedStorageFileTest.cs @@ -1119,5 +1119,25 @@ namespace MonoTests.System.IO.IsolatedStorageTest { } } #endif + [Test] + public void RootedDirectory () + { + IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly (); + try { + isf.CreateDirectory ("test/nested/directory/structure/without/root"); + isf.CreateDirectory ("/test/nested/directory/structure/with/root"); + } + finally { + isf.DeleteDirectory ("test/nested/directory/structure/without/root"); + isf.DeleteDirectory ("test/nested/directory/structure/without"); + + isf.DeleteDirectory ("/test/nested/directory/structure/with/root"); + isf.DeleteDirectory ("/test/nested/directory/structure/with"); + isf.DeleteDirectory ("/test/nested/directory/structure"); + isf.DeleteDirectory ("/test/nested/directory"); + isf.DeleteDirectory ("/test/nested"); + isf.DeleteDirectory ("/test"); + } + } } } diff --git a/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs b/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs index 40b4ef8758a..5d221a4d7b0 100644 --- a/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs +++ b/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs @@ -16,7 +16,17 @@ namespace MonoTests.System.IO { [TestFixture] public class BinaryWriterTest { - + sealed class MyBinaryWriter : BinaryWriter + { + public MyBinaryWriter (Stream stream) + : base (stream) + { } + + public void WriteLeb128 (int value) + { + base.Write7BitEncodedInt (value); + } + } string TempFolder = Path.Combine (Path.GetTempPath (), "MonoTests.System.IO.Tests"); @@ -512,6 +522,52 @@ public class BinaryWriterTest { Assert.AreEqual (0, bytes [9], "test#11"); } + [Test] + public void Write7BitEncodedIntTest () + { + MemoryStream stream = new MemoryStream (); + var writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (5); + + Assert.AreEqual (new byte[] { 5 }, stream.ToArray (), "#1"); + + stream = new MemoryStream (); + writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (int.MaxValue); + + Assert.AreEqual (new byte[] { 255, 255, 255, 255, 7 }, stream.ToArray (), "#2"); + + stream = new MemoryStream (); + writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (128); + + Assert.AreEqual (new byte[] { 128, 1 }, stream.ToArray (), "#3"); + + stream = new MemoryStream (); + writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (-1025); + + Assert.AreEqual (new byte[] { 255, 247, 255, 255, 15 }, stream.ToArray (), "#4"); + + stream = new MemoryStream (); + writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (int.MinValue); + + Assert.AreEqual (new byte[] { 128, 128, 128, 128, 8 }, stream.ToArray (), "#5"); + + stream = new MemoryStream (); + writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (-1); + + Assert.AreEqual (new byte[] { 255, 255, 255, 255, 15 }, stream.ToArray (), "#6"); + + stream = new MemoryStream (); + writer = new MyBinaryWriter (stream); + writer.WriteLeb128 (0); + + Assert.AreEqual (new byte[] { 0 }, stream.ToArray (), "#7"); + } + [Test] public void BaseStreamCallsFlush () { diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/AssemblyBuilderTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/AssemblyBuilderTest.cs index a2d68e2c186..6f681d67129 100644 --- a/mcs/class/corlib/Test/System.Reflection.Emit/AssemblyBuilderTest.cs +++ b/mcs/class/corlib/Test/System.Reflection.Emit/AssemblyBuilderTest.cs @@ -276,14 +276,12 @@ public class AssemblyBuilderTest Assert.IsNull (ab.GetDynamicModule ("FOO4")); } -#if NET_1_1 [Test] public void TestImageRuntimeVersion () { string version = ab.ImageRuntimeVersion; Assert.IsTrue (version.Length > 0); } -#endif [Test] public void TestAddResourceFile_Name_Null () diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs index 0a2e4123cd0..271412269c0 100644 --- a/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs +++ b/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs @@ -2,6 +2,7 @@ // DynamicMethodTest.cs - NUnit Test Cases for the DynamicMethod class // // Gert Driesen (drieseng@users.sourceforge.net) +// Konrad Kruczynski // // (C) 2006 Novell @@ -121,6 +122,28 @@ namespace MonoTests.System.Reflection.Emit } } + [Test] + public void OwnerCantBeArray () + { + TestOwner (typeof (int[])); + } + + [Test] + public void OwnerCantBeInterface () + { + TestOwner (typeof (global::System.Collections.IEnumerable)); + } + + private void TestOwner (Type owner) + { + try { + new DynamicMethod ("Name", MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, + typeof(void), new Type[] { }, owner, true); + Assert.Fail (string.Format ("Created dynamic method with owner being {0}.", owner)); + } catch (ArgumentException) { + } + } + [Test] // bug #78253 public void DynamicMethodReference () { diff --git a/mcs/class/corlib/Test/System.Reflection/AssemblyCas.cs b/mcs/class/corlib/Test/System.Reflection/AssemblyCas.cs index 57be788ba27..31114c46313 100644 --- a/mcs/class/corlib/Test/System.Reflection/AssemblyCas.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyCas.cs @@ -104,10 +104,6 @@ namespace MonoCasTests.System.Reflection { public void PartialTrust_PermitOnly_ControlEvidenceFileIOPermission () { at.Corlib_test (); -#if NET_2_0 -#elif NET_1_1 - at.Corlib (); -#endif } [Test] diff --git a/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs b/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs index b410b4f827b..f0df88a89d3 100644 --- a/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs @@ -192,7 +192,6 @@ namespace MonoTests.System.Reflection // corlib doesn't reference anything Assert.AreEqual (0, corlib.GetReferencedAssemblies ().Length, "GetReferencedAssemblies"); -#if NET_2_0 Assert.AreEqual ("mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", corlib.FullName, "FullName"); // not really "true" but it's even more trusted so... Assert.IsTrue (corlib.GlobalAssemblyCache, "GlobalAssemblyCache"); @@ -200,11 +199,6 @@ namespace MonoTests.System.Reflection Assert.AreEqual ("v2.0.50727", corlib.ImageRuntimeVersion, "ImageRuntimeVersion"); Assert.IsFalse (corlib.ReflectionOnly, "ReflectionOnly"); Assert.AreEqual (0x1, corlib.ManifestModule.MetadataToken); -#elif NET_1_1 - Assert.IsFalse (corlib.GlobalAssemblyCache, "GlobalAssemblyCache"); - Assert.AreEqual ("mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", corlib.FullName, "FullName"); - Assert.AreEqual ("v1.1.4322", corlib.ImageRuntimeVersion, "ImageRuntimeVersion"); -#endif } [Test] diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/ConditionalWeakTableTest.cs b/mcs/class/corlib/Test/System.Runtime.CompilerServices/ConditionalWeakTableTest.cs index 2e80f7f3841..f4869bc6d35 100644 --- a/mcs/class/corlib/Test/System.Runtime.CompilerServices/ConditionalWeakTableTest.cs +++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/ConditionalWeakTableTest.cs @@ -52,8 +52,20 @@ namespace MonoTests.System.Runtime.CompilerServices { } } - class Key { public int Foo; } - class Val { public int Foo; } + class Key { + public int Foo; + public override string ToString () { + return "key-" + Foo; + } + } + + class Val { + public int Foo; + public override string ToString () { + return "value-" + Foo; + } + } + [Test] public void GetValue () { @@ -448,7 +460,7 @@ namespace MonoTests.System.Runtime.CompilerServices { public void OldGenKeysMakeNewGenObjectsReachable () { if (GC.MaxGeneration == 0) /*Boehm doesn't handle ephemerons */ - return; + return; ConditionalWeakTable table = new ConditionalWeakTable(); List keys = new List(); @@ -457,21 +469,21 @@ namespace MonoTests.System.Runtime.CompilerServices { // should be collected ever. // for (int x = 0; x < 1000; x++) - keys.Add(new Key() { Foo = x }); + keys.Add (new Key () { Foo = x }); - for (int i = 0; i < 10000; ++i) { + for (int i = 0; i < 1000; ++i) { // Insert all keys into the ConditionalWeakTable foreach (var key in keys) - table.Add(key, new Val() { Foo = key.Foo }); + table.Add (key, new Val () { Foo = key.Foo }); // Look up all keys to verify that they are still there Val val; foreach (var key in keys) - Assert.IsTrue (table.TryGetValue(key, out val), "#1-" + i); + Assert.IsTrue (table.TryGetValue (key, out val), "#1-" + i + "-k-" + key); // Remove all keys from the ConditionalWeakTable foreach (var key in keys) - Assert.IsTrue (!table.Remove(key), "#2-" + i); + Assert.IsTrue (table.Remove (key), "#2-" + i + "-k-" + key); } } } diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs b/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs index e7e91990b99..fc4010bd21c 100644 --- a/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs +++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs @@ -153,7 +153,6 @@ namespace MonoTests.System.Runtime.CompilerServices { RuntimeHelpers.InitializeArray (new Fielder ().array, rfh); } -#if NET_1_1 public void TestGetHashCode () { Assert.AreEqual (0, RuntimeHelpers.GetHashCode (null)); @@ -182,6 +181,5 @@ namespace MonoTests.System.Runtime.CompilerServices { Assert.IsTrue (RuntimeHelpers.Equals (o1, o3)); Assert.IsTrue (!RuntimeHelpers.Equals (o1, o4)); } -#endif } } diff --git a/mcs/class/corlib/Test/System.Runtime.Remoting/RemotingConfigurationTest.cs b/mcs/class/corlib/Test/System.Runtime.Remoting/RemotingConfigurationTest.cs index 8845862403b..ed92feba359 100644 --- a/mcs/class/corlib/Test/System.Runtime.Remoting/RemotingConfigurationTest.cs +++ b/mcs/class/corlib/Test/System.Runtime.Remoting/RemotingConfigurationTest.cs @@ -6,9 +6,7 @@ // using System; -#if NET_1_1 - using System.Net.Sockets; -#endif +using System.Net.Sockets; using System.Reflection; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; @@ -190,11 +188,7 @@ namespace MonoTests.System.Runtime.Remoting // tests the CAO related methods [Test] -#if NET_1_1 [ExpectedException(typeof(SocketException))] -#else - [ExpectedException(typeof(RemotingException))] -#endif public void RegisterActivatedType() { TcpChannel chn = null; diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/BinarySerializationOverVersions.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/BinarySerializationOverVersions.cs index 861d88787a4..5743f92c8b7 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/BinarySerializationOverVersions.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/BinarySerializationOverVersions.cs @@ -10,71 +10,11 @@ using NUnit.Framework; namespace MonoTests.System.Runtime.Serialization.Formatters.Binary { - [TestFixture] - public class BinarySerializationOverVersions { - - static readonly string dirName = typeof(VersionTolerantSerializationTestLib.Address).Namespace; - static readonly string assemblyName = typeof(VersionTolerantSerializationTestLib.Address).Name; - static readonly string assemblyFileName = assemblyName + ".dll"; - static readonly string binName = Path.GetFileName (Assembly.GetExecutingAssembly ().Location); - const bool cleanup = true; - enum OopOperation { Serialize, Deserialize } - static IFormatter formatter = new BinaryFormatter (); - - //TODO: add tests that use SoapFormatter (if you go this // path, it would be interesting also to test a // custom formatter, like the XML-RPC.net one!) - public virtual IFormatter Formatter { get { return formatter; } } - - static void Main (string [] args) - { - var p = new BinarySerializationOverVersions (); - - /* this block is useful for testing this without NUnit: - if (args.Length == 0) - { - Console.WriteLine ("Starting..."); - p.TestDroppedField (); - Console.Write ("x"); - p.TestAddedField (); - Console.Write ("x"); - - p.TestAddedFieldWithData (); - Console.Write ("x"); - p.TestDroppedFieldWithData (); - Console.Write ("x"); - - p.TestAddedFieldWithOptionalAttrib (); - Console.Write ("x"); - p.TestDroppedFieldWithOptionalAttrib (); - Console.Write ("x"); - - p.TestAddedFieldWithOptionalAttribAndData (); - Console.Write ("x"); - p.TestDroppedFieldWithOptionalAttribAndData (); - Console.Write ("x"); - - Console.WriteLine (); - Environment.Exit (0); - }*/ - - if (args.Length < 2) - throw new Exception ("Please specify arguments"); - - if (args [0] == OopOperation.Serialize.ToString ()) - { - p.SerializeToFile (args [1]); - } - else if (args [0] == OopOperation.Deserialize.ToString ()) - { - p.DeserializeFromFile (args [1]); - } - else - { - throw new Exception(String.Format ("{0} operation not recognized. Only {Serialize|Deserialize} operations are supported.", args [0])); - } - } + [TestFixture] + public class BinarySerializationOverVersions { [Test] public void TestDroppedField () //eliminate CountryCode @@ -136,69 +76,57 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Binary Deserialize ("6.0", Serialize ("5.0")); } - private static string Serialize (string assemblyVersion) - { - return SerializeOOP (SetEnvironment (assemblyVersion)); ; - } - - private static void Deserialize (string assemblyVersion, string filename) - { - DeserializeOOP (SetEnvironment (assemblyVersion), filename); - } + const string AssemblyName = "Address.dll"; + const string TypeName = "VersionTolerantSerializationTestLib.Address"; - private static string SerializeOOP (string executionDir) - { - string filename = Path.GetTempFileName (); - var p = new Process (); - p.StartInfo.WorkingDirectory = executionDir; - p.StartInfo.FileName = Path.Combine (executionDir, binName); - p.StartInfo.Arguments = OopOperation.Serialize.ToString () + " \"" + filename + "\""; - p.StartInfo.UseShellExecute = false; - p.Start(); - p.WaitForExit(); - if (p.ExitCode != 0) - throw new Exception ("Problem in serialization operation"); + class Serializer : MarshalByRefObject { + static IFormatter formatter = new BinaryFormatter (); + public static IFormatter Formatter { get { return formatter; } } - if (cleanup) - Directory.Delete (executionDir, true); + public byte[] Serialize (string version) { + var assembly = Assembly.LoadFrom (Find (version)); + var type = assembly.GetType (TypeName); + var obj = Activator.CreateInstance (type); + var stream = new MemoryStream (); + + Formatter.Serialize (stream, obj); + return stream.ToArray (); + } - return filename; + public void Deserialize (string version, byte[] payload) { + var assembly = Assembly.LoadFrom (Find (version)); + var stream = new MemoryStream (payload); + var obj = Formatter.Deserialize (stream); + //Console.WriteLine ("obj version {0} -> {1}", version, obj); + } } - private static void DeserializeOOP (string executionDir, string filename) + private static byte[] Serialize (string assemblyVersion) { - var p = new Process (); - p.StartInfo.WorkingDirectory = executionDir; - p.StartInfo.FileName = Path.Combine (executionDir, binName); - p.StartInfo.Arguments = OopOperation.Deserialize.ToString () + " \"" + filename + "\""; - p.StartInfo.UseShellExecute = false; - p.Start (); - p.WaitForExit (); - if (p.ExitCode != 0) - throw new Exception("Problem in deserialization operation"); - - if (cleanup) - { - Directory.Delete (executionDir, true); - File.Delete (filename); - } + var setup = new AppDomainSetup (); + setup.ApplicationBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + AppDomain ad = AppDomain.CreateDomain (assemblyVersion, null, setup); + Serializer ser = (Serializer) ad.CreateInstanceAndUnwrap (typeof(Serializer).Assembly.FullName, typeof(Serializer).FullName); + byte[] stuff = ser.Serialize (assemblyVersion); + AppDomain.Unload (ad); + return stuff; } - private static string SetEnvironment (string assemblyVersion) + private static void Deserialize (string assemblyVersion, byte[] payload) { - if (!assemblyVersion.Contains (".")) - throw new NotSupportedException ("The version number should contain a dot, i.e.: 2.0"); - - string tmpDir = Path.Combine (Path.GetTempPath (), "deleteme" + Guid.NewGuid ()); - Directory.CreateDirectory (tmpDir); - string currentBin = Assembly.GetExecutingAssembly ().Location; - File.Copy (currentBin, Path.Combine (tmpDir, Path.GetFileName (currentBin))); + var setup = new AppDomainSetup (); + setup.ApplicationBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + AppDomain ad = AppDomain.CreateDomain (assemblyVersion, null, setup); + Serializer ser = (Serializer) ad.CreateInstanceAndUnwrap (typeof(Serializer).Assembly.FullName, typeof(Serializer).FullName); + ser.Deserialize (assemblyVersion, payload); + AppDomain.Unload (ad); + } - string ass = Find (assemblyVersion); - File.Copy (ass, Path.Combine (tmpDir, Path.GetFileName (ass))); - return tmpDir; + static void Main () { + throw new Exception (); } + private static string Find (string assemblyVersion) { string initDir = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location); @@ -207,77 +135,7 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Binary private static string Find (string assemblyVersion, string path) { - return Path.Combine (Path.Combine (path, assemblyVersion), assemblyFileName); -/* - Console.WriteLine ("Looking in " + path); - string test; - - if (!path.Contains(assemblyVersion)) - { - //outside or here - - if (Path.GetFileName(path) == dirName) - { - test = Path.Combine (path, assemblyVersion); - if (Directory.Exists (test)) - return Find (assemblyVersion, test); - else - throw new DirectoryNotFoundException (String.Format ("{0} was not found", test)); - } - - test = Path.Combine (path, dirName); - if (Directory.Exists (test)) - return Find (assemblyVersion, test); - - return Find (assemblyVersion, Path.Combine (path, "..")); - } - else - { - //inside - test = Path.Combine (path, assemblyFileName); - if (File.Exists (test)) - return test; - - test = Path.Combine (path, "bin"); - if (Directory.Exists (test)) - return Find (assemblyVersion, test); - - test = Path.Combine (path, "Debug"); - if (Directory.Exists (test)) - return Find (assemblyVersion, test); - - test = Path.Combine (path, "Release"); - if (Directory.Exists (test)) - return Find (assemblyVersion, test); - - test = Path.Combine (path.Replace ("Debug", "Release"), assemblyFileName); - if (File.Exists (test)) - return test; - - throw new NotSupportedException( - String.Format( - "The tree is not predictible according to the philosophy of the test. (Stuck in {0})", - path)); - } -*/ - } - - private void SerializeToFile (string filename) - { - var type = typeof (VersionTolerantSerializationTestLib.Address); - object obj = Activator.CreateInstance (type); - Stream stream = new FileStream (filename, - FileMode.OpenOrCreate, FileAccess.Write, FileShare.None); - Formatter.Serialize (stream, obj); - stream.Dispose (); - } - - private void DeserializeFromFile (string filename) - { - //Console.WriteLine("Trying to deserialize {0}...", filename); - FileStream readStream = new FileStream (filename, FileMode.Open); - //var readData = - Formatter.Deserialize (readStream); + return Path.Combine (Path.Combine (path, assemblyVersion), AssemblyName); } } } diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/1.0/Address.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/1.0/Address.cs index bc81c432352..4e845edc538 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/1.0/Address.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/1.0/Address.cs @@ -5,8 +5,12 @@ namespace VersionTolerantSerializationTestLib [Serializable] public class Address { - private string Street; - private string City; - private string Country = "Cuba"; + private string Street = "v1-street"; + private string City = "v1-city"; + private string Country = "v1-country"; + + public override string ToString () { + return String.Format ("v1 obj {0} {1} {2}", Street, City, Country); + } } } diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/2.0/Address.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/2.0/Address.cs index 24f2036ebaf..0dee701dded 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/2.0/Address.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/2.0/Address.cs @@ -5,7 +5,11 @@ namespace VersionTolerantSerializationTestLib [Serializable] public class Address { - private string Street; - private string City; + private string Street = "v2-Street"; + private string City = "v2-City"; + + public override string ToString () { + return String.Format ("v2 obj {0} {1}", Street, City); + } } } diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/3.0/Address.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/3.0/Address.cs index db02d7a618b..18e5261cdd3 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/3.0/Address.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/3.0/Address.cs @@ -5,8 +5,12 @@ namespace VersionTolerantSerializationTestLib [Serializable] public class Address { - private string Street; - private string City; - private string CountryCode; + private string Street = "v3-Street"; + private string City = "v3-City"; + private string CountryCode = "v3-CountryCode"; + + public override string ToString () { + return String.Format ("v3 obj {0} {1} {2}", Street, City, CountryCode); + } } } diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/4.0/Address.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/4.0/Address.cs index 5ec38efd711..0cfca57553c 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/4.0/Address.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/4.0/Address.cs @@ -6,11 +6,16 @@ namespace VersionTolerantSerializationTestLib [Serializable] public class Address { - private string Street; - private string City; - private string CountryCode; + private string Street = "v4-Street"; + private string City = "v4-City"; + private string CountryCode = "v4-CountryCode"; [OptionalField (VersionAdded = 4)] private string PostCode; + + public override string ToString () { + return String.Format ("v4 obj {0} {1} {2}", Street, City, CountryCode); + } + } } diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/5.0/Address.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/5.0/Address.cs index 3f71d69f5dd..02c849ea91d 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/5.0/Address.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/5.0/Address.cs @@ -6,14 +6,19 @@ namespace VersionTolerantSerializationTestLib [Serializable] public class Address { - private string Street; - private string City; - private string CountryCode; + private string Street = "v5-Street"; + private string City = "v5-City"; + private string CountryCode = "v5-CountryCode"; [OptionalField (VersionAdded = 4)] private string PostCode; [OptionalField (VersionAdded = 5)] - private string AreaCode = "0"; + private string AreaCode = "5"; + + public override string ToString () { + return String.Format ("v5 obj {0} {1} {2}", Street, City, CountryCode); + } + } } diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/6.0/Address.cs b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/6.0/Address.cs index 6b568a900b3..5c36e770998 100644 --- a/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/6.0/Address.cs +++ b/mcs/class/corlib/Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/6.0/Address.cs @@ -6,17 +6,22 @@ namespace VersionTolerantSerializationTestLib [Serializable] public class Address { - private string Street; - private string City; - private string CountryCode; + private string Street = "v6-Street"; + private string City = "v6-City"; + private string CountryCode = "v6-CountryCode"; [OptionalField (VersionAdded = 4)] private string PostCode; [OptionalField (VersionAdded = 5)] - private string AreaCode = "0"; + private string AreaCode = "6"; [OptionalField (VersionAdded = 6)] - private int Id = 0; + private int Id = 6; + + public override string ToString () { + return String.Format ("v6 obj {0} {1} {2}", Street, City, CountryCode); + } + } } diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/DESTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/DESTest.cs index db5dc018bf0..b10cbf36934 100644 --- a/mcs/class/corlib/Test/System.Security.Cryptography/DESTest.cs +++ b/mcs/class/corlib/Test/System.Security.Cryptography/DESTest.cs @@ -4274,7 +4274,7 @@ namespace MonoTests.System.Security.Cryptography { // Note: they are to be called from specifics implementations - // not for the abstract DES. Thats why they are in a separate class // which doesn't have a [TestFixture] attribute - public class DESFIPS81Test { + public abstract class DESFIPS81Test { protected DES des; // Table B1 - ECB Mode diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/RIPEMD160Test.cs b/mcs/class/corlib/Test/System.Security.Cryptography/RIPEMD160Test.cs index e3d455bfe43..1707e49d919 100644 --- a/mcs/class/corlib/Test/System.Security.Cryptography/RIPEMD160Test.cs +++ b/mcs/class/corlib/Test/System.Security.Cryptography/RIPEMD160Test.cs @@ -40,7 +40,7 @@ namespace MonoTests.System.Security.Cryptography { // RIPEMD160 is a abstract class - so ALL of the test included here wont be tested // on the abstract class but should be tested in ALL its descendants. - public class RIPEMD160Test { + public abstract class RIPEMD160Test { protected RIPEMD160 hash; diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/RSACryptoServiceProviderTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/RSACryptoServiceProviderTest.cs index e3186127c9d..91b39eb832c 100644 --- a/mcs/class/corlib/Test/System.Security.Cryptography/RSACryptoServiceProviderTest.cs +++ b/mcs/class/corlib/Test/System.Security.Cryptography/RSACryptoServiceProviderTest.cs @@ -1049,7 +1049,6 @@ public class RSACryptoServiceProviderTest { Assert.IsTrue ((original != newKeyPair), "Key Pair Deleted"); } -#if NET_1_1 [Test] public void UseMachineKeyStore_Default () { @@ -1086,7 +1085,6 @@ public class RSACryptoServiceProviderTest { catch (UnauthorizedAccessException) { } } -#endif [Test] public void PKCS1 () @@ -1296,6 +1294,74 @@ public class RSACryptoServiceProviderTest { Assert.AreEqual (blob [i], keypair [i], i.ToString ()); } + [Test] + public void ImportCspBlob_Signature_Keypair () + { + // from bug #5299 + byte[] blob = new byte [] { + 0x07, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, + 0x32, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0xCB, 0xF3, + 0xF0, 0x0C, 0xD7, 0xC1, 0xA8, 0x06, 0x1A, 0xF5, 0x49, 0x4E, 0x7A, + 0x02, 0x4A, 0x46, 0xB2, 0x8F, 0xE0, 0x01, 0x5C, 0x89, 0x01, 0x2D, + 0x42, 0x5A, 0xEA, 0x16, 0x11, 0x66, 0x48, 0x26, 0x29, 0xAE, 0x2A, + 0xAA, 0xD4, 0x3C, 0x27, 0xF6, 0x48, 0x0E, 0x09, 0x25, 0xD0, 0x63, + 0x80, 0x74, 0xDA, 0x1B, 0x57, 0x1D, 0x62, 0x83, 0xB9, 0x58, 0x5D, + 0x09, 0x4D, 0x0B, 0x1F, 0x3F, 0xC8, 0xB8, 0x99, 0x3B, 0x9A, 0x57, + 0x16, 0x18, 0xE8, 0x73, 0x2F, 0x34, 0x96, 0x5C, 0xE6, 0x8F, 0x1E, + 0xF8, 0x46, 0x4A, 0x90, 0x16, 0x3F, 0x40, 0x18, 0x53, 0x62, 0x7F, + 0x24, 0xB2, 0x3A, 0xFB, 0xA2, 0x80, 0x39, 0x1C, 0x08, 0x6D, 0xFC, + 0x6B, 0xCA, 0x0A, 0x14, 0xDD, 0xA9, 0x41, 0x57, 0x25, 0x49, 0x3A, + 0x27, 0x9C, 0x25, 0xC4, 0x5E, 0xC5, 0x7B, 0x83, 0x1B, 0x9D, 0xDF, + 0x03, 0x24, 0x94, 0x5D, 0x90, 0xD5, 0xEC, 0x7B, 0xD5, 0xCF, 0x66, + 0x3D, 0x93, 0x63, 0xD5, 0x1A, 0x9A, 0x9B, 0x46, 0x78, 0x89, 0xD1, + 0xC3, 0x38, 0x9A, 0x69, 0x61, 0xFE, 0xA2, 0x0C, 0xD9, 0x73, 0x81, + 0x11, 0x28, 0x71, 0x06, 0x69, 0x3D, 0x1A, 0x4E, 0xF4, 0x9D, 0x8A, + 0x5C, 0x9A, 0x2F, 0x71, 0x9F, 0x2B, 0x9F, 0xE6, 0xB1, 0xBF, 0x4E, + 0x8C, 0xFA, 0x93, 0x04, 0x29, 0xD2, 0x4A, 0x73, 0x85, 0x7A, 0x91, + 0x8D, 0x19, 0xCA, 0x1F, 0x2E, 0x5D, 0xD1, 0xAD, 0x70, 0xB5, 0x64, + 0x69, 0x5B, 0x09, 0x84, 0x35, 0xB1, 0x31, 0x15, 0x40, 0x6C, 0x0D, + 0x31, 0xF3, 0xEA, 0xE4, 0xD7, 0x6D, 0x42, 0xD0, 0xBB, 0x84, 0xDB, + 0x73, 0x10, 0x16, 0x0B, 0xDC, 0xE2, 0x62, 0x32, 0xEB, 0x23, 0x19, + 0x38, 0x64, 0x6A, 0x3D, 0x5E, 0x65, 0xAD, 0x7B, 0xEC, 0xB6, 0xC0, + 0x00, 0x4A, 0x4F, 0x98, 0x35, 0xF3, 0xD7, 0x73, 0xD3, 0x31, 0xDE, + 0xB6, 0x85, 0xDA, 0x4C, 0x3D, 0x79, 0x5A, 0x96, 0x07, 0x63, 0x70, + 0x34, 0x45, 0xF4, 0x78, 0x25, 0x78, 0x92, 0x3C, 0x56, 0x38, 0xF9, + 0xFA, 0x0D, 0xF4, 0x00, 0xD3, 0xD7, 0xBB, 0xA3, 0x97, 0xB4, 0x26, + 0xEB, 0x25, 0xA3, 0x1E, 0x34, 0xFC, 0x0E, 0x7F, 0x6A, 0x12, 0x25, + 0x25, 0x50, 0x26, 0x8D, 0x10, 0x80, 0xC7, 0xEB, 0x4B, 0x4B, 0x74, + 0x09, 0x89, 0x2F, 0xBB, 0x03, 0x02, 0x17, 0xFD, 0x13, 0x71, 0x33, + 0xB4, 0x46, 0x49, 0xDD, 0xBE, 0x34, 0x01, 0x37, 0xC3, 0x63, 0x4D, + 0xBE, 0x76, 0xAD, 0x62, 0x11, 0x6C, 0xDD, 0x64, 0x47, 0x73, 0x95, + 0x92, 0x58, 0xBF, 0xFF, 0xE3, 0x20, 0xD2, 0xB1, 0xEC, 0xA8, 0x03, + 0xB8, 0xA7, 0x0E, 0xA5, 0xAE, 0xAF, 0x47, 0x45, 0xED, 0x5F, 0xE1, + 0x0B, 0xA8, 0xA3, 0x03, 0xB7, 0x93, 0xA6, 0xD8, 0xAC, 0x71, 0xAB, + 0x77, 0x8B, 0xEC, 0x6F, 0x16, 0x0E, 0x1A, 0x2B, 0x2D, 0x31, 0xBD, + 0x69, 0xD4, 0x9E, 0x9E, 0x0F, 0xA2, 0xED, 0x94, 0x59, 0x1D, 0x61, + 0x0E, 0xE5, 0xD3, 0x19, 0x2B, 0xAD, 0x70, 0x90, 0xAF, 0x51, 0x7F, + 0x56, 0x53, 0xC2, 0x86, 0xB4, 0x24, 0xBC, 0xD0, 0x63, 0xAC, 0x4B, + 0xE0, 0xE0, 0x6C, 0xF5, 0xF6, 0x21, 0x7D, 0xE9, 0x7C, 0x45, 0x13, + 0xE7, 0x87, 0x11, 0x09, 0xCC, 0xA6, 0xB1, 0xCD, 0x49, 0x10, 0x33, + 0xBC, 0x07, 0xC8, 0x56, 0xA9, 0x19, 0xC1, 0x86, 0xDF, 0x63, 0xDF, + 0xE6, 0x6D, 0xFB, 0x46, 0x31, 0x93, 0x36, 0x3C, 0x8E, 0x6E, 0xB0, + 0xC7, 0x66, 0xFC, 0x6C, 0x85, 0x5B, 0xF4, 0xEE, 0x1D, 0x3B, 0xE3, + 0x8B, 0xF5, 0xB9, 0x88, 0x48, 0x2F, 0x77, 0x56, 0x82, 0x85, 0x7C, + 0xF9, 0xE9, 0x15, 0xA5, 0x8E, 0x46, 0xEA, 0x08, 0xB9, 0xD0, 0x8F, + 0x0F, 0x28, 0x1C, 0x96, 0xA1, 0xB3, 0x00, 0x6E, 0x9B, 0x81, 0xBD, + 0xD4, 0x54, 0xA4, 0xFD, 0xD5, 0xA7, 0x4B, 0x2E, 0x17, 0x10, 0xED, + 0xD2, 0xAA, 0x38, 0x2E, 0x24, 0x7C, 0x59, 0xF4, 0x2D, 0x08, 0x3B, + 0x15, 0x05, 0x6A, 0xD8, 0x61, 0x8A, 0xAC, 0xCD, 0x5E, 0x77, 0x4C, + 0x8E, 0x0C, 0xEE, 0xD8, 0xEF, 0xD0, 0xBC, 0x1B, 0x14, 0x17, 0xE3, + 0x38, 0x27, 0xA1, 0x70, 0x5B, 0x5C, 0xC3, 0xE3, 0x91, 0x1E, 0x01, + 0xE3, 0x9A, 0x16, 0x1A, 0x5C, 0x4D, 0xD9, 0x3B, 0x36, 0x7F, 0x0B, + 0x93, 0x16 + }; + rsa = new RSACryptoServiceProvider (); + rsa.ImportCspBlob (blob); + + byte[] keypair = rsa.ExportCspBlob (false); + Assert.AreEqual (keypair [5], blob [5], "0x24 signature"); + } + [Test] public void ExportCspBlob_PublicKey () { diff --git a/mcs/class/corlib/Test/System.Security.Permissions/EnvironmentPermissionAttributeTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/EnvironmentPermissionAttributeTest.cs index 8ae3e4119a2..133501dd341 100644 --- a/mcs/class/corlib/Test/System.Security.Permissions/EnvironmentPermissionAttributeTest.cs +++ b/mcs/class/corlib/Test/System.Security.Permissions/EnvironmentPermissionAttributeTest.cs @@ -101,7 +101,6 @@ namespace MonoTests.System.Security.Permissions { Assert.AreEqual (envar, p.GetPathList (EnvironmentPermissionAccess.Read), "All=EnvironmentPermission-Read"); Assert.AreEqual (envar, p.GetPathList (EnvironmentPermissionAccess.Write), "All=EnvironmentPermission-Write"); } -#if NET_1_1 [Test] [ExpectedException (typeof (NotSupportedException))] public void All_Get () @@ -109,7 +108,7 @@ namespace MonoTests.System.Security.Permissions { EnvironmentPermissionAttribute attr = new EnvironmentPermissionAttribute (SecurityAction.Assert); string s = attr.All; } -#endif + [Test] public void Read () { diff --git a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionAttributeTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionAttributeTest.cs index 8b54433ea0b..ba7470e5cd6 100644 --- a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionAttributeTest.cs +++ b/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionAttributeTest.cs @@ -118,7 +118,7 @@ namespace MonoTests.System.Security.Permissions { Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Read) [0], "All=FileIOPermissionAttribute-Read"); Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Write) [0], "All=FileIOPermissionAttribute-Write"); } -#if NET_1_1 + [Test] [ExpectedException (typeof (NotSupportedException))] public void All_Get () @@ -126,7 +126,7 @@ namespace MonoTests.System.Security.Permissions { FileIOPermissionAttribute attr = new FileIOPermissionAttribute (SecurityAction.Assert); string s = attr.All; } -#endif + [Test] public void Append () { diff --git a/mcs/class/corlib/Test/System.Security.Permissions/SecurityPermissionTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/SecurityPermissionTest.cs index e8c51a54373..7a4e5644f99 100644 --- a/mcs/class/corlib/Test/System.Security.Permissions/SecurityPermissionTest.cs +++ b/mcs/class/corlib/Test/System.Security.Permissions/SecurityPermissionTest.cs @@ -42,9 +42,7 @@ namespace MonoTests.System.Security.Permissions { static SecurityPermissionFlag [] AllFlags = { SecurityPermissionFlag.AllFlags, SecurityPermissionFlag.Assertion, -#if NET_1_1 SecurityPermissionFlag.BindingRedirects, -#endif SecurityPermissionFlag.ControlAppDomain, SecurityPermissionFlag.ControlDomainPolicy, SecurityPermissionFlag.ControlEvidence, @@ -62,9 +60,7 @@ namespace MonoTests.System.Security.Permissions { static SecurityPermissionFlag [] AllFlagsExceptNoFlags = { SecurityPermissionFlag.AllFlags, SecurityPermissionFlag.Assertion, -#if NET_1_1 SecurityPermissionFlag.BindingRedirects, -#endif SecurityPermissionFlag.ControlAppDomain, SecurityPermissionFlag.ControlDomainPolicy, SecurityPermissionFlag.ControlEvidence, @@ -80,9 +76,7 @@ namespace MonoTests.System.Security.Permissions { static SecurityPermissionFlag [] AllFlagsExceptAllFlags = { SecurityPermissionFlag.Assertion, -#if NET_1_1 SecurityPermissionFlag.BindingRedirects, -#endif SecurityPermissionFlag.ControlAppDomain, SecurityPermissionFlag.ControlDomainPolicy, SecurityPermissionFlag.ControlEvidence, diff --git a/mcs/class/corlib/Test/System.Security.Permissions/StrongNamePublicKeyBlobTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/StrongNamePublicKeyBlobTest.cs index 3e07132ba76..22b8355d1f1 100644 --- a/mcs/class/corlib/Test/System.Security.Permissions/StrongNamePublicKeyBlobTest.cs +++ b/mcs/class/corlib/Test/System.Security.Permissions/StrongNamePublicKeyBlobTest.cs @@ -71,18 +71,20 @@ public class StrongNamePublicKeyBlobTest { // non standard get hash code - why ??? Assert.AreEqual (snpkb2.GetHashCode (), snpkb.GetHashCode (), "GetHashCode-0"); -#if NET_2_0 + // the first 4 bytes has code has been fixed in 2.0 beta 1 -#elif NET_1_1 - // It seems to be the first four bytes of the public key data - // which seems like non sense as all valid public key will have the same header ? - Assert.AreEqual (2359296, snpkb.GetHashCode (), "GetHashCode-1"); - Assert.AreEqual (2359296, snpkb2.GetHashCode (), "GetHashCode-2"); - Assert.AreEqual (2989, snpkb3.GetHashCode (), "GetHashCode-3"); - byte[] header = { 0x00, 0x24, 0x00, 0x00 }; - StrongNamePublicKeyBlob snpkb4 = new StrongNamePublicKeyBlob (header); - Assert.AreEqual (2359296, snpkb4.GetHashCode (), "GetHashCode-4"); -#endif + +// Historical data: +// #elif NET_1_1 +// // It seems to be the first four bytes of the public key data +// // which seems like non sense as all valid public key will have the same header ? +// Assert.AreEqual (2359296, snpkb.GetHashCode (), "GetHashCode-1"); +// Assert.AreEqual (2359296, snpkb2.GetHashCode (), "GetHashCode-2"); +// Assert.AreEqual (2989, snpkb3.GetHashCode (), "GetHashCode-3"); +// byte[] header = { 0x00, 0x24, 0x00, 0x00 }; +// StrongNamePublicKeyBlob snpkb4 = new StrongNamePublicKeyBlob (header); +// Assert.AreEqual (2359296, snpkb4.GetHashCode (), "GetHashCode-4"); +// #endif } } diff --git a/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs b/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs index 69ad39fd694..4c84824c912 100644 --- a/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs +++ b/mcs/class/corlib/Test/System.Security.Principal/WindowsIdentityTest.cs @@ -180,10 +180,8 @@ namespace MonoTests.System.Security.Principal { IDeserializationCallback dc = (id as IDeserializationCallback); Assert.IsNotNull (dc, "IDeserializationCallback"); -#if NET_1_1 ISerializable s = (id as ISerializable); Assert.IsNotNull (s, "ISerializable"); -#endif } // This is clearly a hack - but I've seen it too many times so I think we diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs new file mode 100644 index 00000000000..ebcab0e9019 --- /dev/null +++ b/mcs/class/corlib/Test/System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs @@ -0,0 +1,180 @@ +// +// ConcurrentExclusiveSchedulerPairTest.cs +// +// Author: +// Jérémie "garuma" Laval +// +// Copyright (c) 2011 Jérémie "garuma" Laval +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if NET_4_5 + +using System; +using System.Threading; +using System.Threading.Tasks; + +using NUnit.Framework; + +namespace MonoTests.System.Threading.Tasks +{ + [TestFixture] + [Ignore ("Not implemented yet")] + public class ConcurrentExclusiveSchedulerPairTest + { + ConcurrentExclusiveSchedulerPair schedPair; + TaskFactory factory; + + [Test] + public void BasicExclusiveUsageTest () + { + schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); + factory = new TaskFactory (schedPair.ExclusiveScheduler); + + bool launched = false; + factory.StartNew (() => launched = true); + Thread.Sleep (600); + + Assert.IsTrue (launched); + } + + [Test] + public void BasicConcurrentUsageTest () + { + schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); + factory = new TaskFactory (schedPair.ConcurrentScheduler); + + bool launched = false; + factory.StartNew (() => launched = true); + Thread.Sleep (600); + + Assert.IsTrue (launched); + } + + [Test] + public void ExclusiveUsageTest () + { + schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); + factory = new TaskFactory (schedPair.ExclusiveScheduler); + + int count = 0; + ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); + ManualResetEventSlim mreStart = new ManualResetEventSlim (false); + + factory.StartNew (() => { + mreStart.Set (); + Interlocked.Increment (ref count); + mreFinish.Wait (); + }); + mreStart.Wait (); + factory.StartNew (() => Interlocked.Increment (ref count)); + Thread.Sleep (100); + + Assert.AreEqual (1, count); + mreFinish.Set (); + } + + [Test] + public void ConcurrentUsageTest () + { + schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); + factory = new TaskFactory (schedPair.ConcurrentScheduler); + + int count = 0; + ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); + CountdownEvent cntd = new CountdownEvent (2); + + factory.StartNew (() => { + Interlocked.Increment (ref count); + cntd.Signal (); + mreFinish.Wait (); + }); + factory.StartNew (() => { + Interlocked.Increment (ref count); + cntd.Signal (); + mreFinish.Wait (); + }); + + cntd.Wait (); + Assert.AreEqual (2, count); + mreFinish.Set (); + } + + [Test] + public void ConcurrentUsageWithExclusiveExecutingTest () + { + schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); + TaskFactory exclFact = new TaskFactory (schedPair.ExclusiveScheduler); + TaskFactory concFact = new TaskFactory (schedPair.ConcurrentScheduler); + + int count = 0; + bool exclStarted = false; + ManualResetEventSlim mreStart = new ManualResetEventSlim (false); + ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); + + exclFact.StartNew (() => { + exclStarted = true; + mreStart.Set (); + mreFinish.Wait (); + exclStarted = false; + }); + + mreStart.Wait (); + + concFact.StartNew (() => Interlocked.Increment (ref count)); + concFact.StartNew (() => Interlocked.Increment (ref count)); + Thread.Sleep (100); + + Assert.IsTrue (exclStarted); + Assert.AreEqual (0, count); + mreFinish.Set (); + } + + [Test] + public void ExclusiveUsageWithConcurrentExecutingTest () + { + schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4); + TaskFactory exclFact = new TaskFactory (schedPair.ExclusiveScheduler); + TaskFactory concFact = new TaskFactory (schedPair.ConcurrentScheduler); + + int count = 0; + bool started = false; + ManualResetEventSlim mreStart = new ManualResetEventSlim (false); + ManualResetEventSlim mreFinish = new ManualResetEventSlim (false); + + concFact.StartNew (() => { + started = true; + mreStart.Set (); + mreFinish.Wait (); + started = false; + }); + + mreStart.Wait (); + + exclFact.StartNew (() => Interlocked.Increment (ref count)); + Thread.Sleep (100); + + Assert.IsTrue (started); + Assert.AreEqual (0, count); + mreFinish.Set (); + } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs index 95a19c46e03..02b3b44b77d 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs @@ -1,7 +1,11 @@ // // TaskTest.cs // +// Authors: +// Marek Safar +// // Copyright (c) 2008 Jérémie "Garuma" Laval +// Copyright (C) 2011 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 @@ -28,7 +32,7 @@ using System; using System.Threading; using System.Threading.Tasks; - +using System.Collections.Generic; using NUnit.Framework; namespace MonoTests.System.Threading.Tasks @@ -36,6 +40,30 @@ namespace MonoTests.System.Threading.Tasks [TestFixture] public class TaskTests { + class MockScheduler : TaskScheduler + { + public event Action TryExecuteTaskInlineHandler; + + protected override IEnumerable GetScheduledTasks () + { + throw new NotImplementedException (); + } + + protected override void QueueTask (Task task) + { + return; + } + + protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued) + { + if (TryExecuteTaskInlineHandler != null) + TryExecuteTaskInlineHandler (task, taskWasPreviouslyQueued); + + return base.TryExecuteTask (task); + } + } + + Task[] tasks; const int max = 6; @@ -303,6 +331,15 @@ namespace MonoTests.System.Threading.Tasks Assert.IsTrue (tasks[0].IsCompleted, "#3"); Assert.IsTrue (tasks[1].IsCanceled, "#4"); } + + [Test] + public void WaitAll_CancelledAndTimeout () + { + var ct = new CancellationToken (true); + var t1 = new Task (() => {}, ct); + var t2 = Task.Delay (3000); + Assert.IsFalse (Task.WaitAll (new[] { t1, t2 }, 10)); + } [Test] public void WaitAllExceptionThenCancelled () @@ -384,6 +421,23 @@ namespace MonoTests.System.Threading.Tasks } } + [Test] + public void Wait_Inlined () + { + bool? previouslyQueued = null; + + var scheduler = new MockScheduler (); + scheduler.TryExecuteTaskInlineHandler += (task, b) => { + previouslyQueued = b; + }; + + var tf = new TaskFactory (scheduler); + var t = tf.StartNew (() => { }); + t.Wait (); + + Assert.AreEqual (true, previouslyQueued); + } + [Test, ExpectedException (typeof (InvalidOperationException))] public void CreationWhileInitiallyCanceled () { @@ -666,22 +720,21 @@ namespace MonoTests.System.Threading.Tasks public void DoubleWaitTest () { ParallelTestHelper.Repeat (delegate { - Console.WriteLine ("run"); var evt = new ManualResetEventSlim (); var t = Task.Factory.StartNew (() => evt.Wait (2000)); var cntd = new CountdownEvent (2); + var cntd2 = new CountdownEvent (2); bool r1 = false, r2 = false; - ThreadPool.QueueUserWorkItem (delegate { cntd.Signal (); r1 = t.Wait (1000); Console.WriteLine ("out 1 {0}", r1); cntd.Signal (); }); - ThreadPool.QueueUserWorkItem (delegate { cntd.Signal (); r2 = t.Wait (1000); Console.WriteLine ("out 2 {0}", r2); cntd.Signal (); }); + ThreadPool.QueueUserWorkItem (delegate { cntd.Signal (); r1 = t.Wait (1000) && t.Result; cntd2.Signal (); }); + ThreadPool.QueueUserWorkItem (delegate { cntd.Signal (); r2 = t.Wait (1000) && t.Result; cntd2.Signal (); }); - cntd.Wait (2000); - cntd.Reset (); + Assert.IsTrue (cntd.Wait (2000), "#1"); evt.Set (); - cntd.Wait (2000); - Assert.IsTrue (r1); - Assert.IsTrue (r2); - }, 5); + Assert.IsTrue (cntd2.Wait (2000), "#2"); + Assert.IsTrue (r1, "r1"); + Assert.IsTrue (r2, "r2"); + }, 10); } [Test] @@ -701,13 +754,27 @@ namespace MonoTests.System.Threading.Tasks } [Test] - public void ExecuteSynchronouslyTest () + public void RunSynchronously () { var val = 0; Task t = new Task (() => { Thread.Sleep (100); val = 1; }); t.RunSynchronously (); - Assert.AreEqual (1, val); + Assert.AreEqual (1, val, "#1"); + + t = new Task (() => { Thread.Sleep (0); val = 2; }); + + bool? previouslyQueued = null; + + var scheduler = new MockScheduler (); + scheduler.TryExecuteTaskInlineHandler += (task, b) => { + previouslyQueued = b; + }; + + t.RunSynchronously (scheduler); + + Assert.AreEqual (2, val, "#2"); + Assert.AreEqual (false, previouslyQueued, "#2a"); } [Test] diff --git a/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs b/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs index e683d33bf1c..55626334633 100644 --- a/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs +++ b/mcs/class/corlib/Test/System.Threading/CancellationTokenSourceTest.cs @@ -129,6 +129,25 @@ namespace MonoTests.System.Threading Assert.AreEqual (12, called, "#2"); } + + [Test] + public void CancelWithDispose () + { + CancellationTokenSource cts = new CancellationTokenSource (); + CancellationToken c = cts.Token; + c.Register (() => { + cts.Dispose (); + }); + + int called = 0; + c.Register (() => { + called++; + }); + + cts.Cancel (); + Assert.AreEqual (1, called, "#1"); + } + [Test] public void Cancel_SingleException () { @@ -172,6 +191,31 @@ namespace MonoTests.System.Threading cts.Cancel (); } + [Test] + public void Cancel_MultipleException_Recursive () + { + CancellationTokenSource cts = new CancellationTokenSource (); + CancellationToken c = cts.Token; + c.Register (() => { + cts.Cancel (); + }); + + c.Register (() => { + throw new ApplicationException (); + }); + + c.Register (() => { + throw new NotSupportedException (); + }); + + try { + cts.Cancel (false); + Assert.Fail ("#1"); + } catch (AggregateException e) { + Assert.AreEqual (2, e.InnerExceptions.Count, "#2"); + } + } + [Test] public void Cancel_MultipleExceptionsFirstThrows () { @@ -340,6 +384,17 @@ namespace MonoTests.System.Threading Assert.IsFalse (unregister); Assert.IsTrue (register); } + + [Test] + public void DisposeAfterRegistrationTest () + { + var source = new CancellationTokenSource (); + bool ran = false; + var req = source.Token.Register (() => ran = true); + source.Dispose (); + req.Dispose (); + Assert.IsFalse (ran); + } } } diff --git a/mcs/class/corlib/Test/System.Threading/ThreadTest.cs b/mcs/class/corlib/Test/System.Threading/ThreadTest.cs index 0603d278b71..db9cf7bf9f6 100644 --- a/mcs/class/corlib/Test/System.Threading/ThreadTest.cs +++ b/mcs/class/corlib/Test/System.Threading/ThreadTest.cs @@ -477,7 +477,6 @@ namespace MonoTests.System.Threading } [Test] - [Category ("NotDotNet")] // on MS, ThreadState is immediately Stopped after Abort public void TestIsBackground2 () { C2Test test1 = new C2Test(); @@ -488,7 +487,9 @@ namespace MonoTests.System.Threading } finally { TestThread.Abort(); } - Assert.IsTrue (TestThread.IsBackground, "#52 Is Background Changed to Start "); + + if (TestThread.IsAlive) + Assert.IsTrue (TestThread.IsBackground, "#52 Is Background Changed to Start "); } [Test] diff --git a/mcs/class/corlib/Test/System/ArraySegmentTest.cs b/mcs/class/corlib/Test/System/ArraySegmentTest.cs index 4da59275fdb..6a4d8ae78f9 100644 --- a/mcs/class/corlib/Test/System/ArraySegmentTest.cs +++ b/mcs/class/corlib/Test/System/ArraySegmentTest.cs @@ -3,164 +3,263 @@ // Ankit Jain // Raja R Harinath // Jensen Somers +// Marek Safar (marek.safar@gmail.com) // // Copyright (C) 2006 Novell, Inc (http://www.novell.com) +// Copyright (C) 2012 Xamarin, Inc (http://www.xamarin.com) // -#if NET_2_0 using NUnit.Framework; using System; using System.Collections.Generic; namespace MonoTests.System { + [TestFixture] + public class ArraySegmentTest + { + [Test] + public void CtorTest1 () + { + byte[] b_arr = new byte[4096]; + Array arr; -[TestFixture] -public class ArraySegmentTest -{ - public ArraySegmentTest() {} + ArraySegment seg = new ArraySegment (b_arr, 0, b_arr.Length); + Assert.AreEqual (seg.Count, b_arr.Length, "#1"); + Assert.AreEqual (seg.Offset, 0, "#2"); - [Test] - public void CtorTest1 () - { - byte [] b_arr = new byte [4096]; - Array arr; - - ArraySegment seg = new ArraySegment (b_arr, 0, b_arr.Length); - Assert.AreEqual (seg.Count, b_arr.Length, "#1"); - Assert.AreEqual (seg.Offset, 0, "#2"); - - arr = seg.Array; - Assert.AreEqual (arr.Length, 4096, "#5"); - - seg = new ArraySegment (b_arr, 100, b_arr.Length - 100); - Assert.AreEqual (seg.Count, b_arr.Length - 100, "#3"); - Assert.AreEqual (seg.Offset, 100, "#4"); - - arr = seg.Array; - Assert.AreEqual (arr.Length, 4096, "#5"); - } + arr = seg.Array; + Assert.AreEqual (arr.Length, 4096, "#5"); - [Test] - public void CtorTest2 () - { - byte [] b_arr = new byte [4096]; - ArraySegment seg = new ArraySegment (b_arr); - Assert.AreEqual (seg.Count, b_arr.Length, "#6"); - Assert.AreEqual (seg.Offset, 0, "#7"); - - Array arr = seg.Array; - Assert.AreEqual (arr.Length, 4096, "#8"); - } + seg = new ArraySegment (b_arr, 100, b_arr.Length - 100); + Assert.AreEqual (seg.Count, b_arr.Length - 100, "#3"); + Assert.AreEqual (seg.Offset, 100, "#4"); - [Test] - public void CtorTest3 () - { - EmptyArraySegTest (0); - EmptyArraySegTest (10); - } + arr = seg.Array; + Assert.AreEqual (arr.Length, 4096, "#5"); + } - private void EmptyArraySegTest (int len) - { - byte [] b_arr = new byte [len]; - - ArraySegment seg = new ArraySegment (b_arr, 0, b_arr.Length); - - Assert.AreEqual (seg.Count, b_arr.Length, "#1 [array len {0}] ", len); - Assert.AreEqual (seg.Offset, 0, "#2 [array len {0}] ", len); - Array arr = seg.Array; - Assert.AreEqual (arr.Length, len, "#3 [array len {0}] ", len); - - seg = new ArraySegment (b_arr, b_arr.Length, 0); - Assert.AreEqual (seg.Count, 0, "#4 [array len {0}] ", len); - Assert.AreEqual (seg.Offset, b_arr.Length, "#5 [array len {0}] ", len); - arr = seg.Array; - Assert.AreEqual (arr.Length, len, "#6 [array len {0}] ", len); - - seg = new ArraySegment (b_arr); - Assert.AreEqual (seg.Count, b_arr.Length, "#7 [array len {0}] ", len); - Assert.AreEqual (seg.Offset, 0, "#8 [array len {0}] ", len); - arr = seg.Array; - Assert.AreEqual (arr.Length, len, "#9 [array len {0}] ", len); - } + [Test] + public void CtorTest2 () + { + byte[] b_arr = new byte[4096]; + ArraySegment seg = new ArraySegment (b_arr); + Assert.AreEqual (seg.Count, b_arr.Length, "#6"); + Assert.AreEqual (seg.Offset, 0, "#7"); - [Test] - [ExpectedException (typeof (ArgumentException))] - public void CtorErrorTest () - { - byte [] arr = new byte [4096]; - ArraySegment seg = new ArraySegment (arr, 1, arr.Length); - } - - [Test] - [ExpectedException (typeof (ArgumentException))] - public void CtorErrorTest2 () - { - byte [] arr = new byte [4096]; - ArraySegment seg = new ArraySegment (arr, 0, arr.Length + 2); - } + Array arr = seg.Array; + Assert.AreEqual (arr.Length, 4096, "#8"); + } - [Test] - [ExpectedException (typeof (ArgumentOutOfRangeException))] - public void CtorErrorTest3 () - { - byte [] arr = new byte [4096]; - ArraySegment seg = new ArraySegment (arr, -1, arr.Length); - } + [Test] + public void CtorTest3 () + { + EmptyArraySegTest (0); + EmptyArraySegTest (10); + } - [Test] - [ExpectedException (typeof (ArgumentOutOfRangeException))] - public void CtorErrorTest4 () - { - byte [] arr = new byte [4096]; - ArraySegment seg = new ArraySegment (arr, 2, -1); - } + private void EmptyArraySegTest (int len) + { + byte[] b_arr = new byte[len]; - [Test] - [ExpectedException (typeof (ArgumentException))] - public void CtorErrorTest5 () - { - byte [] arr = new byte [4096]; - ArraySegment seg = new ArraySegment (arr, 0, arr.Length + 2); - } + ArraySegment seg = new ArraySegment (b_arr, 0, b_arr.Length); - [Test] - [ExpectedException (typeof (ArgumentNullException))] - public void CtorNullTest1 () - { - ArraySegment seg = new ArraySegment (null, 0 , 1); - } + Assert.AreEqual (seg.Count, b_arr.Length, "#1 [array len {0}] ", len); + Assert.AreEqual (seg.Offset, 0, "#2 [array len {0}] ", len); + Array arr = seg.Array; + Assert.AreEqual (arr.Length, len, "#3 [array len {0}] ", len); - [Test] - [ExpectedException (typeof (ArgumentNullException))] - public void CtorNullTest2 () - { - ArraySegment seg = new ArraySegment (null); - } + seg = new ArraySegment (b_arr, b_arr.Length, 0); + Assert.AreEqual (seg.Count, 0, "#4 [array len {0}] ", len); + Assert.AreEqual (seg.Offset, b_arr.Length, "#5 [array len {0}] ", len); + arr = seg.Array; + Assert.AreEqual (arr.Length, len, "#6 [array len {0}] ", len); -#pragma warning disable 1718 - [Test] - public void TestArraySegmentEqual () - { - string[] myArr_1 = { "The", "good" }; - string[] myArr_2 = { "The", "good" }; - - ArraySegment myArrSeg_1 = new ArraySegment(myArr_1); - ArraySegment myArrSeg_2 = new ArraySegment(myArr_2); - - // Should return true. - Assert.AreEqual(myArrSeg_1.Equals(myArrSeg_1), true); - Assert.AreEqual(myArrSeg_1 == myArrSeg_1, true); - - // Should return false. Allthough the strings are the same. - Assert.AreEqual(myArrSeg_1.Equals(myArrSeg_2), false); - Assert.AreEqual(myArrSeg_1 == myArrSeg_2, false); - - // Should return true. - Assert.AreEqual(myArrSeg_1 != myArrSeg_2, true); - } -#pragma warning restore 1718 -} + seg = new ArraySegment (b_arr); + Assert.AreEqual (seg.Count, b_arr.Length, "#7 [array len {0}] ", len); + Assert.AreEqual (seg.Offset, 0, "#8 [array len {0}] ", len); + arr = seg.Array; + Assert.AreEqual (arr.Length, len, "#9 [array len {0}] ", len); + } -} + [Test] + [ExpectedException (typeof (ArgumentException))] + public void CtorErrorTest () + { + byte[] arr = new byte[4096]; + ArraySegment seg = new ArraySegment (arr, 1, arr.Length); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void CtorErrorTest2 () + { + byte[] arr = new byte[4096]; + ArraySegment seg = new ArraySegment (arr, 0, arr.Length + 2); + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void CtorErrorTest3 () + { + byte[] arr = new byte[4096]; + ArraySegment seg = new ArraySegment (arr, -1, arr.Length); + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void CtorErrorTest4 () + { + byte[] arr = new byte[4096]; + ArraySegment seg = new ArraySegment (arr, 2, -1); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void CtorErrorTest5 () + { + byte[] arr = new byte[4096]; + ArraySegment seg = new ArraySegment (arr, 0, arr.Length + 2); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void CtorNullTest1 () + { + ArraySegment seg = new ArraySegment (null, 0, 1); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void CtorNullTest2 () + { + ArraySegment seg = new ArraySegment (null); + } + + [Test] + public void TestArraySegmentEqual () + { + string[] myArr_1 = { "The", "good" }; + string[] myArr_2 = { "The", "good" }; + + ArraySegment myArrSeg_1 = new ArraySegment (myArr_1); + ArraySegment myArrSeg_2 = new ArraySegment (myArr_2); + + // Should return true. + Assert.AreEqual (myArrSeg_1.Equals (myArrSeg_1), true); + + // Should return false. Allthough the strings are the same. + Assert.AreEqual (myArrSeg_1.Equals (myArrSeg_2), false); + Assert.AreEqual (myArrSeg_1 == myArrSeg_2, false); + + // Should return true. + Assert.AreEqual (myArrSeg_1 != myArrSeg_2, true); + } + +#if NET_4_5 + [Test] + public void IList_NotSupported () + { + var array = new long[] { 1, 2, 3, 4, 5, 6, -10 }; + + IList s = new ArraySegment (array, 2, 3); + + try { + s.Add (1); + Assert.Fail ("#1"); + } catch (NotSupportedException) { + } + + try { + s.Clear (); + Assert.Fail ("#2"); + } catch (NotSupportedException) { + } + + try { + s.Remove (3); + Assert.Fail ("#3"); + } catch (NotSupportedException) { + } + + try { + s.RemoveAt (3); + Assert.Fail ("#4"); + } catch (NotSupportedException) { + } + + try { + s.Insert (2, 3); + Assert.Fail ("#5"); + } catch (NotSupportedException) { + } + } + + [Test] + public void IList_GetEnumerator () + { + var array = new long[] { 1, 2, 3, 4, 5, 6, -10 }; + + IList s = new ArraySegment (array, 2, 3); + + long total = 0; + int count = 0; + foreach (var i in s) { + count++; + total += i; + } + + Assert.AreEqual (3, count, "#1"); + Assert.AreEqual (12, total, "#2"); + } + + [Test] + public void IList_IndexOf () + { + var array = new long[] { 1, 2, 3, 4, 5, 6, -10 }; + + IList s = new ArraySegment (array, 2, 3); + Assert.AreEqual (-1, s.IndexOf (2), "#1"); + Assert.AreEqual (1, s.IndexOf (4), "#2"); + } + + [Test] + public void IList_Contains () + { + var array = new long[] { 1, 2, 3, 4, 5, 6, -10 }; + + IList s = new ArraySegment (array, 2, 3); + Assert.IsFalse (s.Contains (2), "#1"); + Assert.IsTrue (s.Contains (4), "#2"); + } + + [Test] + public void IList_CopyTo () + { + var array = new long[] { 1, 2, 3, 4, 5, 6, -10 }; + + IList s = new ArraySegment (array, 2, 3); + long[] target = new long[s.Count]; + s.CopyTo (target, 0); + + Assert.AreEqual (3, target[0], "#1"); + Assert.AreEqual (4, target[1], "#2"); + } + + [Test] + public void IList_Indexer () + { + var array = new long[] { 1, 2, 3, 4, 5, 6, -10 }; + + IList s = new ArraySegment (array, 2, 3); + Assert.AreEqual (3, s[0], "#1"); + Assert.AreEqual (4, s[1], "#2"); + + // LAMESPEC: I have not idea why is this allowed on ReadOnly array + Assert.IsTrue (s.IsReadOnly, "#3"); + s[1] = -3; + Assert.AreEqual (-3, s[1], "#2a"); + } #endif + } +} diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs index f53eb6dd25d..b8148a1260d 100644 --- a/mcs/class/corlib/Test/System/ArrayTest.cs +++ b/mcs/class/corlib/Test/System/ArrayTest.cs @@ -225,7 +225,23 @@ public class ArrayTest Assert.AreEqual (-1, Array.BinarySearch (o, 0, 3, null, null), "O=a,i,i,o,c"); } - // TODO - testBinarySearch with explicit IComparer args + class TestComparer7 : IComparer + { + public int Compare (int x, int y) + { + if (y != 7) + throw new ApplicationException (); + + return x.CompareTo (y); + } + } + + [Test] + public void BinarySearch_WithComparer () + { + var a = new int[] { 2, 6, 9 }; + Assert.AreEqual (-3, Array.BinarySearch (a, 7, new TestComparer7 ())); + } [Test] public void TestClear() { @@ -657,7 +673,7 @@ public class ArrayTest } Assert.IsTrue (errorThrown, "#F03a"); } -#if NET_1_1 + { bool errorThrown = false; try { @@ -667,7 +683,6 @@ public class ArrayTest } Assert.IsTrue (errorThrown, "#F03b"); } -#endif #if !TARGET_JVM // Arrays lower bounds are not supported for TARGET_JVM { bool errorThrown = false; diff --git a/mcs/class/corlib/Test/System/ConvertTest.cs b/mcs/class/corlib/Test/System/ConvertTest.cs index 28c08ba0737..e2c3c5968c6 100644 --- a/mcs/class/corlib/Test/System/ConvertTest.cs +++ b/mcs/class/corlib/Test/System/ConvertTest.cs @@ -2678,6 +2678,31 @@ namespace MonoTests.System { Convert.FromBase64String(brokenB64); } + [Test] // bug #5464 + [ExpectedException (typeof (FormatException))] + public void TestInvalidBase64_Bug5464 () + { + Convert.FromBase64String ("dGVzdA==DQo="); + } + + [Test] // bug #5464 + public void TestValidBase64_Bug5464 () + { + byte[] result = Convert.FromBase64String ("dGVzdA=="); + Assert.AreEqual(4, result.Length, "Array.Length expected to be 4."); + Assert.AreEqual(116, result[0], "#A01"); + Assert.AreEqual(101, result[1], "#A02"); + Assert.AreEqual(115, result[2], "#A03"); + Assert.AreEqual(116, result[3], "#A04"); + } + + [Test] + [ExpectedException (typeof (FormatException))] + public void TestInvalidBase64_TooManyPaddings () + { + Convert.FromBase64String ("dGVzd==="); + } + [Test] public void TestBeginWithSpaces () { diff --git a/mcs/class/corlib/Test/System/DateTimeTest.cs b/mcs/class/corlib/Test/System/DateTimeTest.cs index 3b54f990666..4954c9bf918 100644 --- a/mcs/class/corlib/Test/System/DateTimeTest.cs +++ b/mcs/class/corlib/Test/System/DateTimeTest.cs @@ -355,6 +355,18 @@ namespace MonoTests.System Assert.AreEqual ("0999", t3.ToString ("yyyy"), "#B33"); } + [Test] + public void TestToStringGenitive () + { + DateTime dt = new DateTime (2010, 1, 2, 3, 4, 5); + var dtf = new CultureInfo ("cs-cz").DateTimeFormat; + + Assert.AreEqual ("2 ledna", dt.ToString ("d MMMM", dtf), "#A1"); + Assert.AreEqual ("2. ledna", dt.ToString ("d. MMMM", dtf), "#A2"); + Assert.AreEqual ("leden", dt.ToString ("MMMM", dtf), "#A4"); + Assert.AreEqual ("leden", dt.ToString ("MMMMMMM", dtf), "#A5"); + } + [Test] public void ParseExact_Format_Empty () { @@ -852,12 +864,23 @@ namespace MonoTests.System } [Test] - [Ignore ("need to fix tests that run on different timezones")] public void TestParse2 () { DateTime t1 = DateTime.Parse ("Mon, 25 Feb 2002 04:25:13 GMT"); t1 = TimeZone.CurrentTimeZone.ToUniversalTime(t1); - Assert.AreEqual (04 - TimeZone.CurrentTimeZone.GetUtcOffset (t1).Hours, t1.Hour); + Assert.AreEqual (4, t1.Hour); + } + + [Test] + public void TestUtcOffset_Novell710512 () + { + // test for bug Novell #710512 + if (TimeZoneInfo.Local.BaseUtcOffset == TimeSpan.Zero) + Assert.Ignore("Test doesn't apply with current time zone"); + + var localTime = DateTime.Parse ("Mon, 25 Feb 2002 04:25:13 GMT"); + var utcTime = TimeZone.CurrentTimeZone.ToUniversalTime(localTime); + Assert.AreEqual (TimeSpan.Zero, TimeZone.CurrentTimeZone.GetUtcOffset (utcTime)); } [Test] @@ -1235,80 +1258,6 @@ namespace MonoTests.System Assert.AreEqual (0, dt.Millisecond, "#B7"); } - [Test] -#if NET_4_0 - [Ignore ("Current-culture dependent test, which is not valid in 4.0 anymore")] -#else - // FIXME: This test doesn't work on cultures like es-DO which have patterns - // for both dd/MM/yyyy & MM/dd/yyyy - [Category ("NotWorking")] -#endif - public void Parse_Bug53023a () - { - foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.SpecificCultures)) { - FormatException e = null; - try { - // this fails for MOST culture under MS 1.1 SP1 - DateTime.Parse ("8/16/2005", ci); - } - catch (FormatException fe) { - e = fe; - } - string c = ci.ToString (); - switch (c) { - case "af-ZA": - case "en-CB": - case "en-PH": - case "en-US": - case "en-ZA": - case "en-ZW": - case "es-PA": - case "eu-ES": - case "fa-IR": - case "fr-CA": - case "hu-HU": - case "ja-JP": - case "ko-KR": - case "lv-LV": - case "lt-LT": - case "mn-MN": - case "pl-PL": - case "sq-AL": - case "sv-SE": - case "sw-KE": - case "zh-CN": - case "zh-TW": - - case "bo-CN": // new in 3.5? - case "en-029": // new in 3.5...WTF is it? - case "es-US": // new in 3.5? - case "fil-PH": // new in 3.5? - case "ii-CN": // new in 3.5? - case "km-KH": // new in 3.5? - case "mn-Mong-CN": // new in 3.5? - case "moh-CA": // new in 3.5? - case "ne-NP": // new in 3.5? - case "ns-ZA": - case "nso-ZA": - case "rw-RW": // new in 3.5? - case "sah-RU": // new in 3.5? - case "se-SE": - case "si-LK": // new in 3.5? - case "sma-SE": - case "smj-SE": - case "tn-ZA": - case "ug-CN": // new in 3.5? - case "xh-ZA": - case "zu-ZA": - Assert.IsNull (e, c); - break; - default: - Assert.IsNotNull (e, c); - break; - } - } - } - [Test] public void Parse_Bug53023b () { @@ -1656,12 +1605,12 @@ namespace MonoTests.System // X509Certificate pattern is _always_ accepted. stage = "1"; dt = DateTime.ParseExact ("19960312183847Z", "yyyyMMddHHmmssZ", null); -#if NET_1_1 + stage = "2"; // fails with many cultures on .NET. // if (i != 127) // dt = DateTime.Parse ("19960312183847Z"); -#endif + stage = "3"; dt = DateTime.Parse ("2004-05-26T03:29:01.1234567"); stage = "4"; @@ -1716,7 +1665,7 @@ namespace MonoTests.System break; } -#if NET_1_1 + // ka-GE rejects these formats under MS.NET. // I wonder why. Also, those tests fail under .NET 1.0. if (ci.LCID != 1079) { @@ -1732,24 +1681,10 @@ namespace MonoTests.System case 1078: // MS does not pass this culture. Dunno why. break; default: -#if ONLY_1_1 - // bug #58938 - stage = "12"; - dt = DateTime.Parse ("2002#02#25 19:20:00"); - // this stage fails under MS 2.0 - stage = "13"; - Assert.AreEqual (19, dt.Hour, String.Format ("bug #58938 on culture {0} {1}", ci.LCID, ci)); -#endif break; } stage = "14"; dt = DateTime.Parse ("2002-02-25 12:01:03"); -#if ONLY_1_1 - stage = "15"; - dt = DateTime.Parse ("2002#02#25 12:01:03"); - stage = "16"; - dt = DateTime.Parse ("2002%02%25 12:01:03"); -#endif stage = "17"; if (ci.DateTimeFormat.TimeSeparator != ".") dt = DateTime.Parse ("2002.02.25 12:01:03"); @@ -1768,7 +1703,6 @@ namespace MonoTests.System if (i != 1078) Assert.AreEqual (12, dt.Hour, String.Format ("stage 18.1 RFC1123 UTC {0} {1}", i, ci)); } -#endif } catch (FormatException ex) { Assert.Fail (String.Format ("stage {3}: Culture {0} {1} failed: {2}", i, ci, ex.Message, stage)); } @@ -2299,8 +2233,6 @@ namespace MonoTests.System } [Test] - [Category ("NotDotNet")] - [Category ("NotWorking")] // wrt bug #352210 public void KindPattern () { // no matter how the format string contains 'K' and the @@ -2315,7 +2247,7 @@ namespace MonoTests.System DateTime d1 = DateTime.ParseExact (s, format, ci); // d1 is parsed as a local time. Assert.AreEqual (dt.Ticks, d1.ToUniversalTime ().Ticks, "#1"); // .NET expects Local here, while s ends with 'Z' and should be parsed as UTC. - Assert.AreEqual (DateTimeKind.Utc, d1.Kind, "#2"); + Assert.AreEqual (DateTimeKind.Local, d1.Kind, "#2"); format = "yyyy-MM-dd'T'HH:mm:ssK"; ci = CultureInfo.CurrentCulture; @@ -2459,10 +2391,10 @@ namespace MonoTests.System } [Test] - [Ignore ("This test is not international ready, probably only succeeds in the U.S.")] public void Parse_InvalidShortDate () { - DateTime expected = new DateTime (2011, 03, 22, 08, 32, 00); + DateTime expected = new DateTime (2011, 03, 22, 07, 32, 00, DateTimeKind.Utc).ToLocalTime(); + DateTime expected2 = new DateTime (2011, 03, 22, 08, 32, 00, DateTimeKind.Utc); string [] cultures = new string [] {"es-ES", "en-US", "en-GB", "de-DE", "fr-FR" #if NET_4_0 @@ -2474,21 +2406,21 @@ namespace MonoTests.System CultureInfo ci = new CultureInfo (culture); ci.DateTimeFormat.ShortDatePattern = "d"; - Assert.AreEqual (DateTime.Parse ("2011-03-22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), expected, "#a01 - " + culture); - Assert.AreEqual (DateTime.Parse ("2011/03/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), expected, "#a02 - " + culture); - Assert.AreEqual (DateTime.Parse ("2011-03-22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#a03 - " + culture); - Assert.AreEqual (DateTime.Parse ("2011/03/22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#a04 - " + culture); - Assert.AreEqual (DateTime.Parse ("03/2011/22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#a05 - " + culture); - Assert.AreEqual (DateTime.Parse ("03-2011-22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#a06 - " + culture); - Assert.AreEqual (DateTime.Parse ("03/2011/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), expected, "#a07 - " + culture); + Assert.AreEqual (expected, DateTime.Parse ("2011-03-22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), "#a01 - " + culture); + Assert.AreEqual (expected, DateTime.Parse ("2011/03/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), "#a02 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("2011-03-22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#a03 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("2011/03/22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#a04 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("03/2011/22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#a05 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("03-2011-22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#a06 - " + culture); + Assert.AreEqual (expected, DateTime.Parse ("03/2011/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), "#a07 - " + culture); ci.DateTimeFormat.DateSeparator = "%"; - Assert.AreEqual (DateTime.Parse ("2011-03-22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), expected, "#b01 - " + culture); - Assert.AreEqual (DateTime.Parse ("2011/03/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), expected, "#b02 - " + culture); - Assert.AreEqual (DateTime.Parse ("2011-03-22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#b03 - " + culture); - Assert.AreEqual (DateTime.Parse ("2011/03/22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#b04 - " + culture); - Assert.AreEqual (DateTime.Parse ("03/2011/22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#b05 - " + culture); - Assert.AreEqual (DateTime.Parse ("03-2011-22T08:32:00", ci, DateTimeStyles.RoundtripKind), expected, "#b06 - " + culture); - Assert.AreEqual (DateTime.Parse ("03/2011/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), expected, "#b07 - " + culture); + Assert.AreEqual (expected, DateTime.Parse ("2011-03-22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), "#b01 - " + culture); + Assert.AreEqual (expected, DateTime.Parse ("2011/03/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), "#b02 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("2011-03-22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#b03 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("2011/03/22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#b04 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("03/2011/22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#b05 - " + culture); + Assert.AreEqual (expected2, DateTime.Parse ("03-2011-22T08:32:00", ci, DateTimeStyles.RoundtripKind), "#b06 - " + culture); + Assert.AreEqual (expected, DateTime.Parse ("03/2011/22 08:32:00+01:00", ci, DateTimeStyles.RoundtripKind), "#b07 - " + culture); } } diff --git a/mcs/class/corlib/Test/System/DecimalTest.cs b/mcs/class/corlib/Test/System/DecimalTest.cs index dd6d8db1edf..87ddc5ec68d 100644 --- a/mcs/class/corlib/Test/System/DecimalTest.cs +++ b/mcs/class/corlib/Test/System/DecimalTest.cs @@ -629,6 +629,7 @@ namespace MonoTests.System } [Test] + [SetCulture("en-US")] public void TestConstructDouble () { Decimal d; @@ -1067,6 +1068,7 @@ namespace MonoTests.System } [Test] + [SetCulture("en-US")] public void ToString_Defaults () { Decimal d = 254.9m; @@ -1110,8 +1112,23 @@ namespace MonoTests.System decimal d = Decimal.Parse ("9223372036854775808.0000000009", CultureInfo.InvariantCulture); long l = (long) d; } - -#if NET_2_0 +/* Not yet fixed + [Test] + public void ParseEmptyNumberGroupSeparator () + { + CultureInfo originalCulture = CultureInfo.CurrentCulture; + Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US"); + try { + var nf = new NumberFormatInfo (); + nf.NumberDecimalSeparator = "."; + nf.NumberGroupSeparator = ""; + decimal d = decimal.Parse ("4.5", nf); + Assert.AreEqual (4.5, d); + } finally { + Thread.CurrentThread.CurrentCulture = originalCulture; + } + } +*/ [Test] [Category ("TargetJvmNotWorking")] public void TryParse () @@ -1130,7 +1147,6 @@ namespace MonoTests.System NumberFormatInfo.InvariantInfo, out r)); } } -#endif [Test] [ExpectedException (typeof (DivideByZeroException))] @@ -1156,17 +1172,11 @@ namespace MonoTests.System Assert.AreEqual (-12.1m, Decimal.Remainder (n2, p1), "-12.1 % 254.9"); Assert.AreEqual (12.1m, Decimal.Remainder (p2, n1), "12.1 % -254.9"); Assert.AreEqual (-12.1m, Decimal.Remainder (n2, n1), "-12.1 % -254.9"); -#if NET_2_0 + Assert.AreEqual (0.0m, Decimal.Remainder (p1, p1), "12.1 % 12.1"); Assert.AreEqual (0.0m, Decimal.Remainder (n1, p1), "-12.1 % 12.1"); Assert.AreEqual (0.0m, Decimal.Remainder (p1, n1), "12.1 % -12.1"); Assert.AreEqual (0.0m, Decimal.Remainder (n1, n1), "-12.1 % -12.1"); -#else - Assert.AreEqual (0, Decimal.Remainder (p1, p1), "12.1 % 12.1"); - Assert.AreEqual (0, Decimal.Remainder (n1, p1), "-12.1 % 12.1"); - Assert.AreEqual (0, Decimal.Remainder (p1, n1), "12.1 % -12.1"); - Assert.AreEqual (0, Decimal.Remainder (n1, n1), "-12.1 % -12.1"); -#endif } [Test] @@ -1367,6 +1377,7 @@ namespace MonoTests.System } [Test] // bug #59425 + [SetCulture("en-US")] public void ParseAndKeepPrecision () { string value = "5"; @@ -1387,6 +1398,7 @@ namespace MonoTests.System } [Test] + [SetCulture("en-US")] public void ToString_G () { Assert.AreEqual ("1.0", (1.0m).ToString (), "00"); @@ -1420,7 +1432,6 @@ namespace MonoTests.System Assert.AreEqual ("0.0000000000000000000000000001", (0.0000000000000000000000000001m).ToString (), "28"); } -#if NET_2_0 [Test] public void MidpointRoundingAwayFromZero () { @@ -1443,6 +1454,83 @@ namespace MonoTests.System Assert.AreEqual (-2.1M, Math.Round (-2.08M, 1, m), "#15"); Assert.AreEqual (-3.1M, Math.Round (-3.05M, 1, m), "#16"); } -#endif + + [Test] // bug #4814 + [SetCulture("")] + public void Parse_NumberGroupSeparatorIsEmpty_DoNotThrowIndexOutOfRangeException () + { + NumberFormatInfo nf = new NumberFormatInfo (); + nf.NumberGroupSeparator = ""; + Decimal.Parse ("1.5", nf); + } + + [Test] // bug #4814 + [SetCulture("")] + public void Parse_CurrencyGroupSeparatorIsEmpty_DoNotThrowIndexOutOfRangeException () + { + NumberFormatInfo nf = new NumberFormatInfo (); + nf.CurrencyGroupSeparator = ""; + Decimal.Parse ("\u00A41.5", NumberStyles.Currency, nf); + } + + [Test] // bug #4814 + [SetCulture("")] + public void Parse_LeadingSign_PositiveSignIsEmpty_DoNotThrowIndexOutOfRangeException () + { + NumberFormatInfo nf = new NumberFormatInfo (); + nf.PositiveSign = ""; + try { + Decimal.Parse ("+15", nf); + } catch (FormatException) { + return; + } + + Assert.Fail ("Expected FormatException"); + } + + [Test] // bug #4814 + [SetCulture("")] + public void Parse_LeadingSign_NegativeSignIsEmpty_DoNotThrowIndexOutOfRangeException () + { + NumberFormatInfo nf = new NumberFormatInfo (); + nf.NegativeSign = ""; + try { + Decimal.Parse ("-15", nf); + } catch (FormatException) { + return; + } + + Assert.Fail ("Expected FormatException"); + } + + [Test] // bug #4814 + [SetCulture("")] + public void Parse_TrailingSign_PositiveSignIsEmpty_DoNotThrowIndexOutOfRangeException () + { + NumberFormatInfo nf = new NumberFormatInfo (); + nf.PositiveSign = ""; + try { + Decimal.Parse ("15+", nf); + } catch (FormatException) { + return; + } + + Assert.Fail ("Expected FormatException"); + } + + [Test] // bug #4814 + [SetCulture("")] + public void Parse_TrailingSign_NegativeSignIsEmpty_DoNotThrowIndexOutOfRangeException () + { + NumberFormatInfo nf = new NumberFormatInfo (); + nf.NegativeSign = ""; + try { + Decimal.Parse ("15-", nf); + } catch (FormatException) { + return; + } + + Assert.Fail ("Expected FormatException"); + } } } diff --git a/mcs/class/corlib/Test/System/DoubleTest.cs b/mcs/class/corlib/Test/System/DoubleTest.cs index b9b852e8000..edd94252d12 100644 --- a/mcs/class/corlib/Test/System/DoubleTest.cs +++ b/mcs/class/corlib/Test/System/DoubleTest.cs @@ -46,7 +46,7 @@ namespace MonoTests.System }; [SetUp] - public void GetReady () + public void Setup () { string sep = NumberFormatInfo.CurrentInfo.NumberDecimalSeparator; string_values = new string [15]; @@ -224,11 +224,12 @@ namespace MonoTests.System [Test] public void ParseAllowWhitespaces () { + var nf = CultureInfo.CurrentCulture.NumberFormat; NumberStyles style = NumberStyles.Float; double.Parse (" 32 "); - double.Parse (" Infinity "); - double.Parse (" -Infinity "); - double.Parse (" NaN "); + double.Parse (string.Format (" {0} ", nf.PositiveInfinitySymbol)); + double.Parse (string.Format (" {0} ", nf.NegativeInfinitySymbol)); + double.Parse (string.Format (" {0} ", nf.NaNSymbol)); } [Test] // bug #81630 @@ -552,13 +553,7 @@ namespace MonoTests.System } [Test] -#if NET_2_0 [ExpectedException (typeof (ArgumentException))] -#else - [Category ("NotWorking")] - // MS accept hex values under 1.x but the results neither match the long value - // nor the value of a 64bits double -#endif public void HexNumber_WithHexToParse () { // from bug #72221 @@ -568,13 +563,7 @@ namespace MonoTests.System } [Test] -#if NET_2_0 [ExpectedException (typeof (ArgumentException))] -#else - [Category ("NotWorking")] - // MS accept hex values under 1.x but the results neither match the long value - // nor the value of a 64bits double -#endif public void HexNumber_NoHexToParse () { double d; @@ -597,10 +586,8 @@ namespace MonoTests.System Assert.IsFalse (Double.TryParse ("string", NumberStyles.Any, null, out value), "#1"); Assert.IsFalse (Double.TryParse ("with whitespace", NumberStyles.Any, null, out value), "#2"); -#if NET_2_0 Assert.IsFalse (Double.TryParse ("string", out value), "#3"); Assert.IsFalse (Double.TryParse ("with whitespace", out value), "#4"); -#endif } @@ -614,10 +601,24 @@ namespace MonoTests.System double d = double.Parse ("$4.56", NumberStyles.Currency, f); Assert.AreEqual (4.56, d); } finally { - // restore original culture Thread.CurrentThread.CurrentCulture = originalCulture; } + } + [Test] + public void ParseEmptyNumberGroupSeparator () + { + CultureInfo originalCulture = CultureInfo.CurrentCulture; + Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US"); + try { + var nf = new NumberFormatInfo (); + nf.NumberDecimalSeparator = "."; + nf.NumberGroupSeparator = ""; + double d = double.Parse ("4.5", nf); + Assert.AreEqual (4.5, d); + } finally { + Thread.CurrentThread.CurrentCulture = originalCulture; + } } } } diff --git a/mcs/class/corlib/Test/System/GuidTest.cs b/mcs/class/corlib/Test/System/GuidTest.cs index ea8219572b8..b2d596b551e 100644 --- a/mcs/class/corlib/Test/System/GuidTest.cs +++ b/mcs/class/corlib/Test/System/GuidTest.cs @@ -180,7 +180,7 @@ namespace MonoTests.System { Assert.IsFalse (g1.Equals ((object)"This is not a Guid!"), "A5"); } -#if NET_2_0 + [Test] public void EqualsGuid () { @@ -194,7 +194,6 @@ namespace MonoTests.System { Assert.IsFalse (g1.Equals (null), "A4"); Assert.IsFalse (g1.Equals ("This is not a Guid!"), "A5"); } -#endif [Test] public void CompareToObject () @@ -221,7 +220,6 @@ namespace MonoTests.System { Guid.Empty.CompareTo ("Say what?"); } -#if NET_2_0 [Test] public void CompareToGuid () { @@ -238,7 +236,18 @@ namespace MonoTests.System { Assert.IsTrue (g4.CompareTo (g1) > 0, "A6"); Assert.IsTrue (g1.CompareTo (g1) == 0, "A7"); } -#endif + + [Test] + public void CompareToGuid_2 () + { + var g1 = new Guid ("d1c5088bc188464fb77b0fd2be2d005e"); + var g2 = new Guid ("d2c5088bc188464fb77b0fd2be2d005e"); + var g3 = new Guid ("00c5088bc188464fb77b0fd2be2d005e"); + + Assert.AreEqual (-1, g1.CompareTo (g2), "#1"); + Assert.AreEqual (1, g1.CompareTo (g3), "#2"); + Assert.AreEqual (1, g1.CompareTo (Guid.Empty), "#3"); + } [Test] public void GetHashCode_Same () @@ -274,14 +283,20 @@ namespace MonoTests.System { Assert.AreEqual ("00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString (""), "A6"); Assert.AreEqual ("00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ((string)null), "A7"); Assert.AreEqual ("{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString ("B", null), "A10"); +#if NET_4_0 + Assert.AreEqual ("{0x00010203,0x0405,0x0607,{0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}}", g.ToString ("x"), "A11"); + Assert.AreEqual ("{0x00010203,0x0405,0x0607,{0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}}", g.ToString ("X"), "A11"); +#endif } +#if !NET_4_0 [Test] [ExpectedException (typeof (FormatException))] public void ToString_UnsupportedFormat () { new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f).ToString ("X"); } +#endif [Test] [ExpectedException (typeof (FormatException))] @@ -348,9 +363,15 @@ namespace MonoTests.System { guid = Guid.ParseExact ("00010203-0405-0607-0809-0a0b0c0d0e0f", "D"); Assert.AreEqual (expected, guid.ToString ()); + guid = Guid.ParseExact ("00010203-0405-0607-0809-0a0b0c0d0e0f", "d"); + Assert.AreEqual (expected, guid.ToString ()); + guid = Guid.ParseExact ("{00010203-0405-0607-0809-0A0B0C0D0E0F}", "B"); Assert.AreEqual (expected, guid.ToString ()); + guid = Guid.ParseExact ("{00010203-0405-0607-0809-0A0B0C0D0E0F}", "b"); + Assert.AreEqual (expected, guid.ToString ()); + guid = Guid.ParseExact ("(00010203-0405-0607-0809-0A0B0C0D0E0F)", "P"); Assert.AreEqual (expected, guid.ToString ()); diff --git a/mcs/class/corlib/Test/System/MathTest.cs b/mcs/class/corlib/Test/System/MathTest.cs index 35b7c6b9eda..d5e325bf882 100644 --- a/mcs/class/corlib/Test/System/MathTest.cs +++ b/mcs/class/corlib/Test/System/MathTest.cs @@ -137,8 +137,21 @@ namespace MonoTests.System double a = Math.Acos (x); double b = 1.4470809809523457; - Assert.IsTrue ((Math.Abs (a - b) <= double_epsilon), a.ToString ("G99") - + " != " + b.ToString ("G99")); + bool regularTest = (Math.Abs (a - b) <= double_epsilon); + if (!regularTest){ + // + // On MacOS X libc acos (0.1234) returns + // 1.4470809809523455 (hex 0x3ff7273e62fda9ab) instead + // of 1.4470809809523457 (hex 0x3ff7273e62fda9ac) + // + // For now, let it go + // + if (a == 1.4470809809523455) + regularTest = true; + } + + Assert.IsTrue (regularTest, a.ToString ("G99") + " != " + b.ToString ("G99")); + Assert.IsTrue (double.IsNaN (Math.Acos (-1.01D))); Assert.IsTrue (double.IsNaN (Math.Acos (1.01D))); Assert.IsTrue (double.IsNaN (Math.Acos (Double.MinValue))); diff --git a/mcs/class/corlib/Test/System/NumberFormatterTest.cs b/mcs/class/corlib/Test/System/NumberFormatterTest.cs index 521f41f1bbc..4aaa735e663 100644 --- a/mcs/class/corlib/Test/System/NumberFormatterTest.cs +++ b/mcs/class/corlib/Test/System/NumberFormatterTest.cs @@ -2954,19 +2954,20 @@ namespace MonoTests.System [Test] public void TestNaNToString () { - Assert.AreEqual ("Infinity", Double.PositiveInfinity.ToString(), "#01"); - Assert.AreEqual ("-Infinity", Double.NegativeInfinity.ToString(), "#02"); - Assert.AreEqual ("NaN", Double.NaN.ToString(), "#03"); - Assert.AreEqual ("Infinity", Single.PositiveInfinity.ToString(), "#04"); - Assert.AreEqual ("-Infinity", Single.NegativeInfinity.ToString(), "#05"); - Assert.AreEqual ("NaN", Single.NaN.ToString(), "#06"); - - Assert.AreEqual ("Infinity", Double.PositiveInfinity.ToString("R"), "#07"); - Assert.AreEqual ("-Infinity", Double.NegativeInfinity.ToString("R"), "#08"); - Assert.AreEqual ("NaN", Double.NaN.ToString("R"), "#09"); - Assert.AreEqual ("Infinity", Single.PositiveInfinity.ToString("R"), "#10"); - Assert.AreEqual ("-Infinity", Single.NegativeInfinity.ToString("R"), "#11"); - Assert.AreEqual ("NaN", Single.NaN.ToString("R"), "#12"); + var nfi = CultureInfo.CurrentCulture.NumberFormat; + Assert.AreEqual (nfi.PositiveInfinitySymbol, Double.PositiveInfinity.ToString(), "#01"); + Assert.AreEqual (nfi.NegativeInfinitySymbol, Double.NegativeInfinity.ToString(), "#02"); + Assert.AreEqual (nfi.NaNSymbol, Double.NaN.ToString(), "#03"); + Assert.AreEqual (nfi.PositiveInfinitySymbol, Single.PositiveInfinity.ToString(), "#04"); + Assert.AreEqual (nfi.NegativeInfinitySymbol, Single.NegativeInfinity.ToString(), "#05"); + Assert.AreEqual (nfi.NaNSymbol, Single.NaN.ToString(), "#06"); + + Assert.AreEqual (nfi.PositiveInfinitySymbol, Double.PositiveInfinity.ToString("R"), "#07"); + Assert.AreEqual (nfi.NegativeInfinitySymbol, Double.NegativeInfinity.ToString("R"), "#08"); + Assert.AreEqual (nfi.NaNSymbol, Double.NaN.ToString("R"), "#09"); + Assert.AreEqual (nfi.PositiveInfinitySymbol, Single.PositiveInfinity.ToString("R"), "#10"); + Assert.AreEqual (nfi.NegativeInfinitySymbol, Single.NegativeInfinity.ToString("R"), "#11"); + Assert.AreEqual (nfi.NaNSymbol, Single.NaN.ToString("R"), "#12"); } [Test] diff --git a/mcs/class/corlib/Test/System/SingleTest.cs b/mcs/class/corlib/Test/System/SingleTest.cs index 80be31b69fe..1ae388d1f36 100644 --- a/mcs/class/corlib/Test/System/SingleTest.cs +++ b/mcs/class/corlib/Test/System/SingleTest.cs @@ -118,18 +118,18 @@ namespace MonoTests.System string posInf = float.PositiveInfinity.ToString ("r"); float result; - Assert.IsTrue (float.TryParse (maxVal, NumberStyles.Float, CultureInfo.InvariantCulture, out result), "MaxValue#1a"); + Assert.IsTrue (float.TryParse (maxVal, NumberStyles.Float, CultureInfo.CurrentCulture, out result), "MaxValue#1a"); Assert.AreEqual (float.MaxValue, result, "MaxValue#1b"); - Assert.IsTrue (float.TryParse (minVal, NumberStyles.Float, CultureInfo.InvariantCulture, out result), "MinValue#1a"); + Assert.IsTrue (float.TryParse (minVal, NumberStyles.Float, CultureInfo.CurrentCulture, out result), "MinValue#1a"); Assert.AreEqual (float.MinValue, result, "MinValue#1b"); - Assert.IsTrue (float.TryParse (epsilon, NumberStyles.Float, CultureInfo.InvariantCulture, out result), "Epsilon#1a"); + Assert.IsTrue (float.TryParse (epsilon, NumberStyles.Float, CultureInfo.CurrentCulture, out result), "Epsilon#1a"); Assert.AreEqual (float.Epsilon, result, "Epsilon#1b"); - Assert.IsTrue (float.TryParse (nan, NumberStyles.Float, CultureInfo.InvariantCulture, out result), "NaN#1a"); + Assert.IsTrue (float.TryParse (nan, NumberStyles.Float, CultureInfo.CurrentCulture, out result), "NaN#1a"); Assert.AreEqual (float.NaN, result, "NaN#1b"); Assert.IsNaN (result, "NaN#1c"); - Assert.IsTrue (float.TryParse (negInf, NumberStyles.Float, CultureInfo.InvariantCulture, out result), "-Inf#1a"); + Assert.IsTrue (float.TryParse (negInf, NumberStyles.Float, CultureInfo.CurrentCulture, out result), "-Inf#1a"); Assert.AreEqual (float.NegativeInfinity, result, "-Inf#1b"); - Assert.IsTrue (float.TryParse (posInf, NumberStyles.Float, CultureInfo.InvariantCulture, out result), "+Inf#1a"); + Assert.IsTrue (float.TryParse (posInf, NumberStyles.Float, CultureInfo.CurrentCulture, out result), "+Inf#1a"); Assert.AreEqual (float.PositiveInfinity, result, "+Inf#1b"); Assert.AreEqual (float.MaxValue, float.Parse (maxVal), "MaxValue#2"); @@ -140,13 +140,13 @@ namespace MonoTests.System Assert.AreEqual (float.NegativeInfinity, float.Parse (negInf), "-Inf#2"); Assert.AreEqual (float.PositiveInfinity, float.Parse (posInf), "+Inf#2"); - Assert.AreEqual (float.MaxValue, float.Parse (maxVal, CultureInfo.InvariantCulture), "MaxValue#3"); - Assert.AreEqual (float.MinValue, float.Parse (minVal, CultureInfo.InvariantCulture), "MinValue#3"); - Assert.AreEqual (float.Epsilon, float.Parse (epsilon, CultureInfo.InvariantCulture), "Epsilon#3"); - Assert.AreEqual (float.NaN, float.Parse (nan, CultureInfo.InvariantCulture), "NaN#3a"); - Assert.IsNaN (float.Parse (nan, CultureInfo.InvariantCulture), "NaN#3b"); - Assert.AreEqual (float.NegativeInfinity, float.Parse (negInf, CultureInfo.InvariantCulture), "-Inf#3"); - Assert.AreEqual (float.PositiveInfinity, float.Parse (posInf, CultureInfo.InvariantCulture), "+Inf#3"); + Assert.AreEqual (float.MaxValue, float.Parse (maxVal, CultureInfo.CurrentCulture), "MaxValue#3"); + Assert.AreEqual (float.MinValue, float.Parse (minVal, CultureInfo.CurrentCulture), "MinValue#3"); + Assert.AreEqual (float.Epsilon, float.Parse (epsilon, CultureInfo.CurrentCulture), "Epsilon#3"); + Assert.AreEqual (float.NaN, float.Parse (nan, CultureInfo.CurrentCulture), "NaN#3a"); + Assert.IsNaN (float.Parse (nan, CultureInfo.CurrentCulture), "NaN#3b"); + Assert.AreEqual (float.NegativeInfinity, float.Parse (negInf, CultureInfo.CurrentCulture), "-Inf#3"); + Assert.AreEqual (float.PositiveInfinity, float.Parse (posInf, CultureInfo.CurrentCulture), "+Inf#3"); Assert.AreEqual (float.MaxValue, float.Parse (maxVal, NumberStyles.Float), "MaxValue#4"); Assert.AreEqual (float.MinValue, float.Parse (minVal, NumberStyles.Float), "MinValue#4"); @@ -156,13 +156,13 @@ namespace MonoTests.System Assert.AreEqual (float.NegativeInfinity, float.Parse (negInf, NumberStyles.Float), "-Inf#4"); Assert.AreEqual (float.PositiveInfinity, float.Parse (posInf, NumberStyles.Float), "+Inf#4"); - Assert.AreEqual (float.MaxValue, float.Parse (maxVal, NumberStyles.Float, CultureInfo.InvariantCulture), "MaxValue#5"); - Assert.AreEqual (float.MinValue, float.Parse (minVal, NumberStyles.Float, CultureInfo.InvariantCulture), "MinValue#5"); - Assert.AreEqual (float.Epsilon, float.Parse (epsilon, NumberStyles.Float, CultureInfo.InvariantCulture), "Epsilon#5"); - Assert.AreEqual (float.NaN, float.Parse (nan, NumberStyles.Float, CultureInfo.InvariantCulture), "NaN#5a"); - Assert.IsNaN (float.Parse (nan, NumberStyles.Float, CultureInfo.InvariantCulture), "NaN#5b"); - Assert.AreEqual (float.NegativeInfinity, float.Parse (negInf, NumberStyles.Float, CultureInfo.InvariantCulture), "-Inf#5"); - Assert.AreEqual (float.PositiveInfinity, float.Parse (posInf, NumberStyles.Float, CultureInfo.InvariantCulture), "+Inf#5"); + Assert.AreEqual (float.MaxValue, float.Parse (maxVal, NumberStyles.Float, CultureInfo.CurrentCulture), "MaxValue#5"); + Assert.AreEqual (float.MinValue, float.Parse (minVal, NumberStyles.Float, CultureInfo.CurrentCulture), "MinValue#5"); + Assert.AreEqual (float.Epsilon, float.Parse (epsilon, NumberStyles.Float, CultureInfo.CurrentCulture), "Epsilon#5"); + Assert.AreEqual (float.NaN, float.Parse (nan, NumberStyles.Float, CultureInfo.CurrentCulture), "NaN#5a"); + Assert.IsNaN (float.Parse (nan, NumberStyles.Float, CultureInfo.CurrentCulture), "NaN#5b"); + Assert.AreEqual (float.NegativeInfinity, float.Parse (negInf, NumberStyles.Float, CultureInfo.CurrentCulture), "-Inf#5"); + Assert.AreEqual (float.PositiveInfinity, float.Parse (posInf, NumberStyles.Float, CultureInfo.CurrentCulture), "+Inf#5"); } #if NET_2_0 diff --git a/mcs/class/corlib/Test/System/StringTest.cs b/mcs/class/corlib/Test/System/StringTest.cs index 402c6d88c1b..429ff654f0a 100644 --- a/mcs/class/corlib/Test/System/StringTest.cs +++ b/mcs/class/corlib/Test/System/StringTest.cs @@ -2298,10 +2298,12 @@ public class StringTest string s3 = new DateTime (2000, 3, 7).ToString (); Assert.IsNull (String.IsInterned (s3), "#C1"); - Assert.AreSame (s3, String.Intern (s3), "#C2"); - Assert.AreSame (s3, String.IsInterned (s3), "#C3"); - Assert.AreSame (s3, String.IsInterned (new DateTime (2000, 3, 7).ToString ()), "#C4"); - Assert.AreSame (s3, String.Intern (new DateTime (2000, 3, 7).ToString ()), "#C5"); + + string s4 = String.Intern (s3); + Assert.AreEqual (s3, s4, "#C2"); + Assert.AreSame (s4, String.IsInterned (s4), "#C3"); + Assert.AreSame (s4, String.IsInterned (new DateTime (2000, 3, 7).ToString ()), "#C4"); + Assert.AreSame (s4, String.Intern (new DateTime (2000, 3, 7).ToString ()), "#C5"); } [Test] diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 0da21c0a27f..15d3ef043a6 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -79,6 +79,7 @@ Mono.Xml/SecurityParser.cs System/AccessViolationException.cs System/ActivationContext.cs System/Activator.cs +System/AndroidPlatform.cs System/AppDomain.cs System/AppDomainInitializer.cs System/AppDomainManager.cs @@ -488,6 +489,7 @@ System.Reflection/BindingFlags.cs System.Reflection/CallingConventions.cs System.Reflection/ConstructorInfo.cs System.Reflection/CustomAttributeData.cs +System.Reflection/CustomAttributeExtensions.cs System.Reflection/CustomAttributeFormatException.cs System.Reflection/CustomAttributeNamedArgument.cs System.Reflection/CustomAttributeTypedArgument.cs @@ -614,6 +616,7 @@ System.Runtime/GCSettings.cs System.Runtime/MemoryFailPoint.cs System.Runtime/TargetedPatchingOptOutAttribute.cs System.Runtime.CompilerServices/AccessedThroughPropertyAttribute.cs +System.Runtime.CompilerServices/AsyncStateMachineAttribute.cs System.Runtime.CompilerServices/AsyncVoidMethodBuilder.cs System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs @@ -663,6 +666,7 @@ System.Runtime.CompilerServices/IsPinned.cs System.Runtime.CompilerServices/IsSignUnspecifiedByte.cs System.Runtime.CompilerServices/IsUdtReturn.cs System.Runtime.CompilerServices/IsVolatile.cs +System.Runtime.CompilerServices/IteratorStateMachineAttribute.cs System.Runtime.CompilerServices/LoadHint.cs System.Runtime.CompilerServices/MethodCodeType.cs System.Runtime.CompilerServices/MethodImplAttribute.cs @@ -675,6 +679,7 @@ System.Runtime.CompilerServices/RuntimeWrappedException.cs System.Runtime.CompilerServices/SpecialNameAttribute.cs System.Runtime.CompilerServices/ScopelessEnumAttribute.cs System.Runtime.CompilerServices/SuppressIldasmAttribute.cs +System.Runtime.CompilerServices/StateMachineAttribute.cs System.Runtime.CompilerServices/StringFreezingAttribute.cs System.Runtime.CompilerServices/UnsafeValueTypeAttribute.cs System.Runtime.CompilerServices/TaskAwaiter.cs @@ -1544,6 +1549,7 @@ System.Collections.Generic/IList.cs System.Collections.Generic/IComparer.cs System.Collections.Generic/IEqualityComparer.cs System.Collections.Generic/IDictionary.cs +System.Collections.Generic/IReadOnlyCollection.cs System.Collections.Generic/IReadOnlyList.cs System.Collections.Generic/IReadOnlyDictionary.cs System.Collections.Generic/KeyValuePair.cs @@ -1560,6 +1566,7 @@ System/Converter.cs System/Predicate.cs System.Collections.Generic/Comparer.cs +System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs System.Threading.Tasks/TaskFactory.cs System.Threading.Tasks/TaskFactory_T.cs System.Threading.Tasks/TaskStatus.cs diff --git a/mcs/class/corlib/corlib_test.dll.sources b/mcs/class/corlib/corlib_test.dll.sources index 66997062e59..0d908407a4c 100644 --- a/mcs/class/corlib/corlib_test.dll.sources +++ b/mcs/class/corlib/corlib_test.dll.sources @@ -444,6 +444,7 @@ System.Threading/ExecutionContextCas.cs System.Threading/MutexCas.cs System.Threading/ThreadCas.cs System.Threading/WaitHandleCas.cs +System.Threading.Tasks/ConcurrentExclusiveSchedulerPairTest.cs System.Threading.Tasks/TaskTest.cs System.Threading.Tasks/Task_T_Test.cs System.Threading.Tasks/TaskSchedulerTest.cs diff --git a/mcs/class/dlr/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj b/mcs/class/dlr/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj index e7c31692743..1cc17a8c9c7 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj +++ b/mcs/class/dlr/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj @@ -1,539 +1,463 @@ - - - - - - Debug - AnyCPU - 2.0 - {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} - Library - Properties - Microsoft.Scripting - Microsoft.Dynamic - $(SolutionDir)..\bin\$(Configuration)\Microsoft.Dynamic.xml - true - 618 - 1591 - 859832320 - Microsoft.Dynamic.ruleset - - - pdbonly - true - $(SolutionDir)..\bin\FxCop - TRACE;CLR4;$(SignedSym) - prompt - 4 - true - v4.0 - - - true - full - false - $(SolutionDir)..\bin\v2Debug - DEBUG;TRACE;CLR2;$(SignedSym) - prompt - 4 - false - v3.5 - - - pdbonly - true - $(SolutionDir)..\bin\v2Release - TRACE;CLR2;$(SignedSym) - prompt - 4 - false - v3.5 - - - true - $(SolutionDir)..\bin\Silverlight3Debug - TRACE;DEBUG;SILVERLIGHT;CLR2;$(SignedSym) - full - AnyCPU - false - prompt - false - v3.5 - - - $(SolutionDir)..\bin\Silverlight3Release - TRACE;SILVERLIGHT;CLR2;$(SignedSym) - false - pdbonly - AnyCPU - prompt - v3.5 - - - true - full - false - $(SolutionDir)..\bin\Debug - DEBUG;TRACE;CLR4;$(SignedSym) - prompt - 4 - false - v4.0 - - - pdbonly - true - $(SolutionDir)..\bin\Release - TRACE;CLR4;$(SignedSym) - prompt - 4 - false - v4.0 - - - true - full - false - $(SolutionDir)..\bin\Silverlight4Debug - TRACE;DEBUG;SILVERLIGHT;CLR4;$(SignedSym) - prompt - 4 - false - true - v4.0 - AnyCPU - - - pdbonly - true - AnyCPU - $(SolutionDir)..\bin\Silverlight4Release - TRACE;SILVERLIGHT;CLR4;$(SignedSym) - prompt - 4 - v4.0 - false - - - - Properties\SilverlightVersion.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - $(SilverlightPath)\mscorlib.dll - - - False - $(SilverlightPath)\System.dll - - - False - $(SilverlightPath)\System.Core.dll - - - False - $(SilverlightPath)\System.Numerics.dll - - - - - {2AE75F5A-CD1F-4925-9647-AF4D1C282FB4} - Microsoft.Scripting.Core - False - - - {02FF0909-F5AD-48CF-A86A-345E721B7E40} - Microsoft.Scripting - - - {ACDD9B9E-8FE6-439C-9521-1CCBA47F6143} - Microsoft.Scripting.Metadata - - - - - - - - - - + + + + + 2.0 + {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} + Library + Properties + Microsoft.Scripting + Microsoft.Dynamic + 859832320 + $(AssemblyName).ruleset + $(SolutionDir)..\bin\$(Configuration)\$(AssemblyName).xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Properties\SilverlightVersion.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2AE75F5A-CD1F-4925-9647-AF4D1C282FB4} + Microsoft.Scripting.Core + False + + + {02FF0909-F5AD-48CF-A86A-345E721B7E40} + Microsoft.Scripting + + + {ACDD9B9E-8FE6-439C-9521-1CCBA47F6143} + Microsoft.Scripting.Metadata + + + + \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs b/mcs/class/dlr/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs index 1d07e6bce67..76977f57cd2 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs @@ -18,7 +18,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; -using System.Security.Permissions; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -28,7 +27,7 @@ using System.Security.Permissions; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft.Scripting")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,23 +50,21 @@ using System.Security.Permissions; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -#if !CLR2 && !SILVERLIGHT -[assembly: SecurityRules(SecurityRuleSet.Level1)] +#if !CLR2 && !SILVERLIGHT && !WIN8 && !ANDROID && !WP75 +[assembly: System.Security.SecurityRules(SecurityRuleSet.Level1)] #endif [assembly: SecurityTransparent] [assembly: System.Resources.NeutralResourcesLanguage("en-US")] - -#if SIGNED -[assembly: InternalsVisibleTo("TestInternalDLR, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -#else -[assembly: InternalsVisibleTo("TestInternalDLR")] -#endif +[assembly: InternalsVisibleTo("TestInternalDLR, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c10ce00dd2e0ce5046d68183d3ad035b47e92bf0ce7bcf8a03a217ca5d0b0c7db973fdf97579b52b502a23d4069dbf043389e1ab65a1d6c508a9837f3e2350f15e05cc63c0fc4b0410867a51919090e4c33f80203e9b0035b21c32bae20f98b068f90d99a50133a5336480d94039b176519f5fd8524765f33be43da65c4b68ba")] #if !SILVERLIGHT -[assembly: AssemblyVersion("1.1.0.10")] -[assembly: AssemblyFileVersion("1.1.0.10")] +[assembly: AssemblyVersion("1.1.0.30")] +[assembly: AssemblyFileVersion("1.1.0.30")] [assembly: AssemblyInformationalVersion("1.1")] +#endif + +#if !SILVERLIGHT && !WP75 [assembly: AllowPartiallyTrustedCallers] [assembly: TypeForwardedTo(typeof(Microsoft.Scripting.Runtime.DynamicStackFrame))] #endif diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/.gitattributes b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/.gitattributes deleted file mode 100644 index 9e416188c5d..00000000000 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/BindingRestrictions.cs -crlf -/ExpandoObject.cs -crlf diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BinaryOperationBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BinaryOperationBinder.cs index 0b55a9e2cd5..9260938dfa1 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BinaryOperationBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BinaryOperationBinder.cs @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BindingRestrictions.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BindingRestrictions.cs index 2b1115cb49c..bf395abba53 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BindingRestrictions.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/BindingRestrictions.cs @@ -1,368 +1,366 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. - * - * This source code is subject to terms and conditions of the Apache License, Version 2.0. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Apache License, Version 2.0, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Apache License, Version 2.0. - * - * You must not remove this notice, or any other, from this software. - * - * - * ***************************************************************************/ - -#if CLR2 -using Microsoft.Scripting.Ast; -#else -using System.Linq.Expressions; -#endif - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Dynamic.Utils; -using System.Runtime.CompilerServices; - -namespace System.Dynamic { - - /// - /// Represents a set of binding restrictions on the under which the dynamic binding is valid. - /// -#if !SILVERLIGHT - [DebuggerTypeProxy(typeof(BindingRestrictionsProxy)), DebuggerDisplay("{DebugView}")] -#endif - public abstract class BindingRestrictions { - /// - /// Represents an empty set of binding restrictions. This field is read only. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] - public static readonly BindingRestrictions Empty = new CustomRestriction(Expression.Constant(true)); - - private const int TypeRestrictionHash = 0x10000000; - private const int InstanceRestrictionHash = 0x20000000; - private const int CustomRestrictionHash = 0x40000000; - - private BindingRestrictions() { - } - - // Overridden by specialized subclasses - internal abstract Expression GetExpression(); - - /// - /// Merges the set of binding restrictions with the current binding restrictions. - /// - /// The set of restrictions with which to merge the current binding restrictions. - /// The new set of binding restrictions. - public BindingRestrictions Merge(BindingRestrictions restrictions) { - ContractUtils.RequiresNotNull(restrictions, "restrictions"); - if (this == Empty) { - return restrictions; - } - if (restrictions == Empty) { - return this; - } - return new MergedRestriction(this, restrictions); - } - - /// - /// Creates the binding restriction that check the expression for runtime type identity. - /// - /// The expression to test. - /// The exact type to test. - /// The new binding restrictions. - public static BindingRestrictions GetTypeRestriction(Expression expression, Type type) { - ContractUtils.RequiresNotNull(expression, "expression"); - ContractUtils.RequiresNotNull(type, "type"); - - return new TypeRestriction(expression, type); - } - - /// - /// The method takes a DynamicMetaObject, and returns an instance restriction for testing null if the object - /// holds a null value, otherwise returns a type restriction. - /// - internal static BindingRestrictions GetTypeRestriction(DynamicMetaObject obj) { - if (obj.Value == null && obj.HasValue) { - return BindingRestrictions.GetInstanceRestriction(obj.Expression, null); - } else { - return BindingRestrictions.GetTypeRestriction(obj.Expression, obj.LimitType); - } - } - - /// - /// Creates the binding restriction that checks the expression for object instance identity. - /// - /// The expression to test. - /// The exact object instance to test. - /// The new binding restrictions. - public static BindingRestrictions GetInstanceRestriction(Expression expression, object instance) { - ContractUtils.RequiresNotNull(expression, "expression"); - - return new InstanceRestriction(expression, instance); - } - - /// - /// Creates the binding restriction that checks the expression for arbitrary immutable properties. - /// - /// The expression expression the restrictions. - /// The new binding restrictions. - /// - /// By convention, the general restrictions created by this method must only test - /// immutable object properties. - /// - public static BindingRestrictions GetExpressionRestriction(Expression expression) { - ContractUtils.RequiresNotNull(expression, "expression"); - ContractUtils.Requires(expression.Type == typeof(bool), "expression"); - return new CustomRestriction(expression); - } - - /// - /// Combines binding restrictions from the list of instances into one set of restrictions. - /// - /// The list of instances from which to combine restrictions. - /// The new set of binding restrictions. - public static BindingRestrictions Combine(IList contributingObjects) { - BindingRestrictions res = BindingRestrictions.Empty; - if (contributingObjects != null) { - foreach (DynamicMetaObject mo in contributingObjects) { - if (mo != null) { - res = res.Merge(mo.Restrictions); - } - } - } - return res; - } - - /// - /// Builds a balanced tree of AndAlso nodes. - /// We do this so the compiler won't stack overflow if we have many - /// restrictions. - /// - private sealed class TestBuilder { - private readonly Set _unique = new Set(); - private readonly Stack _tests = new Stack(); - - private struct AndNode { - internal int Depth; - internal Expression Node; - } - - internal void Append(BindingRestrictions restrictions) { - if (_unique.Contains(restrictions)) { - return; - } - _unique.Add(restrictions); - - Push(restrictions.GetExpression(), 0); - } - - internal Expression ToExpression() { - Expression result = _tests.Pop().Node; - while (_tests.Count > 0) { - result = Expression.AndAlso(_tests.Pop().Node, result); - } - return result; - } - - private void Push(Expression node, int depth) { - while (_tests.Count > 0 && _tests.Peek().Depth == depth) { - node = Expression.AndAlso(_tests.Pop().Node, node); - depth++; - } - _tests.Push(new AndNode { Node = node, Depth = depth }); - } - } - - /// - /// Creates the representing the binding restrictions. - /// - /// The expression tree representing the restrictions. - public Expression ToExpression() { - // We could optimize this better, e.g. common subexpression elimination - // But for now, it's good enough. - - if (this == Empty) { - return Expression.Constant(true); - } - - var testBuilder = new TestBuilder(); - - // Visit the tree, left to right. - // Use an explicit stack so we don't stack overflow. - // - // Left-most node is on top of the stack, so we always expand the - // left most node each iteration. - var stack = new Stack(); - stack.Push(this); - do { - var top = stack.Pop(); - var m = top as MergedRestriction; - if (m != null) { - stack.Push(m.Right); - stack.Push(m.Left); - } else { - testBuilder.Append(top); - } - } while (stack.Count > 0); - - return testBuilder.ToExpression(); - } - - private sealed class MergedRestriction : BindingRestrictions { - internal readonly BindingRestrictions Left; - internal readonly BindingRestrictions Right; - - internal MergedRestriction(BindingRestrictions left, BindingRestrictions right) { - Left = left; - Right = right; - } - internal override Expression GetExpression() { - throw ContractUtils.Unreachable; - } - } - - private sealed class CustomRestriction : BindingRestrictions { - private readonly Expression _expression; - - internal CustomRestriction(Expression expression) { - _expression = expression; - } - - public override bool Equals(object obj) { - var other = obj as CustomRestriction; - return other != null && other._expression == _expression; - } - - public override int GetHashCode() { - return CustomRestrictionHash ^ _expression.GetHashCode(); - } - - internal override Expression GetExpression() { - return _expression; - } - } - - private sealed class TypeRestriction : BindingRestrictions { - private readonly Expression _expression; - private readonly Type _type; - - internal TypeRestriction(Expression parameter, Type type) { - _expression = parameter; - _type = type; - } - - public override bool Equals(object obj) { - var other = obj as TypeRestriction; - return other != null && TypeUtils.AreEquivalent(other._type, _type) && other._expression == _expression; - } - - public override int GetHashCode() { - return TypeRestrictionHash ^ _expression.GetHashCode() ^ _type.GetHashCode(); - } - - internal override Expression GetExpression() { - return Expression.TypeEqual(_expression, _type); - } - } - - private sealed class InstanceRestriction : BindingRestrictions { - private readonly Expression _expression; - private readonly object _instance; - - internal InstanceRestriction(Expression parameter, object instance) { - _expression = parameter; - _instance = instance; - } - - public override bool Equals(object obj) { - var other = obj as InstanceRestriction; - return other != null && other._instance == _instance && other._expression == _expression; - } - - public override int GetHashCode() { - return InstanceRestrictionHash ^ RuntimeHelpers.GetHashCode(_instance) ^ _expression.GetHashCode(); - } - - internal override Expression GetExpression() { - if (_instance == null) { - return Expression.Equal( - Expression.Convert(_expression, typeof(object)), - Expression.Constant(null) - ); - } - - ParameterExpression temp = Expression.Parameter(typeof(object), null); - return Expression.Block( - new[] { temp }, - Expression.Assign( - temp, - Expression.Property( - Expression.Constant(new WeakReference(_instance)), - typeof(WeakReference).GetProperty("Target") - ) - ), - Expression.AndAlso( - //check that WeekReference was not collected. - Expression.NotEqual(temp, Expression.Constant(null)), - Expression.Equal( - Expression.Convert(_expression, typeof(object)), - temp - ) - ) - ); - } - } - - private string DebugView { - get { return ToExpression().ToString(); } - } - - private sealed class BindingRestrictionsProxy { - private readonly BindingRestrictions _node; - - public BindingRestrictionsProxy(BindingRestrictions node) { - _node = node; - } - - public bool IsEmpty { - get { return _node == Empty; } - } - - public Expression Test { - get { return _node.ToExpression(); } - } - - public BindingRestrictions[] Restrictions { - get { - var restrictions = new List(); - - // Visit the tree, left to right - // - // Left-most node is on top of the stack, so we always expand the - // left most node each iteration. - var stack = new Stack(); - stack.Push(_node); - do { - var top = stack.Pop(); - var m = top as MergedRestriction; - if (m != null) { - stack.Push(m.Right); - stack.Push(m.Left); - } else { - restrictions.Add(top); - } - } while (stack.Count > 0); - - return restrictions.ToArray(); - } - } - - public override string ToString() { - // To prevent fxcop warning about this field - return _node.DebugView; - } - } - } -} +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +#if !FEATURE_CORE_DLR +using Microsoft.Scripting.Ast; +#else +using System.Linq.Expressions; +#endif + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Dynamic.Utils; +using System.Runtime.CompilerServices; + +namespace System.Dynamic { + + /// + /// Represents a set of binding restrictions on the under which the dynamic binding is valid. + /// + [DebuggerTypeProxy(typeof(BindingRestrictionsProxy)), DebuggerDisplay("{DebugView}")] + public abstract class BindingRestrictions { + /// + /// Represents an empty set of binding restrictions. This field is read only. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] + public static readonly BindingRestrictions Empty = new CustomRestriction(Expression.Constant(true)); + + private const int TypeRestrictionHash = 0x10000000; + private const int InstanceRestrictionHash = 0x20000000; + private const int CustomRestrictionHash = 0x40000000; + + private BindingRestrictions() { + } + + // Overridden by specialized subclasses + internal abstract Expression GetExpression(); + + /// + /// Merges the set of binding restrictions with the current binding restrictions. + /// + /// The set of restrictions with which to merge the current binding restrictions. + /// The new set of binding restrictions. + public BindingRestrictions Merge(BindingRestrictions restrictions) { + ContractUtils.RequiresNotNull(restrictions, "restrictions"); + if (this == Empty) { + return restrictions; + } + if (restrictions == Empty) { + return this; + } + return new MergedRestriction(this, restrictions); + } + + /// + /// Creates the binding restriction that check the expression for runtime type identity. + /// + /// The expression to test. + /// The exact type to test. + /// The new binding restrictions. + public static BindingRestrictions GetTypeRestriction(Expression expression, Type type) { + ContractUtils.RequiresNotNull(expression, "expression"); + ContractUtils.RequiresNotNull(type, "type"); + + return new TypeRestriction(expression, type); + } + + /// + /// The method takes a DynamicMetaObject, and returns an instance restriction for testing null if the object + /// holds a null value, otherwise returns a type restriction. + /// + internal static BindingRestrictions GetTypeRestriction(DynamicMetaObject obj) { + if (obj.Value == null && obj.HasValue) { + return BindingRestrictions.GetInstanceRestriction(obj.Expression, null); + } else { + return BindingRestrictions.GetTypeRestriction(obj.Expression, obj.LimitType); + } + } + + /// + /// Creates the binding restriction that checks the expression for object instance identity. + /// + /// The expression to test. + /// The exact object instance to test. + /// The new binding restrictions. + public static BindingRestrictions GetInstanceRestriction(Expression expression, object instance) { + ContractUtils.RequiresNotNull(expression, "expression"); + + return new InstanceRestriction(expression, instance); + } + + /// + /// Creates the binding restriction that checks the expression for arbitrary immutable properties. + /// + /// The expression expression the restrictions. + /// The new binding restrictions. + /// + /// By convention, the general restrictions created by this method must only test + /// immutable object properties. + /// + public static BindingRestrictions GetExpressionRestriction(Expression expression) { + ContractUtils.RequiresNotNull(expression, "expression"); + ContractUtils.Requires(expression.Type == typeof(bool), "expression"); + return new CustomRestriction(expression); + } + + /// + /// Combines binding restrictions from the list of instances into one set of restrictions. + /// + /// The list of instances from which to combine restrictions. + /// The new set of binding restrictions. + public static BindingRestrictions Combine(IList contributingObjects) { + BindingRestrictions res = BindingRestrictions.Empty; + if (contributingObjects != null) { + foreach (DynamicMetaObject mo in contributingObjects) { + if (mo != null) { + res = res.Merge(mo.Restrictions); + } + } + } + return res; + } + + /// + /// Builds a balanced tree of AndAlso nodes. + /// We do this so the compiler won't stack overflow if we have many + /// restrictions. + /// + private sealed class TestBuilder { + private readonly Set _unique = new Set(); + private readonly Stack _tests = new Stack(); + + private struct AndNode { + internal int Depth; + internal Expression Node; + } + + internal void Append(BindingRestrictions restrictions) { + if (_unique.Contains(restrictions)) { + return; + } + _unique.Add(restrictions); + + Push(restrictions.GetExpression(), 0); + } + + internal Expression ToExpression() { + Expression result = _tests.Pop().Node; + while (_tests.Count > 0) { + result = Expression.AndAlso(_tests.Pop().Node, result); + } + return result; + } + + private void Push(Expression node, int depth) { + while (_tests.Count > 0 && _tests.Peek().Depth == depth) { + node = Expression.AndAlso(_tests.Pop().Node, node); + depth++; + } + _tests.Push(new AndNode { Node = node, Depth = depth }); + } + } + + /// + /// Creates the representing the binding restrictions. + /// + /// The expression tree representing the restrictions. + public Expression ToExpression() { + // We could optimize this better, e.g. common subexpression elimination + // But for now, it's good enough. + + if (this == Empty) { + return Expression.Constant(true); + } + + var testBuilder = new TestBuilder(); + + // Visit the tree, left to right. + // Use an explicit stack so we don't stack overflow. + // + // Left-most node is on top of the stack, so we always expand the + // left most node each iteration. + var stack = new Stack(); + stack.Push(this); + do { + var top = stack.Pop(); + var m = top as MergedRestriction; + if (m != null) { + stack.Push(m.Right); + stack.Push(m.Left); + } else { + testBuilder.Append(top); + } + } while (stack.Count > 0); + + return testBuilder.ToExpression(); + } + + private sealed class MergedRestriction : BindingRestrictions { + internal readonly BindingRestrictions Left; + internal readonly BindingRestrictions Right; + + internal MergedRestriction(BindingRestrictions left, BindingRestrictions right) { + Left = left; + Right = right; + } + internal override Expression GetExpression() { + throw ContractUtils.Unreachable; + } + } + + private sealed class CustomRestriction : BindingRestrictions { + private readonly Expression _expression; + + internal CustomRestriction(Expression expression) { + _expression = expression; + } + + public override bool Equals(object obj) { + var other = obj as CustomRestriction; + return other != null && other._expression == _expression; + } + + public override int GetHashCode() { + return CustomRestrictionHash ^ _expression.GetHashCode(); + } + + internal override Expression GetExpression() { + return _expression; + } + } + + private sealed class TypeRestriction : BindingRestrictions { + private readonly Expression _expression; + private readonly Type _type; + + internal TypeRestriction(Expression parameter, Type type) { + _expression = parameter; + _type = type; + } + + public override bool Equals(object obj) { + var other = obj as TypeRestriction; + return other != null && TypeUtils.AreEquivalent(other._type, _type) && other._expression == _expression; + } + + public override int GetHashCode() { + return TypeRestrictionHash ^ _expression.GetHashCode() ^ _type.GetHashCode(); + } + + internal override Expression GetExpression() { + return Expression.TypeEqual(_expression, _type); + } + } + + private sealed class InstanceRestriction : BindingRestrictions { + private readonly Expression _expression; + private readonly object _instance; + + internal InstanceRestriction(Expression parameter, object instance) { + _expression = parameter; + _instance = instance; + } + + public override bool Equals(object obj) { + var other = obj as InstanceRestriction; + return other != null && other._instance == _instance && other._expression == _expression; + } + + public override int GetHashCode() { + return InstanceRestrictionHash ^ ReferenceEqualityComparer.Instance.GetHashCode(_instance) ^ _expression.GetHashCode(); + } + + internal override Expression GetExpression() { + if (_instance == null) { + return Expression.Equal( + Expression.Convert(_expression, typeof(object)), + Expression.Constant(null) + ); + } + + ParameterExpression temp = Expression.Parameter(typeof(object), null); + return Expression.Block( + new[] { temp }, + Expression.Assign( + temp, + Expression.Property( + Expression.Constant(new WeakReference(_instance)), + typeof(WeakReference).GetProperty("Target") + ) + ), + Expression.AndAlso( + //check that WeekReference was not collected. + Expression.NotEqual(temp, Expression.Constant(null)), + Expression.Equal( + Expression.Convert(_expression, typeof(object)), + temp + ) + ) + ); + } + } + + private string DebugView { + get { return ToExpression().ToString(); } + } + + private sealed class BindingRestrictionsProxy { + private readonly BindingRestrictions _node; + + public BindingRestrictionsProxy(BindingRestrictions node) { + _node = node; + } + + public bool IsEmpty { + get { return _node == Empty; } + } + + public Expression Test { + get { return _node.ToExpression(); } + } + + public BindingRestrictions[] Restrictions { + get { + var restrictions = new List(); + + // Visit the tree, left to right + // + // Left-most node is on top of the stack, so we always expand the + // left most node each iteration. + var stack = new Stack(); + stack.Push(_node); + do { + var top = stack.Pop(); + var m = top as MergedRestriction; + if (m != null) { + stack.Push(m.Right); + stack.Push(m.Left); + } else { + restrictions.Add(top); + } + } while (stack.Count > 0); + + return restrictions.ToArray(); + } + } + + public override string ToString() { + // To prevent fxcop warning about this field + return _node.DebugView; + } + } + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs index 0bb62542ac6..27289d49252 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,14 +13,11 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; #endif -#if SILVERLIGHT -using System.Core; -#endif using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs index 9dd1f34e65f..5ec58814184 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; using Microsoft.Scripting.Ast.Compiler; using Microsoft.Scripting.Utils; @@ -22,10 +22,6 @@ using System.Linq.Expressions; using System.Linq.Expressions.Compiler; #endif -#if SILVERLIGHT -using System.Core; -#endif - using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs index 03fb5d15a90..ccf1134dfa8 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,14 +13,11 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; #endif -#if SILVERLIGHT -using System.Core; -#endif using System.Collections.Generic; using System.Collections.ObjectModel; @@ -139,7 +136,7 @@ namespace System.Runtime.CompilerServices { // // finally produce the new rule if we need to // -#if !CLR2 && !SILVERLIGHT +#if !CLR2 && !SILVERLIGHT && !ANDROID && !WP75 // We cannot compile rules in the heterogeneous app domains since they // may come from less trusted sources // Silverlight always uses a homogenous appdomain, so we don’t need this check diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteHelpers.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteHelpers.cs index 38e177d1546..2bb42801830 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteHelpers.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteHelpers.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs index f13a29b0fc0..7b66829d342 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteIndexBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteIndexBinder.cs index e2523a5d0e5..1cf5abf7498 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteIndexBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DeleteIndexBinder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs index 96ffe2aecda..5db80654ba1 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,15 +13,13 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; #endif -#if SILVERLIGHT -using System.Core; -#else +#if FEATURE_REMOTING using System.Runtime.Remoting; #endif @@ -311,7 +309,7 @@ namespace System.Dynamic { ContractUtils.RequiresNotNull(expression, "expression"); IDynamicMetaObjectProvider ido = value as IDynamicMetaObjectProvider; -#if !SILVERLIGHT +#if FEATURE_REMOTING if (ido != null && !RemotingServices.IsObjectOutOfAppDomain(value)) { #else if (ido != null) { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs index 7aece9c5a03..899c45338d3 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; using Microsoft.Scripting.Ast.Compiler; #else @@ -21,9 +21,7 @@ using System.Linq.Expressions; using System.Linq.Expressions.Compiler; #endif -#if SILVERLIGHT -using System.Core; -#else +#if FEATURE_REMOTING using System.Runtime.Remoting; #endif @@ -166,8 +164,7 @@ namespace System.Dynamic { } private static BindingRestrictions AddRemoteObjectRestrictions(BindingRestrictions restrictions, object[] args, ReadOnlyCollection parameters) { -#if !SILVERLIGHT - +#if FEATURE_REMOTING for (int i = 0; i < parameters.Count; i++) { var expr = parameters[i]; var value = args[i] as MarshalByRefObject; @@ -203,7 +200,6 @@ namespace System.Dynamic { restrictions = restrictions.Merge(remotedRestriction); } } - #endif return restrictions; } @@ -279,7 +275,7 @@ namespace System.Dynamic { } } -#if !SILVERLIGHT +#if FEATURE_COM private static readonly Type ComObjectType = typeof(object).Assembly.GetType("System.__ComObject"); private static bool IsComObject(object obj) { // we can't use System.Runtime.InteropServices.Marshal.IsComObject(obj) since it doesn't work in partial trust diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs index 5d0bdf6c83a..71341f5bc2d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoClass.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoClass.cs index 8e8afbe4d67..927dab7fbf1 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoClass.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoClass.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs index 6ba7c7d510b..5f452afc3f4 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs @@ -1,1100 +1,1097 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. - * - * This source code is subject to terms and conditions of the Apache License, Version 2.0. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Apache License, Version 2.0, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Apache License, Version 2.0. - * - * You must not remove this notice, or any other, from this software. - * - * - * ***************************************************************************/ - -#if CLR2 -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Utils; -#else -using System.Linq.Expressions; -#endif -#if SILVERLIGHT -using System.Core; -#endif - -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Dynamic; -using System.Dynamic.Utils; -using System.Runtime.CompilerServices; - -namespace System.Dynamic { - /// - /// Represents an object with members that can be dynamically added and removed at runtime. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] - public sealed class ExpandoObject : IDynamicMetaObjectProvider, IDictionary, INotifyPropertyChanged { - internal readonly object LockObject; // the readonly field is used for locking the Expando object - private ExpandoData _data; // the data currently being held by the Expando object - private int _count; // the count of available members - - internal readonly static object Uninitialized = new object(); // A marker object used to identify that a value is uninitialized. - - internal const int AmbiguousMatchFound = -2; // The value is used to indicate there exists ambiguous match in the Expando object - internal const int NoMatch = -1; // The value is used to indicate there is no matching member - - private PropertyChangedEventHandler _propertyChanged; - - /// - /// Creates a new ExpandoObject with no members. - /// - public ExpandoObject() { - _data = ExpandoData.Empty; - LockObject = new object(); - } - - #region Get/Set/Delete Helpers - - /// - /// Try to get the data stored for the specified class at the specified index. If the - /// class has changed a full lookup for the slot will be performed and the correct - /// value will be retrieved. - /// - internal bool TryGetValue(object indexClass, int index, string name, bool ignoreCase, out object value) { - // read the data now. The data is immutable so we get a consistent view. - // If there's a concurrent writer they will replace data and it just appears - // that we won the race - ExpandoData data = _data; - if (data.Class != indexClass || ignoreCase) { - /* Re-search for the index matching the name here if - * 1) the class has changed, we need to get the correct index and return - * the value there. - * 2) the search is case insensitive: - * a. the member specified by index may be deleted, but there might be other - * members matching the name if the binder is case insensitive. - * b. the member that exactly matches the name didn't exist before and exists now, - * need to find the exact match. - */ - index = data.Class.GetValueIndex(name, ignoreCase, this); - if (index == ExpandoObject.AmbiguousMatchFound) { - throw Error.AmbiguousMatchInExpandoObject(name); - } - } - - if (index == ExpandoObject.NoMatch) { - value = null; - return false; - } - - // Capture the value into a temp, so it doesn't get mutated after we check - // for Uninitialized. - object temp = data[index]; - if (temp == Uninitialized) { - value = null; - return false; - } - - // index is now known to be correct - value = temp; - return true; - } - - /// - /// Sets the data for the specified class at the specified index. If the class has - /// changed then a full look for the slot will be performed. If the new class does - /// not have the provided slot then the Expando's class will change. Only case sensitive - /// setter is supported in ExpandoObject. - /// - internal void TrySetValue(object indexClass, int index, object value, string name, bool ignoreCase, bool add) { - ExpandoData data; - object oldValue; - - lock (LockObject) { - data = _data; - - if (data.Class != indexClass || ignoreCase) { - // The class has changed or we are doing a case-insensitive search, - // we need to get the correct index and set the value there. If we - // don't have the value then we need to promote the class - that - // should only happen when we have multiple concurrent writers. - index = data.Class.GetValueIndex(name, ignoreCase, this); - if (index == ExpandoObject.AmbiguousMatchFound) { - throw Error.AmbiguousMatchInExpandoObject(name); - } - if (index == ExpandoObject.NoMatch) { - // Before creating a new class with the new member, need to check - // if there is the exact same member but is deleted. We should reuse - // the class if there is such a member. - int exactMatch = ignoreCase ? - data.Class.GetValueIndexCaseSensitive(name) : - index; - if (exactMatch != ExpandoObject.NoMatch) { - Debug.Assert(data[exactMatch] == Uninitialized); - index = exactMatch; - } else { - ExpandoClass newClass = data.Class.FindNewClass(name); - data = PromoteClassCore(data.Class, newClass); - // After the class promotion, there must be an exact match, - // so we can do case-sensitive search here. - index = data.Class.GetValueIndexCaseSensitive(name); - Debug.Assert(index != ExpandoObject.NoMatch); - } - } - } - - // Setting an uninitialized member increases the count of available members - oldValue = data[index]; - if (oldValue == Uninitialized) { - _count++; - } else if (add) { - throw Error.SameKeyExistsInExpando(name); - } - - data[index] = value; - } - - // Notify property changed, outside of the lock. - var propertyChanged = _propertyChanged; - if (propertyChanged != null && value != oldValue) { - // Use the canonical case for the key. - propertyChanged(this, new PropertyChangedEventArgs(data.Class.Keys[index])); - } - } - - /// - /// Deletes the data stored for the specified class at the specified index. - /// - internal bool TryDeleteValue(object indexClass, int index, string name, bool ignoreCase, object deleteValue) { - ExpandoData data; - lock (LockObject) { - data = _data; - - if (data.Class != indexClass || ignoreCase) { - // the class has changed or we are doing a case-insensitive search, - // we need to get the correct index. If there is no associated index - // we simply can't have the value and we return false. - index = data.Class.GetValueIndex(name, ignoreCase, this); - if (index == ExpandoObject.AmbiguousMatchFound) { - throw Error.AmbiguousMatchInExpandoObject(name); - } - } - if (index == ExpandoObject.NoMatch) { - return false; - } - - object oldValue = data[index]; - if (oldValue == Uninitialized) { - return false; - } - - // Make sure the value matches, if requested. - // - // It's a shame we have to call Equals with the lock held but - // there doesn't seem to be a good way around that, and - // ConcurrentDictionary in mscorlib does the same thing. - if (deleteValue != Uninitialized && !object.Equals(oldValue, deleteValue)) { - return false; - } - - data[index] = Uninitialized; - - // Deleting an available member decreases the count of available members - _count--; - } - - // Notify property changed, outside of the lock. - var propertyChanged = _propertyChanged; - if (propertyChanged != null) { - // Use the canonical case for the key. - propertyChanged(this, new PropertyChangedEventArgs(data.Class.Keys[index])); - } - - return true; - } - - /// - /// Returns true if the member at the specified index has been deleted, - /// otherwise false. Call this function holding the lock. - /// - internal bool IsDeletedMember(int index) { - Debug.Assert(index >= 0 && index <= _data.Length); - - if (index == _data.Length) { - // The member is a newly added by SetMemberBinder and not in data yet - return false; - } - - return _data[index] == ExpandoObject.Uninitialized; - } - - /// - /// Exposes the ExpandoClass which we've associated with this - /// Expando object. Used for type checks in rules. - /// - internal ExpandoClass Class { - get { - return _data.Class; - } - } - - /// - /// Promotes the class from the old type to the new type and returns the new - /// ExpandoData object. - /// - private ExpandoData PromoteClassCore(ExpandoClass oldClass, ExpandoClass newClass) { - Debug.Assert(oldClass != newClass); - - lock (LockObject) { - if (_data.Class == oldClass) { - _data = _data.UpdateClass(newClass); - } - return _data; - } - } - - /// - /// Internal helper to promote a class. Called from our RuntimeOps helper. This - /// version simply doesn't expose the ExpandoData object which is a private - /// data structure. - /// - internal void PromoteClass(object oldClass, object newClass) { - PromoteClassCore((ExpandoClass)oldClass, (ExpandoClass)newClass); - } - - #endregion - - #region IDynamicMetaObjectProvider Members - - DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter) { - return new MetaExpando(parameter, this); - } - #endregion - - #region Helper methods - private void TryAddMember(string key, object value) { - ContractUtils.RequiresNotNull(key, "key"); - // Pass null to the class, which forces lookup. - TrySetValue(null, -1, value, key, false, true); - } - - private bool TryGetValueForKey(string key, out object value) { - // Pass null to the class, which forces lookup. - return TryGetValue(null, -1, key, false, out value); - } - - private bool ExpandoContainsKey(string key) { - return _data.Class.GetValueIndexCaseSensitive(key) >= 0; - } - - // We create a non-generic type for the debug view for each different collection type - // that uses DebuggerTypeProxy, instead of defining a generic debug view type and - // using different instantiations. The reason for this is that support for generics - // with using DebuggerTypeProxy is limited. For C#, DebuggerTypeProxy supports only - // open types (from MSDN http://msdn.microsoft.com/en-us/library/d8eyd8zc.aspx). - private sealed class KeyCollectionDebugView { - private ICollection collection; - public KeyCollectionDebugView(ICollection collection) { - Debug.Assert(collection != null); - this.collection = collection; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public string[] Items { - get { - string[] items = new string[collection.Count]; - collection.CopyTo(items, 0); - return items; - } - } - } - - [DebuggerTypeProxy(typeof(KeyCollectionDebugView))] - [DebuggerDisplay("Count = {Count}")] - private class KeyCollection : ICollection { - private readonly ExpandoObject _expando; - private readonly int _expandoVersion; - private readonly int _expandoCount; - private readonly ExpandoData _expandoData; - - internal KeyCollection(ExpandoObject expando) { - lock (expando.LockObject) { - _expando = expando; - _expandoVersion = expando._data.Version; - _expandoCount = expando._count; - _expandoData = expando._data; - } - } - - private void CheckVersion() { - if (_expando._data.Version != _expandoVersion || _expandoData != _expando._data) { - //the underlying expando object has changed - throw Error.CollectionModifiedWhileEnumerating(); - } - } - - #region ICollection Members - - public void Add(string item) { - throw Error.CollectionReadOnly(); - } - - public void Clear() { - throw Error.CollectionReadOnly(); - } - - public bool Contains(string item) { - lock (_expando.LockObject) { - CheckVersion(); - return _expando.ExpandoContainsKey(item); - } - } - - public void CopyTo(string[] array, int arrayIndex) { - ContractUtils.RequiresNotNull(array, "array"); - ContractUtils.RequiresArrayRange(array, arrayIndex, _expandoCount, "arrayIndex", "Count"); - lock (_expando.LockObject) { - CheckVersion(); - ExpandoData data = _expando._data; - for (int i = 0; i < data.Class.Keys.Length; i++) { - if (data[i] != Uninitialized) { - array[arrayIndex++] = data.Class.Keys[i]; - } - } - } - } - - public int Count { - get { - CheckVersion(); - return _expandoCount; - } - } - - public bool IsReadOnly { - get { return true; } - } - - public bool Remove(string item) { - throw Error.CollectionReadOnly(); - } - - #endregion - - #region IEnumerable Members - - public IEnumerator GetEnumerator() { - for (int i = 0, n = _expandoData.Class.Keys.Length; i < n; i++) { - CheckVersion(); - if (_expandoData[i] != Uninitialized) { - yield return _expandoData.Class.Keys[i]; - } - } - } - - #endregion - - #region IEnumerable Members - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { - return GetEnumerator(); - } - - #endregion - } - - // We create a non-generic type for the debug view for each different collection type - // that uses DebuggerTypeProxy, instead of defining a generic debug view type and - // using different instantiations. The reason for this is that support for generics - // with using DebuggerTypeProxy is limited. For C#, DebuggerTypeProxy supports only - // open types (from MSDN http://msdn.microsoft.com/en-us/library/d8eyd8zc.aspx). - private sealed class ValueCollectionDebugView { - private ICollection collection; - public ValueCollectionDebugView(ICollection collection) { - Debug.Assert(collection != null); - this.collection = collection; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public object[] Items { - get { - object[] items = new object[collection.Count]; - collection.CopyTo(items, 0); - return items; - } - } - } - - [DebuggerTypeProxy(typeof(ValueCollectionDebugView))] - [DebuggerDisplay("Count = {Count}")] - private class ValueCollection : ICollection { - private readonly ExpandoObject _expando; - private readonly int _expandoVersion; - private readonly int _expandoCount; - private readonly ExpandoData _expandoData; - - internal ValueCollection(ExpandoObject expando) { - lock (expando.LockObject) { - _expando = expando; - _expandoVersion = expando._data.Version; - _expandoCount = expando._count; - _expandoData = expando._data; - } - } - - private void CheckVersion() { - if (_expando._data.Version != _expandoVersion || _expandoData != _expando._data) { - //the underlying expando object has changed - throw Error.CollectionModifiedWhileEnumerating(); - } - } - - #region ICollection Members - - public void Add(object item) { - throw Error.CollectionReadOnly(); - } - - public void Clear() { - throw Error.CollectionReadOnly(); - } - - public bool Contains(object item) { - lock (_expando.LockObject) { - CheckVersion(); - - ExpandoData data = _expando._data; - for (int i = 0; i < data.Class.Keys.Length; i++) { - - // See comment in TryDeleteValue; it's okay to call - // object.Equals with the lock held. - if (object.Equals(data[i], item)) { - return true; - } - } - return false; - } - } - - public void CopyTo(object[] array, int arrayIndex) { - ContractUtils.RequiresNotNull(array, "array"); - ContractUtils.RequiresArrayRange(array, arrayIndex, _expandoCount, "arrayIndex", "Count"); - lock (_expando.LockObject) { - CheckVersion(); - ExpandoData data = _expando._data; - for (int i = 0; i < data.Class.Keys.Length; i++) { - if (data[i] != Uninitialized) { - array[arrayIndex++] = data[i]; - } - } - } - } - - public int Count { - get { - CheckVersion(); - return _expandoCount; - } - } - - public bool IsReadOnly { - get { return true; } - } - - public bool Remove(object item) { - throw Error.CollectionReadOnly(); - } - - #endregion - - #region IEnumerable Members - - public IEnumerator GetEnumerator() { - ExpandoData data = _expando._data; - for (int i = 0; i < data.Class.Keys.Length; i++) { - CheckVersion(); - // Capture the value into a temp so we don't inadvertently - // return Uninitialized. - object temp = data[i]; - if (temp != Uninitialized) { - yield return temp; - } - } - } - - #endregion - - #region IEnumerable Members - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { - return GetEnumerator(); - } - - #endregion - } - - #endregion - - #region IDictionary Members - ICollection IDictionary.Keys { - get { - return new KeyCollection(this); - } - } - - ICollection IDictionary.Values { - get { - return new ValueCollection(this); - } - } - - object IDictionary.this[string key] { - get { - object value; - if (!TryGetValueForKey(key, out value)) { - throw Error.KeyDoesNotExistInExpando(key); - } - return value; - } - set { - ContractUtils.RequiresNotNull(key, "key"); - // Pass null to the class, which forces lookup. - TrySetValue(null, -1, value, key, false, false); - } - } - - void IDictionary.Add(string key, object value) { - this.TryAddMember(key, value); - } - - bool IDictionary.ContainsKey(string key) { - ContractUtils.RequiresNotNull(key, "key"); - - ExpandoData data = _data; - int index = data.Class.GetValueIndexCaseSensitive(key); - return index >= 0 && data[index] != Uninitialized; - } - - bool IDictionary.Remove(string key) { - ContractUtils.RequiresNotNull(key, "key"); - // Pass null to the class, which forces lookup. - return TryDeleteValue(null, -1, key, false, Uninitialized); - } - - bool IDictionary.TryGetValue(string key, out object value) { - return TryGetValueForKey(key, out value); - } - - #endregion - - #region ICollection> Members - int ICollection>.Count { - get { - return _count; - } - } - - bool ICollection>.IsReadOnly { - get { return false; } - } - - void ICollection>.Add(KeyValuePair item) { - TryAddMember(item.Key, item.Value); - } - - void ICollection>.Clear() { - // We remove both class and data! - ExpandoData data; - lock (LockObject) { - data = _data; - _data = ExpandoData.Empty; - _count = 0; - } - - // Notify property changed for all properties. - var propertyChanged = _propertyChanged; - if (propertyChanged != null) { - for (int i = 0, n = data.Class.Keys.Length; i < n; i++) { - if (data[i] != Uninitialized) { - propertyChanged(this, new PropertyChangedEventArgs(data.Class.Keys[i])); - } - } - } - } - - bool ICollection>.Contains(KeyValuePair item) { - object value; - if (!TryGetValueForKey(item.Key, out value)) { - return false; - } - - return object.Equals(value, item.Value); - } - - void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) { - ContractUtils.RequiresNotNull(array, "array"); - ContractUtils.RequiresArrayRange(array, arrayIndex, _count, "arrayIndex", "Count"); - - // We want this to be atomic and not throw - lock (LockObject) { - foreach (KeyValuePair item in this) { - array[arrayIndex++] = item; - } - } - } - - bool ICollection>.Remove(KeyValuePair item) { - return TryDeleteValue(null, -1, item.Key, false, item.Value); - } - #endregion - - #region IEnumerable> Member - - IEnumerator> IEnumerable>.GetEnumerator() { - ExpandoData data = _data; - return GetExpandoEnumerator(data, data.Version); - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { - ExpandoData data = _data; - return GetExpandoEnumerator(data, data.Version); - } - - // Note: takes the data and version as parameters so they will be - // captured before the first call to MoveNext(). - private IEnumerator> GetExpandoEnumerator(ExpandoData data, int version) { - for (int i = 0; i < data.Class.Keys.Length; i++) { - if (_data.Version != version || data != _data) { - // The underlying expando object has changed: - // 1) the version of the expando data changed - // 2) the data object is changed - throw Error.CollectionModifiedWhileEnumerating(); - } - // Capture the value into a temp so we don't inadvertently - // return Uninitialized. - object temp = data[i]; - if (temp != Uninitialized) { - yield return new KeyValuePair(data.Class.Keys[i], temp); - } - } - } - #endregion - - #region MetaExpando - - private class MetaExpando : DynamicMetaObject { - public MetaExpando(Expression expression, ExpandoObject value) - : base(expression, BindingRestrictions.Empty, value) { - } - - private DynamicMetaObject BindGetOrInvokeMember(DynamicMetaObjectBinder binder, string name, bool ignoreCase, DynamicMetaObject fallback, Func fallbackInvoke) { - ExpandoClass klass = Value.Class; - - //try to find the member, including the deleted members - int index = klass.GetValueIndex(name, ignoreCase, Value); - - ParameterExpression value = Expression.Parameter(typeof(object), "value"); - - Expression tryGetValue = Expression.Call( - typeof(RuntimeOps).GetMethod("ExpandoTryGetValue"), - GetLimitedSelf(), - Expression.Constant(klass, typeof(object)), - Expression.Constant(index), - Expression.Constant(name), - Expression.Constant(ignoreCase), - value - ); - - var result = new DynamicMetaObject(value, BindingRestrictions.Empty); - if (fallbackInvoke != null) { - result = fallbackInvoke(result); - } - - result = new DynamicMetaObject( - Expression.Block( - new[] { value }, - Expression.Condition( - tryGetValue, - result.Expression, - fallback.Expression, - typeof(object) - ) - ), - result.Restrictions.Merge(fallback.Restrictions) - ); - - return AddDynamicTestAndDefer(binder, Value.Class, null, result); - } - - public override DynamicMetaObject BindGetMember(GetMemberBinder binder) { - ContractUtils.RequiresNotNull(binder, "binder"); - return BindGetOrInvokeMember( - binder, - binder.Name, - binder.IgnoreCase, - binder.FallbackGetMember(this), - null - ); - } - - public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) { - ContractUtils.RequiresNotNull(binder, "binder"); - return BindGetOrInvokeMember( - binder, - binder.Name, - binder.IgnoreCase, - binder.FallbackInvokeMember(this, args), - value => binder.FallbackInvoke(value, args, null) - ); - } - - public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) { - ContractUtils.RequiresNotNull(binder, "binder"); - ContractUtils.RequiresNotNull(value, "value"); - - ExpandoClass klass; - int index; - - ExpandoClass originalClass = GetClassEnsureIndex(binder.Name, binder.IgnoreCase, Value, out klass, out index); - - return AddDynamicTestAndDefer( - binder, - klass, - originalClass, - new DynamicMetaObject( - Expression.Call( - typeof(RuntimeOps).GetMethod("ExpandoTrySetValue"), - GetLimitedSelf(), - Expression.Constant(klass, typeof(object)), - Expression.Constant(index), - Expression.Convert(value.Expression, typeof(object)), - Expression.Constant(binder.Name), - Expression.Constant(binder.IgnoreCase) - ), - BindingRestrictions.Empty - ) - ); - } - - public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { - ContractUtils.RequiresNotNull(binder, "binder"); - - int index = Value.Class.GetValueIndex(binder.Name, binder.IgnoreCase, Value); - - Expression tryDelete = Expression.Call( - typeof(RuntimeOps).GetMethod("ExpandoTryDeleteValue"), - GetLimitedSelf(), - Expression.Constant(Value.Class, typeof(object)), - Expression.Constant(index), - Expression.Constant(binder.Name), - Expression.Constant(binder.IgnoreCase) - ); - DynamicMetaObject fallback = binder.FallbackDeleteMember(this); - - DynamicMetaObject target = new DynamicMetaObject( - Expression.IfThen(Expression.Not(tryDelete), fallback.Expression), - fallback.Restrictions - ); - - return AddDynamicTestAndDefer(binder, Value.Class, null, target); - } - - public override IEnumerable GetDynamicMemberNames() { - var expandoData = Value._data; - var klass = expandoData.Class; - for (int i = 0; i < klass.Keys.Length; i++) { - object val = expandoData[i]; - if (val != ExpandoObject.Uninitialized) { - yield return klass.Keys[i]; - } - } - } - - /// - /// Adds a dynamic test which checks if the version has changed. The test is only necessary for - /// performance as the methods will do the correct thing if called with an incorrect version. - /// - private DynamicMetaObject AddDynamicTestAndDefer(DynamicMetaObjectBinder binder, ExpandoClass klass, ExpandoClass originalClass, DynamicMetaObject succeeds) { - - Expression ifTestSucceeds = succeeds.Expression; - if (originalClass != null) { - // we are accessing a member which has not yet been defined on this class. - // We force a class promotion after the type check. If the class changes the - // promotion will fail and the set/delete will do a full lookup using the new - // class to discover the name. - Debug.Assert(originalClass != klass); - - ifTestSucceeds = Expression.Block( - Expression.Call( - null, - typeof(RuntimeOps).GetMethod("ExpandoPromoteClass"), - GetLimitedSelf(), - Expression.Constant(originalClass, typeof(object)), - Expression.Constant(klass, typeof(object)) - ), - succeeds.Expression - ); - } - - return new DynamicMetaObject( - Expression.Condition( - Expression.Call( - null, - typeof(RuntimeOps).GetMethod("ExpandoCheckVersion"), - GetLimitedSelf(), - Expression.Constant(originalClass ?? klass, typeof(object)) - ), - ifTestSucceeds, - binder.GetUpdateExpression(ifTestSucceeds.Type) - ), - GetRestrictions().Merge(succeeds.Restrictions) - ); - } - - /// - /// Gets the class and the index associated with the given name. Does not update the expando object. Instead - /// this returns both the original and desired new class. A rule is created which includes the test for the - /// original class, the promotion to the new class, and the set/delete based on the class post-promotion. - /// - private ExpandoClass GetClassEnsureIndex(string name, bool caseInsensitive, ExpandoObject obj, out ExpandoClass klass, out int index) { - ExpandoClass originalClass = Value.Class; - - index = originalClass.GetValueIndex(name, caseInsensitive, obj) ; - if (index == ExpandoObject.AmbiguousMatchFound) { - klass = originalClass; - return null; - } - if (index == ExpandoObject.NoMatch) { - // go ahead and find a new class now... - ExpandoClass newClass = originalClass.FindNewClass(name); - - klass = newClass; - index = newClass.GetValueIndexCaseSensitive(name); - - Debug.Assert(index != ExpandoObject.NoMatch); - return originalClass; - } else { - klass = originalClass; - return null; - } - } - - /// - /// Returns our Expression converted to our known LimitType - /// - private Expression GetLimitedSelf() { - if (TypeUtils.AreEquivalent(Expression.Type, LimitType)) { - return Expression; - } - return Expression.Convert(Expression, LimitType); - } - - /// - /// Returns a Restrictions object which includes our current restrictions merged - /// with a restriction limiting our type - /// - private BindingRestrictions GetRestrictions() { - Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty"); - - return BindingRestrictions.GetTypeRestriction(this); - } - - public new ExpandoObject Value { - get { - return (ExpandoObject)base.Value; - } - } - } - - #endregion - - #region ExpandoData - - /// - /// Stores the class and the data associated with the class as one atomic - /// pair. This enables us to do a class check in a thread safe manner w/o - /// requiring locks. - /// - private class ExpandoData { - internal static ExpandoData Empty = new ExpandoData(); - - /// - /// the dynamically assigned class associated with the Expando object - /// - internal readonly ExpandoClass Class; - - /// - /// data stored in the expando object, key names are stored in the class. - /// - /// Expando._data must be locked when mutating the value. Otherwise a copy of it - /// could be made and lose values. - /// - private readonly object[] _dataArray; - - /// - /// Indexer for getting/setting the data - /// - internal object this[int index] { - get { - return _dataArray[index]; - } - set { - //when the array is updated, version increases, even the new value is the same - //as previous. Dictionary type has the same behavior. - _version++; - _dataArray[index] = value; - } - } - - internal int Version { - get { return _version; } - } - - internal int Length { - get { return _dataArray.Length; } - } - - /// - /// Constructs an empty ExpandoData object with the empty class and no data. - /// - private ExpandoData() { - Class = ExpandoClass.Empty; - _dataArray = new object[0]; - } - - /// - /// the version of the ExpandoObject that tracks set and delete operations - /// - private int _version; - - /// - /// Constructs a new ExpandoData object with the specified class and data. - /// - internal ExpandoData(ExpandoClass klass, object[] data, int version) { - Class = klass; - _dataArray = data; - _version = version; - } - - /// - /// Update the associated class and increases the storage for the data array if needed. - /// - /// - internal ExpandoData UpdateClass(ExpandoClass newClass) { - if (_dataArray.Length >= newClass.Keys.Length) { - // we have extra space in our buffer, just initialize it to Uninitialized. - this[newClass.Keys.Length - 1] = ExpandoObject.Uninitialized; - return new ExpandoData(newClass, this._dataArray, this._version); - } else { - // we've grown too much - we need a new object array - int oldLength = _dataArray.Length; - object[] arr = new object[GetAlignedSize(newClass.Keys.Length)]; - Array.Copy(_dataArray, arr, _dataArray.Length); - ExpandoData newData = new ExpandoData(newClass, arr, this._version); - newData[oldLength] = ExpandoObject.Uninitialized; - return newData; - } - } - - private static int GetAlignedSize(int len) { - // the alignment of the array for storage of values (must be a power of two) - const int DataArrayAlignment = 8; - - // round up and then mask off lower bits - return (len + (DataArrayAlignment - 1)) & (~(DataArrayAlignment - 1)); - } - } - - #endregion - - #region INotifyPropertyChanged Members - - event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { - add { _propertyChanged += value; } - remove { _propertyChanged -= value; } - } - - #endregion - } -} - -namespace System.Runtime.CompilerServices { - - // - // Note: these helpers are kept as simple wrappers so they have a better - // chance of being inlined. - // - public static partial class RuntimeOps { - - /// - /// Gets the value of an item in an expando object. - /// - /// The expando object. - /// The class of the expando object. - /// The index of the member. - /// The name of the member. - /// true if the name should be matched ignoring case; false otherwise. - /// The out parameter containing the value of the member. - /// True if the member exists in the expando object, otherwise false. - [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] - public static bool ExpandoTryGetValue(ExpandoObject expando, object indexClass, int index, string name, bool ignoreCase, out object value) { - return expando.TryGetValue(indexClass, index, name, ignoreCase, out value); - } - - /// - /// Sets the value of an item in an expando object. - /// - /// The expando object. - /// The class of the expando object. - /// The index of the member. - /// The value of the member. - /// The name of the member. - /// true if the name should be matched ignoring case; false otherwise. - /// - /// Returns the index for the set member. - /// - [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] - public static object ExpandoTrySetValue(ExpandoObject expando, object indexClass, int index, object value, string name, bool ignoreCase) { - expando.TrySetValue(indexClass, index, value, name, ignoreCase, false); - return value; - } - - /// - /// Deletes the value of an item in an expando object. - /// - /// The expando object. - /// The class of the expando object. - /// The index of the member. - /// The name of the member. - /// true if the name should be matched ignoring case; false otherwise. - /// true if the item was successfully removed; otherwise, false. - [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] - public static bool ExpandoTryDeleteValue(ExpandoObject expando, object indexClass, int index, string name, bool ignoreCase) { - return expando.TryDeleteValue(indexClass, index, name, ignoreCase, ExpandoObject.Uninitialized); - } - - /// - /// Checks the version of the expando object. - /// - /// The expando object. - /// The version to check. - /// true if the version is equal; otherwise, false. - [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] - public static bool ExpandoCheckVersion(ExpandoObject expando, object version) { - return expando.Class == version; - } - - /// - /// Promotes an expando object from one class to a new class. - /// - /// The expando object. - /// The old class of the expando object. - /// The new class of the expando object. - [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] - public static void ExpandoPromoteClass(ExpandoObject expando, object oldClass, object newClass) { - expando.PromoteClass(oldClass, newClass); - } - } -} - +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +#if !FEATURE_CORE_DLR +using Microsoft.Scripting.Ast; +using Microsoft.Scripting.Utils; +#else +using System.Linq.Expressions; +#endif + +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Dynamic; +using System.Dynamic.Utils; +using System.Runtime.CompilerServices; + +namespace System.Dynamic { + /// + /// Represents an object with members that can be dynamically added and removed at runtime. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] + public sealed class ExpandoObject : IDynamicMetaObjectProvider, IDictionary, INotifyPropertyChanged { + internal readonly object LockObject; // the readonly field is used for locking the Expando object + private ExpandoData _data; // the data currently being held by the Expando object + private int _count; // the count of available members + + internal readonly static object Uninitialized = new object(); // A marker object used to identify that a value is uninitialized. + + internal const int AmbiguousMatchFound = -2; // The value is used to indicate there exists ambiguous match in the Expando object + internal const int NoMatch = -1; // The value is used to indicate there is no matching member + + private PropertyChangedEventHandler _propertyChanged; + + /// + /// Creates a new ExpandoObject with no members. + /// + public ExpandoObject() { + _data = ExpandoData.Empty; + LockObject = new object(); + } + + #region Get/Set/Delete Helpers + + /// + /// Try to get the data stored for the specified class at the specified index. If the + /// class has changed a full lookup for the slot will be performed and the correct + /// value will be retrieved. + /// + internal bool TryGetValue(object indexClass, int index, string name, bool ignoreCase, out object value) { + // read the data now. The data is immutable so we get a consistent view. + // If there's a concurrent writer they will replace data and it just appears + // that we won the race + ExpandoData data = _data; + if (data.Class != indexClass || ignoreCase) { + /* Re-search for the index matching the name here if + * 1) the class has changed, we need to get the correct index and return + * the value there. + * 2) the search is case insensitive: + * a. the member specified by index may be deleted, but there might be other + * members matching the name if the binder is case insensitive. + * b. the member that exactly matches the name didn't exist before and exists now, + * need to find the exact match. + */ + index = data.Class.GetValueIndex(name, ignoreCase, this); + if (index == ExpandoObject.AmbiguousMatchFound) { + throw Error.AmbiguousMatchInExpandoObject(name); + } + } + + if (index == ExpandoObject.NoMatch) { + value = null; + return false; + } + + // Capture the value into a temp, so it doesn't get mutated after we check + // for Uninitialized. + object temp = data[index]; + if (temp == Uninitialized) { + value = null; + return false; + } + + // index is now known to be correct + value = temp; + return true; + } + + /// + /// Sets the data for the specified class at the specified index. If the class has + /// changed then a full look for the slot will be performed. If the new class does + /// not have the provided slot then the Expando's class will change. Only case sensitive + /// setter is supported in ExpandoObject. + /// + internal void TrySetValue(object indexClass, int index, object value, string name, bool ignoreCase, bool add) { + ExpandoData data; + object oldValue; + + lock (LockObject) { + data = _data; + + if (data.Class != indexClass || ignoreCase) { + // The class has changed or we are doing a case-insensitive search, + // we need to get the correct index and set the value there. If we + // don't have the value then we need to promote the class - that + // should only happen when we have multiple concurrent writers. + index = data.Class.GetValueIndex(name, ignoreCase, this); + if (index == ExpandoObject.AmbiguousMatchFound) { + throw Error.AmbiguousMatchInExpandoObject(name); + } + if (index == ExpandoObject.NoMatch) { + // Before creating a new class with the new member, need to check + // if there is the exact same member but is deleted. We should reuse + // the class if there is such a member. + int exactMatch = ignoreCase ? + data.Class.GetValueIndexCaseSensitive(name) : + index; + if (exactMatch != ExpandoObject.NoMatch) { + Debug.Assert(data[exactMatch] == Uninitialized); + index = exactMatch; + } else { + ExpandoClass newClass = data.Class.FindNewClass(name); + data = PromoteClassCore(data.Class, newClass); + // After the class promotion, there must be an exact match, + // so we can do case-sensitive search here. + index = data.Class.GetValueIndexCaseSensitive(name); + Debug.Assert(index != ExpandoObject.NoMatch); + } + } + } + + // Setting an uninitialized member increases the count of available members + oldValue = data[index]; + if (oldValue == Uninitialized) { + _count++; + } else if (add) { + throw Error.SameKeyExistsInExpando(name); + } + + data[index] = value; + } + + // Notify property changed, outside of the lock. + var propertyChanged = _propertyChanged; + if (propertyChanged != null && value != oldValue) { + // Use the canonical case for the key. + propertyChanged(this, new PropertyChangedEventArgs(data.Class.Keys[index])); + } + } + + /// + /// Deletes the data stored for the specified class at the specified index. + /// + internal bool TryDeleteValue(object indexClass, int index, string name, bool ignoreCase, object deleteValue) { + ExpandoData data; + lock (LockObject) { + data = _data; + + if (data.Class != indexClass || ignoreCase) { + // the class has changed or we are doing a case-insensitive search, + // we need to get the correct index. If there is no associated index + // we simply can't have the value and we return false. + index = data.Class.GetValueIndex(name, ignoreCase, this); + if (index == ExpandoObject.AmbiguousMatchFound) { + throw Error.AmbiguousMatchInExpandoObject(name); + } + } + if (index == ExpandoObject.NoMatch) { + return false; + } + + object oldValue = data[index]; + if (oldValue == Uninitialized) { + return false; + } + + // Make sure the value matches, if requested. + // + // It's a shame we have to call Equals with the lock held but + // there doesn't seem to be a good way around that, and + // ConcurrentDictionary in mscorlib does the same thing. + if (deleteValue != Uninitialized && !object.Equals(oldValue, deleteValue)) { + return false; + } + + data[index] = Uninitialized; + + // Deleting an available member decreases the count of available members + _count--; + } + + // Notify property changed, outside of the lock. + var propertyChanged = _propertyChanged; + if (propertyChanged != null) { + // Use the canonical case for the key. + propertyChanged(this, new PropertyChangedEventArgs(data.Class.Keys[index])); + } + + return true; + } + + /// + /// Returns true if the member at the specified index has been deleted, + /// otherwise false. Call this function holding the lock. + /// + internal bool IsDeletedMember(int index) { + Debug.Assert(index >= 0 && index <= _data.Length); + + if (index == _data.Length) { + // The member is a newly added by SetMemberBinder and not in data yet + return false; + } + + return _data[index] == ExpandoObject.Uninitialized; + } + + /// + /// Exposes the ExpandoClass which we've associated with this + /// Expando object. Used for type checks in rules. + /// + internal ExpandoClass Class { + get { + return _data.Class; + } + } + + /// + /// Promotes the class from the old type to the new type and returns the new + /// ExpandoData object. + /// + private ExpandoData PromoteClassCore(ExpandoClass oldClass, ExpandoClass newClass) { + Debug.Assert(oldClass != newClass); + + lock (LockObject) { + if (_data.Class == oldClass) { + _data = _data.UpdateClass(newClass); + } + return _data; + } + } + + /// + /// Internal helper to promote a class. Called from our RuntimeOps helper. This + /// version simply doesn't expose the ExpandoData object which is a private + /// data structure. + /// + internal void PromoteClass(object oldClass, object newClass) { + PromoteClassCore((ExpandoClass)oldClass, (ExpandoClass)newClass); + } + + #endregion + + #region IDynamicMetaObjectProvider Members + + DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter) { + return new MetaExpando(parameter, this); + } + #endregion + + #region Helper methods + private void TryAddMember(string key, object value) { + ContractUtils.RequiresNotNull(key, "key"); + // Pass null to the class, which forces lookup. + TrySetValue(null, -1, value, key, false, true); + } + + private bool TryGetValueForKey(string key, out object value) { + // Pass null to the class, which forces lookup. + return TryGetValue(null, -1, key, false, out value); + } + + private bool ExpandoContainsKey(string key) { + return _data.Class.GetValueIndexCaseSensitive(key) >= 0; + } + + // We create a non-generic type for the debug view for each different collection type + // that uses DebuggerTypeProxy, instead of defining a generic debug view type and + // using different instantiations. The reason for this is that support for generics + // with using DebuggerTypeProxy is limited. For C#, DebuggerTypeProxy supports only + // open types (from MSDN http://msdn.microsoft.com/en-us/library/d8eyd8zc.aspx). + private sealed class KeyCollectionDebugView { + private ICollection collection; + public KeyCollectionDebugView(ICollection collection) { + Debug.Assert(collection != null); + this.collection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public string[] Items { + get { + string[] items = new string[collection.Count]; + collection.CopyTo(items, 0); + return items; + } + } + } + + [DebuggerTypeProxy(typeof(KeyCollectionDebugView))] + [DebuggerDisplay("Count = {Count}")] + private class KeyCollection : ICollection { + private readonly ExpandoObject _expando; + private readonly int _expandoVersion; + private readonly int _expandoCount; + private readonly ExpandoData _expandoData; + + internal KeyCollection(ExpandoObject expando) { + lock (expando.LockObject) { + _expando = expando; + _expandoVersion = expando._data.Version; + _expandoCount = expando._count; + _expandoData = expando._data; + } + } + + private void CheckVersion() { + if (_expando._data.Version != _expandoVersion || _expandoData != _expando._data) { + //the underlying expando object has changed + throw Error.CollectionModifiedWhileEnumerating(); + } + } + + #region ICollection Members + + public void Add(string item) { + throw Error.CollectionReadOnly(); + } + + public void Clear() { + throw Error.CollectionReadOnly(); + } + + public bool Contains(string item) { + lock (_expando.LockObject) { + CheckVersion(); + return _expando.ExpandoContainsKey(item); + } + } + + public void CopyTo(string[] array, int arrayIndex) { + ContractUtils.RequiresNotNull(array, "array"); + ContractUtils.RequiresArrayRange(array, arrayIndex, _expandoCount, "arrayIndex", "Count"); + lock (_expando.LockObject) { + CheckVersion(); + ExpandoData data = _expando._data; + for (int i = 0; i < data.Class.Keys.Length; i++) { + if (data[i] != Uninitialized) { + array[arrayIndex++] = data.Class.Keys[i]; + } + } + } + } + + public int Count { + get { + CheckVersion(); + return _expandoCount; + } + } + + public bool IsReadOnly { + get { return true; } + } + + public bool Remove(string item) { + throw Error.CollectionReadOnly(); + } + + #endregion + + #region IEnumerable Members + + public IEnumerator GetEnumerator() { + for (int i = 0, n = _expandoData.Class.Keys.Length; i < n; i++) { + CheckVersion(); + if (_expandoData[i] != Uninitialized) { + yield return _expandoData.Class.Keys[i]; + } + } + } + + #endregion + + #region IEnumerable Members + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { + return GetEnumerator(); + } + + #endregion + } + + // We create a non-generic type for the debug view for each different collection type + // that uses DebuggerTypeProxy, instead of defining a generic debug view type and + // using different instantiations. The reason for this is that support for generics + // with using DebuggerTypeProxy is limited. For C#, DebuggerTypeProxy supports only + // open types (from MSDN http://msdn.microsoft.com/en-us/library/d8eyd8zc.aspx). + private sealed class ValueCollectionDebugView { + private ICollection collection; + public ValueCollectionDebugView(ICollection collection) { + Debug.Assert(collection != null); + this.collection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public object[] Items { + get { + object[] items = new object[collection.Count]; + collection.CopyTo(items, 0); + return items; + } + } + } + + [DebuggerTypeProxy(typeof(ValueCollectionDebugView))] + [DebuggerDisplay("Count = {Count}")] + private class ValueCollection : ICollection { + private readonly ExpandoObject _expando; + private readonly int _expandoVersion; + private readonly int _expandoCount; + private readonly ExpandoData _expandoData; + + internal ValueCollection(ExpandoObject expando) { + lock (expando.LockObject) { + _expando = expando; + _expandoVersion = expando._data.Version; + _expandoCount = expando._count; + _expandoData = expando._data; + } + } + + private void CheckVersion() { + if (_expando._data.Version != _expandoVersion || _expandoData != _expando._data) { + //the underlying expando object has changed + throw Error.CollectionModifiedWhileEnumerating(); + } + } + + #region ICollection Members + + public void Add(object item) { + throw Error.CollectionReadOnly(); + } + + public void Clear() { + throw Error.CollectionReadOnly(); + } + + public bool Contains(object item) { + lock (_expando.LockObject) { + CheckVersion(); + + ExpandoData data = _expando._data; + for (int i = 0; i < data.Class.Keys.Length; i++) { + + // See comment in TryDeleteValue; it's okay to call + // object.Equals with the lock held. + if (object.Equals(data[i], item)) { + return true; + } + } + return false; + } + } + + public void CopyTo(object[] array, int arrayIndex) { + ContractUtils.RequiresNotNull(array, "array"); + ContractUtils.RequiresArrayRange(array, arrayIndex, _expandoCount, "arrayIndex", "Count"); + lock (_expando.LockObject) { + CheckVersion(); + ExpandoData data = _expando._data; + for (int i = 0; i < data.Class.Keys.Length; i++) { + if (data[i] != Uninitialized) { + array[arrayIndex++] = data[i]; + } + } + } + } + + public int Count { + get { + CheckVersion(); + return _expandoCount; + } + } + + public bool IsReadOnly { + get { return true; } + } + + public bool Remove(object item) { + throw Error.CollectionReadOnly(); + } + + #endregion + + #region IEnumerable Members + + public IEnumerator GetEnumerator() { + ExpandoData data = _expando._data; + for (int i = 0; i < data.Class.Keys.Length; i++) { + CheckVersion(); + // Capture the value into a temp so we don't inadvertently + // return Uninitialized. + object temp = data[i]; + if (temp != Uninitialized) { + yield return temp; + } + } + } + + #endregion + + #region IEnumerable Members + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { + return GetEnumerator(); + } + + #endregion + } + + #endregion + + #region IDictionary Members + ICollection IDictionary.Keys { + get { + return new KeyCollection(this); + } + } + + ICollection IDictionary.Values { + get { + return new ValueCollection(this); + } + } + + object IDictionary.this[string key] { + get { + object value; + if (!TryGetValueForKey(key, out value)) { + throw Error.KeyDoesNotExistInExpando(key); + } + return value; + } + set { + ContractUtils.RequiresNotNull(key, "key"); + // Pass null to the class, which forces lookup. + TrySetValue(null, -1, value, key, false, false); + } + } + + void IDictionary.Add(string key, object value) { + this.TryAddMember(key, value); + } + + bool IDictionary.ContainsKey(string key) { + ContractUtils.RequiresNotNull(key, "key"); + + ExpandoData data = _data; + int index = data.Class.GetValueIndexCaseSensitive(key); + return index >= 0 && data[index] != Uninitialized; + } + + bool IDictionary.Remove(string key) { + ContractUtils.RequiresNotNull(key, "key"); + // Pass null to the class, which forces lookup. + return TryDeleteValue(null, -1, key, false, Uninitialized); + } + + bool IDictionary.TryGetValue(string key, out object value) { + return TryGetValueForKey(key, out value); + } + + #endregion + + #region ICollection> Members + int ICollection>.Count { + get { + return _count; + } + } + + bool ICollection>.IsReadOnly { + get { return false; } + } + + void ICollection>.Add(KeyValuePair item) { + TryAddMember(item.Key, item.Value); + } + + void ICollection>.Clear() { + // We remove both class and data! + ExpandoData data; + lock (LockObject) { + data = _data; + _data = ExpandoData.Empty; + _count = 0; + } + + // Notify property changed for all properties. + var propertyChanged = _propertyChanged; + if (propertyChanged != null) { + for (int i = 0, n = data.Class.Keys.Length; i < n; i++) { + if (data[i] != Uninitialized) { + propertyChanged(this, new PropertyChangedEventArgs(data.Class.Keys[i])); + } + } + } + } + + bool ICollection>.Contains(KeyValuePair item) { + object value; + if (!TryGetValueForKey(item.Key, out value)) { + return false; + } + + return object.Equals(value, item.Value); + } + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) { + ContractUtils.RequiresNotNull(array, "array"); + ContractUtils.RequiresArrayRange(array, arrayIndex, _count, "arrayIndex", "Count"); + + // We want this to be atomic and not throw + lock (LockObject) { + foreach (KeyValuePair item in this) { + array[arrayIndex++] = item; + } + } + } + + bool ICollection>.Remove(KeyValuePair item) { + return TryDeleteValue(null, -1, item.Key, false, item.Value); + } + #endregion + + #region IEnumerable> Member + + IEnumerator> IEnumerable>.GetEnumerator() { + ExpandoData data = _data; + return GetExpandoEnumerator(data, data.Version); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { + ExpandoData data = _data; + return GetExpandoEnumerator(data, data.Version); + } + + // Note: takes the data and version as parameters so they will be + // captured before the first call to MoveNext(). + private IEnumerator> GetExpandoEnumerator(ExpandoData data, int version) { + for (int i = 0; i < data.Class.Keys.Length; i++) { + if (_data.Version != version || data != _data) { + // The underlying expando object has changed: + // 1) the version of the expando data changed + // 2) the data object is changed + throw Error.CollectionModifiedWhileEnumerating(); + } + // Capture the value into a temp so we don't inadvertently + // return Uninitialized. + object temp = data[i]; + if (temp != Uninitialized) { + yield return new KeyValuePair(data.Class.Keys[i], temp); + } + } + } + #endregion + + #region MetaExpando + + private class MetaExpando : DynamicMetaObject { + public MetaExpando(Expression expression, ExpandoObject value) + : base(expression, BindingRestrictions.Empty, value) { + } + + private DynamicMetaObject BindGetOrInvokeMember(DynamicMetaObjectBinder binder, string name, bool ignoreCase, DynamicMetaObject fallback, Func fallbackInvoke) { + ExpandoClass klass = Value.Class; + + //try to find the member, including the deleted members + int index = klass.GetValueIndex(name, ignoreCase, Value); + + ParameterExpression value = Expression.Parameter(typeof(object), "value"); + + Expression tryGetValue = Expression.Call( + typeof(RuntimeOps).GetMethod("ExpandoTryGetValue"), + GetLimitedSelf(), + Expression.Constant(klass, typeof(object)), + Expression.Constant(index), + Expression.Constant(name), + Expression.Constant(ignoreCase), + value + ); + + var result = new DynamicMetaObject(value, BindingRestrictions.Empty); + if (fallbackInvoke != null) { + result = fallbackInvoke(result); + } + + result = new DynamicMetaObject( + Expression.Block( + new[] { value }, + Expression.Condition( + tryGetValue, + result.Expression, + fallback.Expression, + typeof(object) + ) + ), + result.Restrictions.Merge(fallback.Restrictions) + ); + + return AddDynamicTestAndDefer(binder, Value.Class, null, result); + } + + public override DynamicMetaObject BindGetMember(GetMemberBinder binder) { + ContractUtils.RequiresNotNull(binder, "binder"); + return BindGetOrInvokeMember( + binder, + binder.Name, + binder.IgnoreCase, + binder.FallbackGetMember(this), + null + ); + } + + public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) { + ContractUtils.RequiresNotNull(binder, "binder"); + return BindGetOrInvokeMember( + binder, + binder.Name, + binder.IgnoreCase, + binder.FallbackInvokeMember(this, args), + value => binder.FallbackInvoke(value, args, null) + ); + } + + public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) { + ContractUtils.RequiresNotNull(binder, "binder"); + ContractUtils.RequiresNotNull(value, "value"); + + ExpandoClass klass; + int index; + + ExpandoClass originalClass = GetClassEnsureIndex(binder.Name, binder.IgnoreCase, Value, out klass, out index); + + return AddDynamicTestAndDefer( + binder, + klass, + originalClass, + new DynamicMetaObject( + Expression.Call( + typeof(RuntimeOps).GetMethod("ExpandoTrySetValue"), + GetLimitedSelf(), + Expression.Constant(klass, typeof(object)), + Expression.Constant(index), + Expression.Convert(value.Expression, typeof(object)), + Expression.Constant(binder.Name), + Expression.Constant(binder.IgnoreCase) + ), + BindingRestrictions.Empty + ) + ); + } + + public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { + ContractUtils.RequiresNotNull(binder, "binder"); + + int index = Value.Class.GetValueIndex(binder.Name, binder.IgnoreCase, Value); + + Expression tryDelete = Expression.Call( + typeof(RuntimeOps).GetMethod("ExpandoTryDeleteValue"), + GetLimitedSelf(), + Expression.Constant(Value.Class, typeof(object)), + Expression.Constant(index), + Expression.Constant(binder.Name), + Expression.Constant(binder.IgnoreCase) + ); + DynamicMetaObject fallback = binder.FallbackDeleteMember(this); + + DynamicMetaObject target = new DynamicMetaObject( + Expression.IfThen(Expression.Not(tryDelete), fallback.Expression), + fallback.Restrictions + ); + + return AddDynamicTestAndDefer(binder, Value.Class, null, target); + } + + public override IEnumerable GetDynamicMemberNames() { + var expandoData = Value._data; + var klass = expandoData.Class; + for (int i = 0; i < klass.Keys.Length; i++) { + object val = expandoData[i]; + if (val != ExpandoObject.Uninitialized) { + yield return klass.Keys[i]; + } + } + } + + /// + /// Adds a dynamic test which checks if the version has changed. The test is only necessary for + /// performance as the methods will do the correct thing if called with an incorrect version. + /// + private DynamicMetaObject AddDynamicTestAndDefer(DynamicMetaObjectBinder binder, ExpandoClass klass, ExpandoClass originalClass, DynamicMetaObject succeeds) { + + Expression ifTestSucceeds = succeeds.Expression; + if (originalClass != null) { + // we are accessing a member which has not yet been defined on this class. + // We force a class promotion after the type check. If the class changes the + // promotion will fail and the set/delete will do a full lookup using the new + // class to discover the name. + Debug.Assert(originalClass != klass); + + ifTestSucceeds = Expression.Block( + Expression.Call( + null, + typeof(RuntimeOps).GetMethod("ExpandoPromoteClass"), + GetLimitedSelf(), + Expression.Constant(originalClass, typeof(object)), + Expression.Constant(klass, typeof(object)) + ), + succeeds.Expression + ); + } + + return new DynamicMetaObject( + Expression.Condition( + Expression.Call( + null, + typeof(RuntimeOps).GetMethod("ExpandoCheckVersion"), + GetLimitedSelf(), + Expression.Constant(originalClass ?? klass, typeof(object)) + ), + ifTestSucceeds, + binder.GetUpdateExpression(ifTestSucceeds.Type) + ), + GetRestrictions().Merge(succeeds.Restrictions) + ); + } + + /// + /// Gets the class and the index associated with the given name. Does not update the expando object. Instead + /// this returns both the original and desired new class. A rule is created which includes the test for the + /// original class, the promotion to the new class, and the set/delete based on the class post-promotion. + /// + private ExpandoClass GetClassEnsureIndex(string name, bool caseInsensitive, ExpandoObject obj, out ExpandoClass klass, out int index) { + ExpandoClass originalClass = Value.Class; + + index = originalClass.GetValueIndex(name, caseInsensitive, obj) ; + if (index == ExpandoObject.AmbiguousMatchFound) { + klass = originalClass; + return null; + } + if (index == ExpandoObject.NoMatch) { + // go ahead and find a new class now... + ExpandoClass newClass = originalClass.FindNewClass(name); + + klass = newClass; + index = newClass.GetValueIndexCaseSensitive(name); + + Debug.Assert(index != ExpandoObject.NoMatch); + return originalClass; + } else { + klass = originalClass; + return null; + } + } + + /// + /// Returns our Expression converted to our known LimitType + /// + private Expression GetLimitedSelf() { + if (TypeUtils.AreEquivalent(Expression.Type, LimitType)) { + return Expression; + } + return Expression.Convert(Expression, LimitType); + } + + /// + /// Returns a Restrictions object which includes our current restrictions merged + /// with a restriction limiting our type + /// + private BindingRestrictions GetRestrictions() { + Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty"); + + return BindingRestrictions.GetTypeRestriction(this); + } + + public new ExpandoObject Value { + get { + return (ExpandoObject)base.Value; + } + } + } + + #endregion + + #region ExpandoData + + /// + /// Stores the class and the data associated with the class as one atomic + /// pair. This enables us to do a class check in a thread safe manner w/o + /// requiring locks. + /// + private class ExpandoData { + internal static ExpandoData Empty = new ExpandoData(); + + /// + /// the dynamically assigned class associated with the Expando object + /// + internal readonly ExpandoClass Class; + + /// + /// data stored in the expando object, key names are stored in the class. + /// + /// Expando._data must be locked when mutating the value. Otherwise a copy of it + /// could be made and lose values. + /// + private readonly object[] _dataArray; + + /// + /// Indexer for getting/setting the data + /// + internal object this[int index] { + get { + return _dataArray[index]; + } + set { + //when the array is updated, version increases, even the new value is the same + //as previous. Dictionary type has the same behavior. + _version++; + _dataArray[index] = value; + } + } + + internal int Version { + get { return _version; } + } + + internal int Length { + get { return _dataArray.Length; } + } + + /// + /// Constructs an empty ExpandoData object with the empty class and no data. + /// + private ExpandoData() { + Class = ExpandoClass.Empty; + _dataArray = new object[0]; + } + + /// + /// the version of the ExpandoObject that tracks set and delete operations + /// + private int _version; + + /// + /// Constructs a new ExpandoData object with the specified class and data. + /// + internal ExpandoData(ExpandoClass klass, object[] data, int version) { + Class = klass; + _dataArray = data; + _version = version; + } + + /// + /// Update the associated class and increases the storage for the data array if needed. + /// + /// + internal ExpandoData UpdateClass(ExpandoClass newClass) { + if (_dataArray.Length >= newClass.Keys.Length) { + // we have extra space in our buffer, just initialize it to Uninitialized. + this[newClass.Keys.Length - 1] = ExpandoObject.Uninitialized; + return new ExpandoData(newClass, this._dataArray, this._version); + } else { + // we've grown too much - we need a new object array + int oldLength = _dataArray.Length; + object[] arr = new object[GetAlignedSize(newClass.Keys.Length)]; + Array.Copy(_dataArray, arr, _dataArray.Length); + ExpandoData newData = new ExpandoData(newClass, arr, this._version); + newData[oldLength] = ExpandoObject.Uninitialized; + return newData; + } + } + + private static int GetAlignedSize(int len) { + // the alignment of the array for storage of values (must be a power of two) + const int DataArrayAlignment = 8; + + // round up and then mask off lower bits + return (len + (DataArrayAlignment - 1)) & (~(DataArrayAlignment - 1)); + } + } + + #endregion + + #region INotifyPropertyChanged Members + + event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { + add { _propertyChanged += value; } + remove { _propertyChanged -= value; } + } + + #endregion + } +} + +namespace System.Runtime.CompilerServices { + + // + // Note: these helpers are kept as simple wrappers so they have a better + // chance of being inlined. + // + public static partial class RuntimeOps { + + /// + /// Gets the value of an item in an expando object. + /// + /// The expando object. + /// The class of the expando object. + /// The index of the member. + /// The name of the member. + /// true if the name should be matched ignoring case; false otherwise. + /// The out parameter containing the value of the member. + /// True if the member exists in the expando object, otherwise false. + [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] + public static bool ExpandoTryGetValue(ExpandoObject expando, object indexClass, int index, string name, bool ignoreCase, out object value) { + return expando.TryGetValue(indexClass, index, name, ignoreCase, out value); + } + + /// + /// Sets the value of an item in an expando object. + /// + /// The expando object. + /// The class of the expando object. + /// The index of the member. + /// The value of the member. + /// The name of the member. + /// true if the name should be matched ignoring case; false otherwise. + /// + /// Returns the index for the set member. + /// + [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] + public static object ExpandoTrySetValue(ExpandoObject expando, object indexClass, int index, object value, string name, bool ignoreCase) { + expando.TrySetValue(indexClass, index, value, name, ignoreCase, false); + return value; + } + + /// + /// Deletes the value of an item in an expando object. + /// + /// The expando object. + /// The class of the expando object. + /// The index of the member. + /// The name of the member. + /// true if the name should be matched ignoring case; false otherwise. + /// true if the item was successfully removed; otherwise, false. + [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] + public static bool ExpandoTryDeleteValue(ExpandoObject expando, object indexClass, int index, string name, bool ignoreCase) { + return expando.TryDeleteValue(indexClass, index, name, ignoreCase, ExpandoObject.Uninitialized); + } + + /// + /// Checks the version of the expando object. + /// + /// The expando object. + /// The version to check. + /// true if the version is equal; otherwise, false. + [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] + public static bool ExpandoCheckVersion(ExpandoObject expando, object version) { + return expando.Class == version; + } + + /// + /// Promotes an expando object from one class to a new class. + /// + /// The expando object. + /// The old class of the expando object. + /// The new class of the expando object. + [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)] + public static void ExpandoPromoteClass(ExpandoObject expando, object oldClass, object newClass) { + expando.PromoteClass(oldClass, newClass); + } + } +} + diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetIndexBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetIndexBinder.cs index 730c027c09e..56f625968b3 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetIndexBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetIndexBinder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs index edda8e66800..f02ca86ab2b 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs @@ -83,7 +83,7 @@ namespace System.Dynamic { /// The target of the dynamic get member operation. /// An array of arguments of the dynamic get member operation. /// The representing the result of the binding. - public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args) { + public sealed override DynamicMetaObject Bind(DynamicMetaObject target, params DynamicMetaObject[] args) { ContractUtils.RequiresNotNull(target, "target"); ContractUtils.Requires(args == null || args.Length == 0, "args"); diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/IDynamicMetaObjectProvider.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/IDynamicMetaObjectProvider.cs index b4314cbdff8..2977c2cb1bf 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/IDynamicMetaObjectProvider.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/IDynamicMetaObjectProvider.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,10 +13,10 @@ * * ***************************************************************************/ -#if CLR2 -using Microsoft.Scripting.Ast; -#else +#if FEATURE_CORE_DLR using System.Linq.Expressions; +#else +using Microsoft.Scripting.Ast; #endif namespace System.Dynamic { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/SetIndexBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/SetIndexBinder.cs index ea123b86321..f1e8952bef3 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/SetIndexBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/SetIndexBinder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UnaryOperationBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UnaryOperationBinder.cs index 46c704686df..5d5d45c1a91 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UnaryOperationBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UnaryOperationBinder.cs @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs index 70a1b92b4f4..3143d6e4efb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -12,7 +12,7 @@ * * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Utils; #endif diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/.gitattributes b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/.gitattributes deleted file mode 100644 index 1dede25a279..00000000000 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/Expression.cs -crlf -/ListInitExpression.cs -crlf diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs index 845e91a2075..28d06baa662 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs @@ -20,11 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -33,9 +29,7 @@ namespace System.Linq.Expressions { /// /// Represents an expression that has a binary operator. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.BinaryExpressionProxy))] -#endif public class BinaryExpression : Expression { private readonly Expression _left; private readonly Expression _right; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs index 1867f3ff056..372b05ec9da 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs @@ -20,11 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Threading; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -32,9 +28,7 @@ namespace System.Linq.Expressions { /// /// Represents a block that contains a sequence of expressions where variables can be defined. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.BlockExpressionProxy))] -#endif public class BlockExpression : Expression { /// /// Gets the expressions in this block. diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs index 6993ba5bdbe..08e2ab59502 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs @@ -17,11 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -31,9 +27,7 @@ namespace System.Linq.Expressions { /// Represents a catch statement in a try block. /// This must have the same return type (i.e., the type of ) as the try block it is associated with. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.CatchBlockProxy))] -#endif public sealed class CatchBlock { private readonly Type _test; private readonly ParameterExpression _var; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs index 8f49f0f88c4..32d108d08ae 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs @@ -17,11 +17,7 @@ using System; using System.Dynamic.Utils; using System.Diagnostics; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -30,9 +26,7 @@ namespace System.Linq.Expressions { /// /// Represents an expression that has a conditional operator. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.ConditionalExpressionProxy))] -#endif public class ConditionalExpression : Expression { private readonly Expression _test; private readonly Expression _true; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs index e338aa71330..b4c3c7b3ceb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs @@ -21,7 +21,7 @@ using System.Dynamic.Utils; using System.Core; #endif -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -30,9 +30,7 @@ namespace System.Linq.Expressions { /// /// Represents an expression that has a constant value. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.ConstantExpressionProxy))] -#endif public class ConstantExpression : Expression { // Possible optimization: we could have a Constant subclass that // stores the unboxed value. diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs index 9f3c3ff15c8..dd5121a5246 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,11 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -32,9 +28,7 @@ namespace System.Linq.Expressions { /// This allows the debugger to highlight the correct source code when /// debugging. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.DebugInfoExpressionProxy))] -#endif public class DebugInfoExpression : Expression { private readonly SymbolDocumentInfo _document; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugViewWriter.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugViewWriter.cs index 9ad865fc812..098126a383b 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugViewWriter.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DebugViewWriter.cs @@ -24,7 +24,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Collections.ObjectModel; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs index 2355f3bd1b8..5234bf84465 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs @@ -16,7 +16,7 @@ using System; using System.Diagnostics; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -24,9 +24,7 @@ namespace System.Linq.Expressions { /// /// Represents the default value of a type or an empty expression. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.DefaultExpressionProxy))] -#endif public sealed class DefaultExpression : Expression { private readonly Type _type; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs index 4358c758658..14a8d8e5593 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs @@ -21,11 +21,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -35,9 +31,7 @@ namespace System.Linq.Expressions { /// /// Represents a dynamic operation. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.DynamicExpressionProxy))] -#endif public class DynamicExpression : Expression, IArgumentProvider { private readonly CallSiteBinder _binder; private readonly Type _delegateType; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs index d4e376e3194..21f87689d6a 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,11 +20,7 @@ using System.Reflection; using System.Text; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.DebuggerProxy.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.DebuggerProxy.cs index 81bfaaab3bf..3d1d6c9e352 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.DebuggerProxy.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.DebuggerProxy.cs @@ -18,12 +18,11 @@ using System.Collections.ObjectModel; using System.Reflection; using System.Runtime.CompilerServices; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { #endif -#if !SILVERLIGHT public partial class Expression { #region Generated Expression Debugger Proxies @@ -453,5 +452,4 @@ namespace System.Linq.Expressions { #endregion } -#endif } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs index b2ef4fc3917..21005b217c7 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs @@ -1,419 +1,402 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. - * - * This source code is subject to terms and conditions of the Apache License, Version 2.0. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Apache License, Version 2.0, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Apache License, Version 2.0. - * - * You must not remove this notice, or any other, from this software. - * - * - * ***************************************************************************/ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Dynamic.Utils; -using System.Globalization; -using System.IO; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Threading; - -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 -namespace Microsoft.Scripting.Ast { - using Microsoft.Scripting.Utils; -#else -namespace System.Linq.Expressions { -#endif - /// - /// The base type for all nodes in Expression Trees. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] - public abstract partial class Expression { - private delegate LambdaExpression LambdaFactory(Expression body, string name, bool tailCall, ReadOnlyCollection parameters); - - private static readonly CacheDict _LambdaDelegateCache = new CacheDict(40); - private static CacheDict _LambdaFactories; - - // LINQ protected ctor from 3.5 - -#if !CLR2 // needs ConditionWeakTable in 4.0 - - // For 4.0, many frequently used Expression nodes have had their memory - // footprint reduced by removing the Type and NodeType fields. This has - // large performance benefits to all users of Expression Trees. - // - // To support the 3.5 protected constructor, we store the fields that - // used to be here in a ConditionalWeakTable. - - private class ExtensionInfo { - public ExtensionInfo(ExpressionType nodeType, Type type) { - NodeType = nodeType; - Type = type; - } - - internal readonly ExpressionType NodeType; - internal readonly Type Type; - } - - private static ConditionalWeakTable _legacyCtorSupportTable; - - /// - /// Constructs a new instance of . - /// - /// The of the . - /// The of the . - [Obsolete("use a different constructor that does not take ExpressionType. Then override NodeType and Type properties to provide the values that would be specified to this constructor.")] - protected Expression(ExpressionType nodeType, Type type) { - // Can't enforce anything that V1 didn't - if (_legacyCtorSupportTable == null) { - Interlocked.CompareExchange( - ref _legacyCtorSupportTable, - new ConditionalWeakTable(), - null - ); - } - - _legacyCtorSupportTable.Add(this, new ExtensionInfo(nodeType, type)); - } -#endif - - /// - /// Constructs a new instance of . - /// - protected Expression() { - } - - /// - /// The of the . - /// - public virtual ExpressionType NodeType { - get { -#if !CLR2 - ExtensionInfo extInfo; - if (_legacyCtorSupportTable != null && _legacyCtorSupportTable.TryGetValue(this, out extInfo)) { - return extInfo.NodeType; - } -#endif - // the extension expression failed to override NodeType - throw Error.ExtensionNodeMustOverrideProperty("Expression.NodeType"); - } - } - - - /// - /// The of the value represented by this . - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] - public virtual Type Type { - get { -#if !CLR2 - ExtensionInfo extInfo; - if (_legacyCtorSupportTable != null && _legacyCtorSupportTable.TryGetValue(this, out extInfo)) { - return extInfo.Type; - } -#endif - // the extension expression failed to override Type - throw Error.ExtensionNodeMustOverrideProperty("Expression.Type"); - } - } - - /// - /// Indicates that the node can be reduced to a simpler node. If this - /// returns true, Reduce() can be called to produce the reduced form. - /// - public virtual bool CanReduce { - get { return false; } - } - - /// - /// Reduces this node to a simpler expression. If CanReduce returns - /// true, this should return a valid expression. This method is - /// allowed to return another node which itself must be reduced. - /// - /// The reduced expression. - public virtual Expression Reduce() { - if (CanReduce) throw Error.ReducibleMustOverrideReduce(); - return this; - } - - /// - /// Reduces the node and then calls the visitor delegate on the reduced expression. - /// Throws an exception if the node isn't reducible. - /// - /// An instance of . - /// The expression being visited, or an expression which should replace it in the tree. - /// - /// Override this method to provide logic to walk the node's children. - /// A typical implementation will call visitor.Visit on each of its - /// children, and if any of them change, should return a new copy of - /// itself with the modified children. - /// - protected internal virtual Expression VisitChildren(ExpressionVisitor visitor) { - if (!CanReduce) throw Error.MustBeReducible(); - return visitor.Visit(ReduceAndCheck()); - } - - /// - /// Dispatches to the specific visit method for this node type. For - /// example, will call into - /// . - /// - /// The visitor to visit this node with. - /// The result of visiting this node. - /// - /// This default implementation for - /// nodes will call . - /// Override this method to call into a more specific method on a derived - /// visitor class of ExprressionVisitor. However, it should still - /// support unknown visitors by calling VisitExtension. - /// - protected internal virtual Expression Accept(ExpressionVisitor visitor) { - return visitor.VisitExtension(this); - } - - /// - /// Reduces this node to a simpler expression. If CanReduce returns - /// true, this should return a valid expression. This method is - /// allowed to return another node which itself must be reduced. - /// - /// The reduced expression. - /// - /// Unlike Reduce, this method checks that the reduced node satisfies - /// certain invariants. - /// - public Expression ReduceAndCheck() { - if (!CanReduce) throw Error.MustBeReducible(); - - var newNode = Reduce(); - - // 1. Reduction must return a new, non-null node - // 2. Reduction must return a new node whose result type can be assigned to the type of the original node - if (newNode == null || newNode == this) throw Error.MustReduceToDifferent(); - if (!TypeUtils.AreReferenceAssignable(Type, newNode.Type)) throw Error.ReducedNotCompatible(); - return newNode; - } - - /// - /// Reduces the expression to a known node type (i.e. not an Extension node) - /// or simply returns the expression if it is already a known type. - /// - /// The reduced expression. - public Expression ReduceExtensions() { - var node = this; - while (node.NodeType == ExpressionType.Extension) { - node = node.ReduceAndCheck(); - } - return node; - } - - - /// - /// Creates a representation of the Expression. - /// - /// A representation of the Expression. - public override string ToString() { - return ExpressionStringBuilder.ExpressionToString(this); - } - -#if CLR2 - /// - /// Writes a representation of the to a . - /// - /// A that will be used to build the string representation. - public void DumpExpression(TextWriter writer) { - DebugViewWriter.WriteTo(this, writer); - } - - /// - /// Creates a representation of the Expression. - /// - /// A representation of the Expression. - public string DebugView { -#else - private string DebugView { -#endif - get { - using (System.IO.StringWriter writer = new System.IO.StringWriter(CultureInfo.CurrentCulture)) { - DebugViewWriter.WriteTo(this, writer); - return writer.ToString(); - } - } - } - - /// - /// Helper used for ensuring we only return 1 instance of a ReadOnlyCollection of T. - /// - /// This is called from various methods where we internally hold onto an IList of T - /// or a readonly collection of T. We check to see if we've already returned a - /// readonly collection of T and if so simply return the other one. Otherwise we do - /// a thread-safe replacement of the list w/ a readonly collection which wraps it. - /// - /// Ultimately this saves us from having to allocate a ReadOnlyCollection for our - /// data types because the compiler is capable of going directly to the IList of T. - /// - internal static ReadOnlyCollection ReturnReadOnly(ref IList collection) { - IList value = collection; - - // if it's already read-only just return it. - ReadOnlyCollection res = value as ReadOnlyCollection; - if (res != null) { - return res; - } - - // otherwise make sure only readonly collection every gets exposed - Interlocked.CompareExchange>( - ref collection, - value.ToReadOnly(), - value - ); - - // and return it - return (ReadOnlyCollection)collection; - } - - /// - /// Helper used for ensuring we only return 1 instance of a ReadOnlyCollection of T. - /// - /// This is similar to the ReturnReadOnly of T. This version supports nodes which hold - /// onto multiple Expressions where one is typed to object. That object field holds either - /// an expression or a ReadOnlyCollection of Expressions. When it holds a ReadOnlyCollection - /// the IList which backs it is a ListArgumentProvider which uses the Expression which - /// implements IArgumentProvider to get 2nd and additional values. The ListArgumentProvider - /// continues to hold onto the 1st expression. - /// - /// This enables users to get the ReadOnlyCollection w/o it consuming more memory than if - /// it was just an array. Meanwhile The DLR internally avoids accessing which would force - /// the readonly collection to be created resulting in a typical memory savings. - /// - internal static ReadOnlyCollection ReturnReadOnly(IArgumentProvider provider, ref object collection) { - Expression tObj = collection as Expression; - if (tObj != null) { - // otherwise make sure only one readonly collection ever gets exposed - Interlocked.CompareExchange( - ref collection, - new ReadOnlyCollection(new ListArgumentProvider(provider, tObj)), - tObj - ); - } - - // and return what is not guaranteed to be a readonly collection - return (ReadOnlyCollection)collection; - } - - /// - /// Helper which is used for specialized subtypes which use ReturnReadOnly(ref object, ...). - /// This is the reverse version of ReturnReadOnly which takes an IArgumentProvider. - /// - /// This is used to return the 1st argument. The 1st argument is typed as object and either - /// contains a ReadOnlyCollection or the Expression. We check for the Expression and if it's - /// present we return that, otherwise we return the 1st element of the ReadOnlyCollection. - /// - internal static T ReturnObject(object collectionOrT) where T : class { - T t = collectionOrT as T; - if (t != null) { - return t; - } - - return ((ReadOnlyCollection)collectionOrT)[0]; - } - -#if SILVERLIGHT -#if !CLR2 - // Quirks mode for Expression Trees as they existed in Silverlight 2 and 3 - internal readonly static bool SilverlightQuirks = - AppDomain.CurrentDomain.IsCompatibilitySwitchSet("APP_EARLIER_THAN_SL4.0").GetValueOrDefault(); -#else - internal readonly static bool SilverlightQuirks = true; -#endif -#endif - - private static void RequiresCanRead(Expression expression, string paramName) { - if (expression == null) { - throw new ArgumentNullException(paramName); - } - - // validate that we can read the node - switch (expression.NodeType) { - case ExpressionType.Index: - IndexExpression index = (IndexExpression)expression; - if (index.Indexer != null && !index.Indexer.CanRead) { - throw new ArgumentException(Strings.ExpressionMustBeReadable, paramName); - } - break; - case ExpressionType.MemberAccess: - MemberExpression member = (MemberExpression)expression; - MemberInfo memberInfo = member.Member; - if (memberInfo.MemberType == MemberTypes.Property) { - PropertyInfo prop = (PropertyInfo)memberInfo; - if (!prop.CanRead) { - throw new ArgumentException(Strings.ExpressionMustBeReadable, paramName); - } - } - break; - } - } - - private static void RequiresCanRead(IEnumerable items, string paramName) { - if (items != null) { - // this is called a lot, avoid allocating an enumerator if we can... - IList listItems = items as IList; - if (listItems != null) { - for (int i = 0; i < listItems.Count; i++) { - RequiresCanRead(listItems[i], paramName); - } - return; - } - - foreach (var i in items) { - RequiresCanRead(i, paramName); - } - } - } - private static void RequiresCanWrite(Expression expression, string paramName) { - if (expression == null) { - throw new ArgumentNullException(paramName); - } - - bool canWrite = false; - switch (expression.NodeType) { - case ExpressionType.Index: - IndexExpression index = (IndexExpression)expression; - if (index.Indexer != null) { - canWrite = index.Indexer.CanWrite; - } else { - canWrite = true; - } - break; - case ExpressionType.MemberAccess: - MemberExpression member = (MemberExpression)expression; - switch (member.Member.MemberType) { - case MemberTypes.Property: - PropertyInfo prop = (PropertyInfo)member.Member; - canWrite = prop.CanWrite; - break; - case MemberTypes.Field: - FieldInfo field = (FieldInfo)member.Member; - canWrite = !(field.IsInitOnly || field.IsLiteral); - break; - } - break; - case ExpressionType.Parameter: - canWrite = true; - break; - } - - if (!canWrite) { - throw new ArgumentException(Strings.ExpressionMustBeWriteable, paramName); - } - } - } -} +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Dynamic.Utils; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Threading; + +#if !FEATURE_CORE_DLR +namespace Microsoft.Scripting.Ast { + using Microsoft.Scripting.Utils; +#else +namespace System.Linq.Expressions { +#endif + /// + /// The base type for all nodes in Expression Trees. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] + public abstract partial class Expression { + private delegate LambdaExpression LambdaFactory(Expression body, string name, bool tailCall, ReadOnlyCollection parameters); + + private static readonly CacheDict _LambdaDelegateCache = new CacheDict(40); + private static CacheDict _LambdaFactories; + + // LINQ protected ctor from 3.5 + + // needs ConditionWeakTable in 4.0 + + // For 4.0, many frequently used Expression nodes have had their memory + // footprint reduced by removing the Type and NodeType fields. This has + // large performance benefits to all users of Expression Trees. + // + // To support the 3.5 protected constructor, we store the fields that + // used to be here in a ConditionalWeakTable. + + private class ExtensionInfo { + public ExtensionInfo(ExpressionType nodeType, Type type) { + NodeType = nodeType; + Type = type; + } + + internal readonly ExpressionType NodeType; + internal readonly Type Type; + } + + private static ConditionalWeakTable _legacyCtorSupportTable; + + /// + /// Constructs a new instance of . + /// + /// The of the . + /// The of the . + [Obsolete("use a different constructor that does not take ExpressionType. Then override NodeType and Type properties to provide the values that would be specified to this constructor.")] + protected Expression(ExpressionType nodeType, Type type) { + // Can't enforce anything that V1 didn't + if (_legacyCtorSupportTable == null) { + Interlocked.CompareExchange( + ref _legacyCtorSupportTable, + new ConditionalWeakTable(), + null + ); + } + + _legacyCtorSupportTable.Add(this, new ExtensionInfo(nodeType, type)); + } + + /// + /// Constructs a new instance of . + /// + protected Expression() { + } + + /// + /// The of the . + /// + public virtual ExpressionType NodeType { + get { + ExtensionInfo extInfo; + if (_legacyCtorSupportTable != null && _legacyCtorSupportTable.TryGetValue(this, out extInfo)) { + return extInfo.NodeType; + } + + // the extension expression failed to override NodeType + throw Error.ExtensionNodeMustOverrideProperty("Expression.NodeType"); + } + } + + + /// + /// The of the value represented by this . + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + public virtual Type Type { + get { + ExtensionInfo extInfo; + if (_legacyCtorSupportTable != null && _legacyCtorSupportTable.TryGetValue(this, out extInfo)) { + return extInfo.Type; + } + + // the extension expression failed to override Type + throw Error.ExtensionNodeMustOverrideProperty("Expression.Type"); + } + } + + /// + /// Indicates that the node can be reduced to a simpler node. If this + /// returns true, Reduce() can be called to produce the reduced form. + /// + public virtual bool CanReduce { + get { return false; } + } + + /// + /// Reduces this node to a simpler expression. If CanReduce returns + /// true, this should return a valid expression. This method is + /// allowed to return another node which itself must be reduced. + /// + /// The reduced expression. + public virtual Expression Reduce() { + if (CanReduce) throw Error.ReducibleMustOverrideReduce(); + return this; + } + + /// + /// Reduces the node and then calls the visitor delegate on the reduced expression. + /// Throws an exception if the node isn't reducible. + /// + /// An instance of . + /// The expression being visited, or an expression which should replace it in the tree. + /// + /// Override this method to provide logic to walk the node's children. + /// A typical implementation will call visitor.Visit on each of its + /// children, and if any of them change, should return a new copy of + /// itself with the modified children. + /// + protected internal virtual Expression VisitChildren(ExpressionVisitor visitor) { + if (!CanReduce) throw Error.MustBeReducible(); + return visitor.Visit(ReduceAndCheck()); + } + + /// + /// Dispatches to the specific visit method for this node type. For + /// example, will call into + /// . + /// + /// The visitor to visit this node with. + /// The result of visiting this node. + /// + /// This default implementation for + /// nodes will call . + /// Override this method to call into a more specific method on a derived + /// visitor class of ExprressionVisitor. However, it should still + /// support unknown visitors by calling VisitExtension. + /// + protected internal virtual Expression Accept(ExpressionVisitor visitor) { + return visitor.VisitExtension(this); + } + + /// + /// Reduces this node to a simpler expression. If CanReduce returns + /// true, this should return a valid expression. This method is + /// allowed to return another node which itself must be reduced. + /// + /// The reduced expression. + /// + /// Unlike Reduce, this method checks that the reduced node satisfies + /// certain invariants. + /// + public Expression ReduceAndCheck() { + if (!CanReduce) throw Error.MustBeReducible(); + + var newNode = Reduce(); + + // 1. Reduction must return a new, non-null node + // 2. Reduction must return a new node whose result type can be assigned to the type of the original node + if (newNode == null || newNode == this) throw Error.MustReduceToDifferent(); + if (!TypeUtils.AreReferenceAssignable(Type, newNode.Type)) throw Error.ReducedNotCompatible(); + return newNode; + } + + /// + /// Reduces the expression to a known node type (i.e. not an Extension node) + /// or simply returns the expression if it is already a known type. + /// + /// The reduced expression. + public Expression ReduceExtensions() { + var node = this; + while (node.NodeType == ExpressionType.Extension) { + node = node.ReduceAndCheck(); + } + return node; + } + + + /// + /// Creates a representation of the Expression. + /// + /// A representation of the Expression. + public override string ToString() { + return ExpressionStringBuilder.ExpressionToString(this); + } + +#if !FEATURE_CORE_DLR + /// + /// Writes a representation of the to a . + /// + /// A that will be used to build the string representation. + public void DumpExpression(TextWriter writer) { + DebugViewWriter.WriteTo(this, writer); + } + + /// + /// Creates a representation of the Expression. + /// + /// A representation of the Expression. + public string DebugView { +#else + private string DebugView { +#endif + get { + using (System.IO.StringWriter writer = new System.IO.StringWriter(CultureInfo.CurrentCulture)) { + DebugViewWriter.WriteTo(this, writer); + return writer.ToString(); + } + } + } + + /// + /// Helper used for ensuring we only return 1 instance of a ReadOnlyCollection of T. + /// + /// This is called from various methods where we internally hold onto an IList of T + /// or a readonly collection of T. We check to see if we've already returned a + /// readonly collection of T and if so simply return the other one. Otherwise we do + /// a thread-safe replacement of the list w/ a readonly collection which wraps it. + /// + /// Ultimately this saves us from having to allocate a ReadOnlyCollection for our + /// data types because the compiler is capable of going directly to the IList of T. + /// + internal static ReadOnlyCollection ReturnReadOnly(ref IList collection) { + IList value = collection; + + // if it's already read-only just return it. + ReadOnlyCollection res = value as ReadOnlyCollection; + if (res != null) { + return res; + } + + // otherwise make sure only readonly collection every gets exposed + Interlocked.CompareExchange>( + ref collection, + value.ToReadOnly(), + value + ); + + // and return it + return (ReadOnlyCollection)collection; + } + + /// + /// Helper used for ensuring we only return 1 instance of a ReadOnlyCollection of T. + /// + /// This is similar to the ReturnReadOnly of T. This version supports nodes which hold + /// onto multiple Expressions where one is typed to object. That object field holds either + /// an expression or a ReadOnlyCollection of Expressions. When it holds a ReadOnlyCollection + /// the IList which backs it is a ListArgumentProvider which uses the Expression which + /// implements IArgumentProvider to get 2nd and additional values. The ListArgumentProvider + /// continues to hold onto the 1st expression. + /// + /// This enables users to get the ReadOnlyCollection w/o it consuming more memory than if + /// it was just an array. Meanwhile The DLR internally avoids accessing which would force + /// the readonly collection to be created resulting in a typical memory savings. + /// + internal static ReadOnlyCollection ReturnReadOnly(IArgumentProvider provider, ref object collection) { + Expression tObj = collection as Expression; + if (tObj != null) { + // otherwise make sure only one readonly collection ever gets exposed + Interlocked.CompareExchange( + ref collection, + new ReadOnlyCollection(new ListArgumentProvider(provider, tObj)), + tObj + ); + } + + // and return what is not guaranteed to be a readonly collection + return (ReadOnlyCollection)collection; + } + + /// + /// Helper which is used for specialized subtypes which use ReturnReadOnly(ref object, ...). + /// This is the reverse version of ReturnReadOnly which takes an IArgumentProvider. + /// + /// This is used to return the 1st argument. The 1st argument is typed as object and either + /// contains a ReadOnlyCollection or the Expression. We check for the Expression and if it's + /// present we return that, otherwise we return the 1st element of the ReadOnlyCollection. + /// + internal static T ReturnObject(object collectionOrT) where T : class { + T t = collectionOrT as T; + if (t != null) { + return t; + } + + return ((ReadOnlyCollection)collectionOrT)[0]; + } + + private static void RequiresCanRead(Expression expression, string paramName) { + if (expression == null) { + throw new ArgumentNullException(paramName); + } + + // validate that we can read the node + switch (expression.NodeType) { + case ExpressionType.Index: + IndexExpression index = (IndexExpression)expression; + if (index.Indexer != null && !index.Indexer.CanRead) { + throw new ArgumentException(Strings.ExpressionMustBeReadable, paramName); + } + break; + case ExpressionType.MemberAccess: + MemberExpression member = (MemberExpression)expression; + MemberInfo memberInfo = member.Member; + if (memberInfo.MemberType == MemberTypes.Property) { + PropertyInfo prop = (PropertyInfo)memberInfo; + if (!prop.CanRead) { + throw new ArgumentException(Strings.ExpressionMustBeReadable, paramName); + } + } + break; + } + } + + private static void RequiresCanRead(IEnumerable items, string paramName) { + if (items != null) { + // this is called a lot, avoid allocating an enumerator if we can... + IList listItems = items as IList; + if (listItems != null) { + for (int i = 0; i < listItems.Count; i++) { + RequiresCanRead(listItems[i], paramName); + } + return; + } + + foreach (var i in items) { + RequiresCanRead(i, paramName); + } + } + } + private static void RequiresCanWrite(Expression expression, string paramName) { + if (expression == null) { + throw new ArgumentNullException(paramName); + } + + bool canWrite = false; + switch (expression.NodeType) { + case ExpressionType.Index: + IndexExpression index = (IndexExpression)expression; + if (index.Indexer != null) { + canWrite = index.Indexer.CanWrite; + } else { + canWrite = true; + } + break; + case ExpressionType.MemberAccess: + MemberExpression member = (MemberExpression)expression; + switch (member.Member.MemberType) { + case MemberTypes.Property: + PropertyInfo prop = (PropertyInfo)member.Member; + canWrite = prop.CanWrite; + break; + case MemberTypes.Field: + FieldInfo field = (FieldInfo)member.Member; + canWrite = !(field.IsInitOnly || field.IsLiteral); + break; + } + break; + case ExpressionType.Parameter: + canWrite = true; + break; + } + + if (!canWrite) { + throw new ArgumentException(Strings.ExpressionMustBeWriteable, paramName); + } + } + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs index 34f9f3bb5db..abfd257c385 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -22,8 +22,9 @@ using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; +using Microsoft.Scripting.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -237,22 +238,13 @@ namespace System.Linq.Expressions { // "&&" and "||". Oops. case ExpressionType.AndAlso: op = "AndAlso"; -#if SILVERLIGHT - if (Expression.SilverlightQuirks) op = "&&"; -#endif break; case ExpressionType.OrElse: op = "OrElse"; -#if SILVERLIGHT - if (Expression.SilverlightQuirks) op = "||"; -#endif break; case ExpressionType.Assign: op = "="; break; case ExpressionType.Equal: op = "=="; -#if SILVERLIGHT - if (Expression.SilverlightQuirks) op = "="; -#endif break; case ExpressionType.NotEqual: op = "!="; break; case ExpressionType.GreaterThan: op = ">"; break; @@ -331,12 +323,6 @@ namespace System.Linq.Expressions { } string name = node.Name; if (String.IsNullOrEmpty(name)) { -#if SILVERLIGHT - if (Expression.SilverlightQuirks) { - Out(name ?? ""); - return node; - } -#endif Out("Param_" + GetParamId(node)); } else { Out(name); @@ -492,9 +478,6 @@ namespace System.Linq.Expressions { protected override ElementInit VisitElementInit(ElementInit initializer) { Out(initializer.AddMethod.ToString()); string sep = ", "; -#if SILVERLIGHT - if (Expression.SilverlightQuirks) sep = ","; -#endif VisitExpressions('(', initializer.Arguments, ')', sep); return initializer; } @@ -503,9 +486,6 @@ namespace System.Linq.Expressions { Out("Invoke("); Visit(node.Expression); string sep = ", "; -#if SILVERLIGHT - if (Expression.SilverlightQuirks) sep = ","; -#endif for (int i = 0, n = node.Arguments.Count; i < n; i++) { Out(sep); Visit(node.Arguments[i]); @@ -554,26 +534,6 @@ namespace System.Linq.Expressions { return node; } -#if SILVERLIGHT - private static PropertyInfo GetPropertyNoThrow(MethodInfo method) { - if (method == null) - return null; - Type type = method.DeclaringType; - BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic; - flags |= (method.IsStatic) ? BindingFlags.Static : BindingFlags.Instance; - PropertyInfo[] props = type.GetProperties(flags); - foreach (PropertyInfo pi in props) { - if (pi.CanRead && method == pi.GetGetMethod(true)) { - return pi; - } - if (pi.CanWrite && method == pi.GetSetMethod(true)) { - return pi; - } - } - return null; - } -#endif - protected internal override Expression VisitNew(NewExpression node) { Out("new " + node.Type.Name); Out("("); @@ -584,15 +544,6 @@ namespace System.Linq.Expressions { } if (members != null) { string name = members[i].Name; -#if SILVERLIGHT - // Members can be the get/set methods rather than the fields/properties - PropertyInfo pi = null; - if (Expression.SilverlightQuirks && - members[i].MemberType == MemberTypes.Method && - (pi = GetPropertyNoThrow((MethodInfo)members[i])) != null) { - name = pi.Name; - } -#endif Out(name); Out(" = "); } @@ -777,7 +728,7 @@ namespace System.Linq.Expressions { protected internal override Expression VisitExtension(Expression node) { // Prefer an overriden ToString, if available. var flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.ExactBinding; - var toString = node.GetType().GetMethod("ToString", flags, null, Type.EmptyTypes, null); + var toString = node.GetType().GetMethod("ToString", flags, null, ReflectionUtils.EmptyTypes, null); if (toString.DeclaringType != typeof(Expression)) { Out(node.ToString()); return node; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionType.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionType.cs index 11fbb1dcd4a..1e3e64cbaa5 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionType.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionType.cs @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs index 179152bc027..07c1201ddeb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -19,11 +19,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { using Microsoft.Scripting.Utils; #else diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs index 0bd9827096a..7fa8c9a61b7 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs @@ -17,11 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -51,9 +47,7 @@ namespace System.Linq.Expressions { /// /// Represents an unconditional jump. This includes return statements, break and continue statements, and other jumps. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.GotoExpressionProxy))] -#endif public sealed class GotoExpression : Expression { private readonly GotoExpressionKind _kind; private readonly Expression _value; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IArgumentProvider.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IArgumentProvider.cs index 6dc58ea1765..af67d2bebb6 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IArgumentProvider.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IArgumentProvider.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,7 +17,7 @@ using System; using System.Collections.Generic; using System.Text; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { using Microsoft.Scripting.Utils; #else diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs index 1bbf207cb11..b0498c9ebd0 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -22,11 +22,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -34,9 +30,7 @@ namespace System.Linq.Expressions { /// /// Represents indexing a property or array. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.IndexExpressionProxy))] -#endif public sealed class IndexExpression : Expression, IArgumentProvider { private readonly Expression _instance; private readonly PropertyInfo _indexer; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs index 05501f42d93..2dfdb3a6be7 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,11 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -32,9 +28,7 @@ namespace System.Linq.Expressions { /// /// Represents an expression that applies a delegate or lambda expression to a list of argument expressions. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.InvocationExpressionProxy))] -#endif public sealed class InvocationExpression : Expression, IArgumentProvider { private IList _arguments; private readonly Expression _lambda; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs index 86fc3dfdb40..513b0c4df55 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs @@ -16,7 +16,7 @@ using System; using System.Diagnostics; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -27,9 +27,7 @@ namespace System.Linq.Expressions { /// . Otherwise, it gets the value in . If the /// equals System.Void, no value should be provided. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.LabelExpressionProxy))] -#endif public sealed class LabelExpression : Expression { private readonly Expression _defaultValue; private readonly LabelTarget _target; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelTarget.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelTarget.cs index b9c814995b3..3385dbde64d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelTarget.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LabelTarget.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -16,7 +16,7 @@ using System; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs index 7a53dd04c27..5667f889738 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs @@ -23,11 +23,7 @@ using System.Reflection.Emit; using System.Threading; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -41,9 +37,7 @@ namespace System.Linq.Expressions { /// /// Lambda expressions take input through parameters and are expected to be fully bound. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.LambdaExpressionProxy))] -#endif public abstract class LambdaExpression : Expression { private readonly string _name; private readonly Expression _body; @@ -68,6 +62,8 @@ namespace System.Linq.Expressions { _tailCall = tailCall; } + internal abstract LambdaExpression Accept(StackSpiller spiller); + /// /// Gets the static type of the expression that this represents. (Inherited from .) /// @@ -139,6 +135,7 @@ namespace System.Linq.Expressions { return LambdaCompiler.Compile(this, debugInfoGenerator); } +#if FEATURE_REFEMIT /// /// Compiles the lambda into a method definition. /// @@ -165,8 +162,7 @@ namespace System.Linq.Expressions { LambdaCompiler.Compile(this, method, debugInfoGenerator); } - - internal abstract LambdaExpression Accept(StackSpiller spiller); +#endif } /// diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListArgumentProvider.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListArgumentProvider.cs index 5d2292b46bc..da57959aa6d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListArgumentProvider.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListArgumentProvider.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -18,7 +18,7 @@ using System.Collections.Generic; using System.Text; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs index 71bd0f6c1c4..023fd1f3ad9 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs @@ -1,237 +1,231 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. - * - * This source code is subject to terms and conditions of the Apache License, Version 2.0. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Apache License, Version 2.0, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Apache License, Version 2.0. - * - * You must not remove this notice, or any other, from this software. - * - * - * ***************************************************************************/ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Diagnostics; -using System.Dynamic.Utils; -using System.Reflection; -using System.Runtime.CompilerServices; - -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 -namespace Microsoft.Scripting.Ast { -#else -namespace System.Linq.Expressions { -#endif - /// - /// Represents a constructor call that has a collection initializer. - /// - /// - /// Use the factory methods to create a ListInitExpression. - /// The value of the NodeType property of a ListInitExpression is ListInit. - /// -#if !SILVERLIGHT - [DebuggerTypeProxy(typeof(Expression.ListInitExpressionProxy))] -#endif - public sealed class ListInitExpression : Expression { - private readonly NewExpression _newExpression; - private readonly ReadOnlyCollection _initializers; - - internal ListInitExpression(NewExpression newExpression, ReadOnlyCollection initializers) { - _newExpression = newExpression; - _initializers = initializers; - } - - /// - /// Returns the node type of this . (Inherited from .) - /// - /// The that represents this expression. - public sealed override ExpressionType NodeType { - get { return ExpressionType.ListInit; } - } - - /// - /// Gets the static type of the expression that this represents. (Inherited from .) - /// - /// The that represents the static type of the expression. - public sealed override Type Type { - get { return _newExpression.Type; } - } - - /// - /// Gets a value that indicates whether the expression tree node can be reduced. - /// - public override bool CanReduce { - get { - return true; - } - } - - /// - /// Gets the expression that contains a call to the constructor of a collection type. - /// - public NewExpression NewExpression { - get { return _newExpression; } - } - - /// - /// Gets the element initializers that are used to initialize a collection. - /// - public ReadOnlyCollection Initializers { - get { return _initializers; } - } - - /// - /// Dispatches to the specific visit method for this node type. - /// - protected internal override Expression Accept(ExpressionVisitor visitor) { - return visitor.VisitListInit(this); - } - - /// - /// Reduces the binary expression node to a simpler expression. - /// If CanReduce returns true, this should return a valid expression. - /// This method is allowed to return another node which itself - /// must be reduced. - /// - /// The reduced expression. - public override Expression Reduce() { - return MemberInitExpression.ReduceListInit(_newExpression, _initializers, true); - } - - /// - /// Creates a new expression that is like this one, but using the - /// supplied children. If all of the children are the same, it will - /// return this expression. - /// - /// The property of the result. - /// The property of the result. - /// This expression if no children changed, or an expression with the updated children. - public ListInitExpression Update(NewExpression newExpression, IEnumerable initializers) { - if (newExpression == NewExpression && initializers == Initializers) { - return this; - } - return Expression.ListInit(newExpression, initializers); - } - } - - - public partial class Expression { - /// - /// Creates a that uses a method named "Add" to add elements to a collection. - /// - /// A to set the property equal to. - /// An array of objects to use to populate the collection. - /// A that has the property equal to ListInit and the property set to the specified value. - public static ListInitExpression ListInit(NewExpression newExpression, params Expression[] initializers) { - ContractUtils.RequiresNotNull(newExpression, "newExpression"); - ContractUtils.RequiresNotNull(initializers, "initializers"); - return ListInit(newExpression, initializers as IEnumerable); - } - - /// - /// Creates a that uses a method named "Add" to add elements to a collection. - /// - /// A to set the property equal to. - /// An that contains objects to use to populate the collection. - /// A that has the property equal to ListInit and the property set to the specified value. - public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable initializers) { - ContractUtils.RequiresNotNull(newExpression, "newExpression"); - ContractUtils.RequiresNotNull(initializers, "initializers"); - - var initializerlist = initializers.ToReadOnly(); - if (initializerlist.Count == 0) { - throw Error.ListInitializerWithZeroMembers(); - } - - MethodInfo addMethod = FindMethod(newExpression.Type, "Add", null, new Expression[] { initializerlist[0] }, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - return ListInit(newExpression, addMethod, initializers); - } - - /// - /// Creates a that uses a specified method to add elements to a collection. - /// - /// A to set the property equal to. - /// A that represents an instance method named "Add" (case insensitive), that adds an element to a collection. - /// An array of objects to use to populate the collection. - /// A that has the property equal to ListInit and the property set to the specified value. - public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, params Expression[] initializers) { - if (addMethod == null) { - return ListInit(newExpression, initializers as IEnumerable); - } - ContractUtils.RequiresNotNull(newExpression, "newExpression"); - ContractUtils.RequiresNotNull(initializers, "initializers"); - return ListInit(newExpression, addMethod, initializers as IEnumerable); - } - - /// - /// Creates a that uses a specified method to add elements to a collection. - /// - /// A to set the property equal to. - /// A that represents an instance method named "Add" (case insensitive), that adds an element to a collection. - /// An that contains objects to use to populate the Initializers collection. - /// A that has the property equal to ListInit and the property set to the specified value. - public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, IEnumerable initializers) { - if (addMethod == null) { - return ListInit(newExpression, initializers); - } - ContractUtils.RequiresNotNull(newExpression, "newExpression"); - ContractUtils.RequiresNotNull(initializers, "initializers"); - - var initializerlist = initializers.ToReadOnly(); - if (initializerlist.Count == 0) { - throw Error.ListInitializerWithZeroMembers(); - } - ElementInit[] initList = new ElementInit[initializerlist.Count]; - for (int i = 0; i < initializerlist.Count; i++) { - initList[i] = ElementInit(addMethod, initializerlist[i]); - } - return ListInit(newExpression, new TrueReadOnlyCollection(initList)); - } - - /// - /// Creates a that uses specified objects to initialize a collection. - /// - /// A to set the property equal to. - /// An array that contains objects to use to populate the collection. - /// - /// A that has the property equal to ListInit - /// and the and properties set to the specified values. - /// - /// - /// The property of must represent a type that implements . - /// The property of the resulting is equal to newExpression.Type. - /// - public static ListInitExpression ListInit(NewExpression newExpression, params ElementInit[] initializers) { - return ListInit(newExpression, (IEnumerable)initializers); - } - - /// - /// Creates a that uses specified objects to initialize a collection. - /// - /// A to set the property equal to. - /// An that contains objects to use to populate the collection. - /// An that contains objects to use to populate the collection. - /// - /// The property of must represent a type that implements . - /// The property of the resulting is equal to newExpression.Type. - /// - public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable initializers) { - ContractUtils.RequiresNotNull(newExpression, "newExpression"); - ContractUtils.RequiresNotNull(initializers, "initializers"); - var initializerlist = initializers.ToReadOnly(); - if (initializerlist.Count == 0) { - throw Error.ListInitializerWithZeroMembers(); - } - ValidateListInitArgs(newExpression.Type, initializerlist); - return new ListInitExpression(newExpression, initializerlist); - } - } -} +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Dynamic.Utils; +using System.Reflection; +using System.Runtime.CompilerServices; + +#if !FEATURE_CORE_DLR +namespace Microsoft.Scripting.Ast { +#else +namespace System.Linq.Expressions { +#endif + /// + /// Represents a constructor call that has a collection initializer. + /// + /// + /// Use the factory methods to create a ListInitExpression. + /// The value of the NodeType property of a ListInitExpression is ListInit. + /// + [DebuggerTypeProxy(typeof(Expression.ListInitExpressionProxy))] + public sealed class ListInitExpression : Expression { + private readonly NewExpression _newExpression; + private readonly ReadOnlyCollection _initializers; + + internal ListInitExpression(NewExpression newExpression, ReadOnlyCollection initializers) { + _newExpression = newExpression; + _initializers = initializers; + } + + /// + /// Returns the node type of this . (Inherited from .) + /// + /// The that represents this expression. + public sealed override ExpressionType NodeType { + get { return ExpressionType.ListInit; } + } + + /// + /// Gets the static type of the expression that this represents. (Inherited from .) + /// + /// The that represents the static type of the expression. + public sealed override Type Type { + get { return _newExpression.Type; } + } + + /// + /// Gets a value that indicates whether the expression tree node can be reduced. + /// + public override bool CanReduce { + get { + return true; + } + } + + /// + /// Gets the expression that contains a call to the constructor of a collection type. + /// + public NewExpression NewExpression { + get { return _newExpression; } + } + + /// + /// Gets the element initializers that are used to initialize a collection. + /// + public ReadOnlyCollection Initializers { + get { return _initializers; } + } + + /// + /// Dispatches to the specific visit method for this node type. + /// + protected internal override Expression Accept(ExpressionVisitor visitor) { + return visitor.VisitListInit(this); + } + + /// + /// Reduces the binary expression node to a simpler expression. + /// If CanReduce returns true, this should return a valid expression. + /// This method is allowed to return another node which itself + /// must be reduced. + /// + /// The reduced expression. + public override Expression Reduce() { + return MemberInitExpression.ReduceListInit(_newExpression, _initializers, true); + } + + /// + /// Creates a new expression that is like this one, but using the + /// supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. + public ListInitExpression Update(NewExpression newExpression, IEnumerable initializers) { + if (newExpression == NewExpression && initializers == Initializers) { + return this; + } + return Expression.ListInit(newExpression, initializers); + } + } + + + public partial class Expression { + /// + /// Creates a that uses a method named "Add" to add elements to a collection. + /// + /// A to set the property equal to. + /// An array of objects to use to populate the collection. + /// A that has the property equal to ListInit and the property set to the specified value. + public static ListInitExpression ListInit(NewExpression newExpression, params Expression[] initializers) { + ContractUtils.RequiresNotNull(newExpression, "newExpression"); + ContractUtils.RequiresNotNull(initializers, "initializers"); + return ListInit(newExpression, initializers as IEnumerable); + } + + /// + /// Creates a that uses a method named "Add" to add elements to a collection. + /// + /// A to set the property equal to. + /// An that contains objects to use to populate the collection. + /// A that has the property equal to ListInit and the property set to the specified value. + public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable initializers) { + ContractUtils.RequiresNotNull(newExpression, "newExpression"); + ContractUtils.RequiresNotNull(initializers, "initializers"); + + var initializerlist = initializers.ToReadOnly(); + if (initializerlist.Count == 0) { + throw Error.ListInitializerWithZeroMembers(); + } + + MethodInfo addMethod = FindMethod(newExpression.Type, "Add", null, new Expression[] { initializerlist[0] }, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + return ListInit(newExpression, addMethod, initializers); + } + + /// + /// Creates a that uses a specified method to add elements to a collection. + /// + /// A to set the property equal to. + /// A that represents an instance method named "Add" (case insensitive), that adds an element to a collection. + /// An array of objects to use to populate the collection. + /// A that has the property equal to ListInit and the property set to the specified value. + public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, params Expression[] initializers) { + if (addMethod == null) { + return ListInit(newExpression, initializers as IEnumerable); + } + ContractUtils.RequiresNotNull(newExpression, "newExpression"); + ContractUtils.RequiresNotNull(initializers, "initializers"); + return ListInit(newExpression, addMethod, initializers as IEnumerable); + } + + /// + /// Creates a that uses a specified method to add elements to a collection. + /// + /// A to set the property equal to. + /// A that represents an instance method named "Add" (case insensitive), that adds an element to a collection. + /// An that contains objects to use to populate the Initializers collection. + /// A that has the property equal to ListInit and the property set to the specified value. + public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, IEnumerable initializers) { + if (addMethod == null) { + return ListInit(newExpression, initializers); + } + ContractUtils.RequiresNotNull(newExpression, "newExpression"); + ContractUtils.RequiresNotNull(initializers, "initializers"); + + var initializerlist = initializers.ToReadOnly(); + if (initializerlist.Count == 0) { + throw Error.ListInitializerWithZeroMembers(); + } + ElementInit[] initList = new ElementInit[initializerlist.Count]; + for (int i = 0; i < initializerlist.Count; i++) { + initList[i] = ElementInit(addMethod, initializerlist[i]); + } + return ListInit(newExpression, new TrueReadOnlyCollection(initList)); + } + + /// + /// Creates a that uses specified objects to initialize a collection. + /// + /// A to set the property equal to. + /// An array that contains objects to use to populate the collection. + /// + /// A that has the property equal to ListInit + /// and the and properties set to the specified values. + /// + /// + /// The property of must represent a type that implements . + /// The property of the resulting is equal to newExpression.Type. + /// + public static ListInitExpression ListInit(NewExpression newExpression, params ElementInit[] initializers) { + return ListInit(newExpression, (IEnumerable)initializers); + } + + /// + /// Creates a that uses specified objects to initialize a collection. + /// + /// A to set the property equal to. + /// An that contains objects to use to populate the collection. + /// An that contains objects to use to populate the collection. + /// + /// The property of must represent a type that implements . + /// The property of the resulting is equal to newExpression.Type. + /// + public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable initializers) { + ContractUtils.RequiresNotNull(newExpression, "newExpression"); + ContractUtils.RequiresNotNull(initializers, "initializers"); + var initializerlist = initializers.ToReadOnly(); + if (initializerlist.Count == 0) { + throw Error.ListInitializerWithZeroMembers(); + } + ValidateListInitArgs(newExpression.Type, initializerlist); + return new ListInitExpression(newExpression, initializerlist); + } + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs index 5c216ab2d94..f9801246150 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs @@ -17,11 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -29,9 +25,7 @@ namespace System.Linq.Expressions { /// /// Represents an infinite loop. It can be exited with "break". /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.LoopExpressionProxy))] -#endif public sealed class LoopExpression : Expression { private readonly Expression _body; private readonly LabelTarget _break; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs index d08a85ce55d..b5b205444eb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,11 +17,7 @@ using System; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -108,4 +104,4 @@ namespace System.Linq.Expressions { } } } -} +} \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberBinding.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberBinding.cs index fdeafaf79ae..c9d7ed846a9 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberBinding.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberBinding.cs @@ -16,7 +16,7 @@ using System; using System.Reflection; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -79,4 +79,4 @@ namespace System.Linq.Expressions { return ExpressionStringBuilder.MemberBindingToString(this); } } -} +} \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs index e314cda8456..0c06640e32c 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs @@ -18,11 +18,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -31,9 +27,7 @@ namespace System.Linq.Expressions { /// /// Represents accessing a field or property. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.MemberExpressionProxy))] -#endif public class MemberExpression : Expression { private readonly Expression _expression; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs index 2eb7fe33db0..04cdd20785f 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,7 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -28,9 +28,7 @@ namespace System.Linq.Expressions { /// /// Represents calling a constructor and initializing one or more members of the new object. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.MemberInitExpressionProxy))] -#endif public sealed class MemberInitExpression : Expression { private readonly NewExpression _newExpression; private readonly ReadOnlyCollection _bindings; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs index 0badf175f46..52774f06e4d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,11 +20,7 @@ using System.Collections.ObjectModel; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -138,4 +134,4 @@ namespace System.Linq.Expressions { } } } -} +} \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs index 9fcc4312b52..6a54633c933 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -19,11 +19,7 @@ using System.Collections.ObjectModel; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -152,4 +148,4 @@ namespace System.Linq.Expressions { } } } -} +} \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs index 66b3bb001dc..1656811de99 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs @@ -21,11 +21,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -33,9 +29,7 @@ namespace System.Linq.Expressions { /// /// Represents a call to either static or an instance method. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.MethodCallExpressionProxy))] -#endif public class MethodCallExpression : Expression, IArgumentProvider { private readonly MethodInfo _method; @@ -814,9 +808,6 @@ namespace System.Linq.Expressions { private static void ValidateStaticOrInstanceMethod(Expression instance, MethodInfo method) { if (method.IsStatic) { -#if SILVERLIGHT - if (SilverlightQuirks) return; -#endif if (instance != null) throw new ArgumentException(Strings.OnlyStaticMethodsHaveNullInstance, "instance"); } else { if (instance == null) throw new ArgumentException(Strings.OnlyStaticMethodsHaveNullInstance, "method"); @@ -917,9 +908,6 @@ namespace System.Linq.Expressions { // quote (produce a new tree closed over parameter values), only // works consistently for lambdas Type quoteable = typeof(LambdaExpression); -#if SILVERLIGHT - if (SilverlightQuirks) quoteable = typeof(Expression); -#endif if (TypeUtils.IsSameOrSubclass(quoteable, parameterType) && parameterType.IsAssignableFrom(argument.GetType())) { argument = Expression.Quote(argument); diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs index e51b6f20a1e..d8bf56adea8 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs @@ -20,11 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -33,9 +29,7 @@ namespace System.Linq.Expressions { /// /// Represents creating a new array and possibly initializing the elements of the new array. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.NewArrayExpressionProxy))] -#endif public class NewArrayExpression : Expression { private readonly ReadOnlyCollection _expressions; private readonly Type _type; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs index 0b3381e92ec..408ae7d99a4 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs @@ -20,23 +20,17 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; +using Microsoft.Scripting.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { #endif - /// /// Represents a constructor call. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.NewExpressionProxy))] -#endif public class NewExpression : Expression, IArgumentProvider { private readonly ConstructorInfo _constructor; private IList _arguments; @@ -213,7 +207,7 @@ namespace System.Linq.Expressions { } ConstructorInfo ci = null; if (!type.IsValueType) { - ci = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, System.Type.EmptyTypes, null); + ci = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, ReflectionUtils.EmptyTypes, null); if (ci == null) { throw Error.TypeMissingDefaultConstructor(type); } @@ -319,13 +313,6 @@ namespace System.Linq.Expressions { if (method.IsStatic) { throw Error.ArgumentMustBeInstanceMember(); } -#if SILVERLIGHT - if (SilverlightQuirks) { - // we used to just store the MethodInfo - memberType = method.ReturnType; - return; - } -#endif PropertyInfo prop = GetProperty(method); member = prop; memberType = prop.PropertyType; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs index df225f11b7a..42a8628181a 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,11 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -30,9 +26,7 @@ namespace System.Linq.Expressions { /// /// Represents a named parameter expression. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.ParameterExpressionProxy))] -#endif public class ParameterExpression : Expression { private readonly string _name; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs index 5d7e53efb26..a79b12657e3 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,7 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -30,9 +30,7 @@ namespace System.Linq.Expressions { /// Needed to implement "eval" in some dynamic languages. /// Evaluates to an instance of when executed. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.RuntimeVariablesExpressionProxy))] -#endif public sealed class RuntimeVariablesExpression : Expression { private readonly ReadOnlyCollection _variables; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchCase.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchCase.cs index 2316a65934e..ed080daa52c 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchCase.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchCase.cs @@ -19,7 +19,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -27,9 +27,7 @@ namespace System.Linq.Expressions { /// /// Represents one case of a . /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.SwitchCaseProxy))] -#endif public sealed class SwitchCase { private readonly ReadOnlyCollection _testValues; private readonly Expression _body; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs index cff43227771..2bc10185b43 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs @@ -20,11 +20,7 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -32,9 +28,7 @@ namespace System.Linq.Expressions { /// /// Represents a control expression that handles multiple selections by passing control to a . /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.SwitchExpressionProxy))] -#endif public sealed class SwitchExpression : Expression { private readonly Type _type; private readonly Expression _switchValue; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SymbolDocumentInfo.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SymbolDocumentInfo.cs index 1b20bafe5e2..1bb206e63dc 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SymbolDocumentInfo.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/SymbolDocumentInfo.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -16,7 +16,7 @@ using System; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs index 0959ac7cea4..9d19f67a981 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs @@ -19,11 +19,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -38,9 +34,7 @@ namespace System.Linq.Expressions { /// Only one of fault or finally can be supplied. /// The return type of the try block must match the return type of any associated catch statements. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.TryExpressionProxy))] -#endif public sealed class TryExpression : Expression { private readonly Type _type; private readonly Expression _body; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs index ef5ba7de9f0..0e3b2eee7a5 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs @@ -17,11 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -29,9 +25,7 @@ namespace System.Linq.Expressions { /// /// Represents an operation between an expression and a type. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.TypeBinaryExpressionProxy))] -#endif public sealed class TypeBinaryExpression : Expression { private readonly Expression _expression; private readonly Type _typeOperand; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs index 10b518510a2..41a30c1007d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs @@ -13,14 +13,11 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; #endif -#if SILVERLIGHT -using System.Core; -#endif using System.Collections.Generic; using System.Diagnostics; @@ -147,12 +144,11 @@ namespace System.Dynamic.Utils { return false; } - internal static bool AreEquivalent(Type t1, Type t2) - { -#if CLR2 || SILVERLIGHT - return t1 == t2; -#else + internal static bool AreEquivalent(Type t1, Type t2) { +#if FEATURE_TYPE_EQUIVALENCE return t1 == t2 || t1.IsEquivalentTo(t2); +#else + return t1 == t2; #endif } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs index b71b138c705..8cf3b2a6190 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs @@ -19,11 +19,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { @@ -32,9 +28,7 @@ namespace System.Linq.Expressions { /// /// Represents an expression that has a unary operator. /// -#if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.UnaryExpressionProxy))] -#endif public sealed class UnaryExpression : Expression { private readonly Expression _operand; private readonly MethodInfo _method; @@ -788,9 +782,6 @@ namespace System.Linq.Expressions { public static UnaryExpression Quote(Expression expression) { RequiresCanRead(expression, "expression"); bool validQuote = expression is LambdaExpression; -#if SILVERLIGHT - validQuote |= SilverlightQuirks; -#endif if (!validQuote) throw Error.QuotedExpressionMustBeLambda(); return new UnaryExpression(ExpressionType.Quote, expression, expression.GetType(), null); } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/.gitattributes b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/.gitattributes deleted file mode 100644 index 9b2b3f88b17..00000000000 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/LambdaCompiler.Lambda.cs -crlf diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AnalyzedTree.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AnalyzedTree.cs index 3b8c6c2a86f..9afe053f9ac 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AnalyzedTree.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AnalyzedTree.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -19,7 +19,7 @@ using System.Diagnostics.SymbolStore; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AssemblyGen.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AssemblyGen.cs index b908bcfadbc..37a5aa66308 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AssemblyGen.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/AssemblyGen.cs @@ -12,6 +12,7 @@ * * * ***************************************************************************/ +#if FEATURE_REFEMIT using System; using System.Collections.Generic; @@ -23,7 +24,9 @@ using System.Security; using System.Text; using System.Threading; -#if CLR2 +using Microsoft.Scripting.Utils; + +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { @@ -33,7 +36,7 @@ namespace System.Linq.Expressions.Compiler { // Testing options. Only ever set in CLR2 build // configurations, see SetSaveAssemblies -#if CLR2 +#if !FEATURE_CORE_DLR private static string _saveAssembliesPath; private static bool _saveAssemblies; #endif @@ -41,7 +44,7 @@ namespace System.Linq.Expressions.Compiler { private readonly AssemblyBuilder _myAssembly; private readonly ModuleBuilder _myModule; -#if CLR2 && !SILVERLIGHT +#if !FEATURE_CORE_DLR && !SILVERLIGHT private readonly string _outFileName; // can be null iff !SaveAndReloadAssemblies private readonly string _outDir; // null means the current directory #endif @@ -66,10 +69,10 @@ namespace System.Linq.Expressions.Compiler { // mark the assembly transparent so that it works in partial trust: var attributes = new[] { - new CustomAttributeBuilder(typeof(SecurityTransparentAttribute).GetConstructor(Type.EmptyTypes), new object[0]) + new CustomAttributeBuilder(typeof(SecurityTransparentAttribute).GetConstructor(ReflectionUtils.EmptyTypes), new object[0]) }; -#if CLR2 +#if !FEATURE_CORE_DLR if (_saveAssemblies) { string outDir = _saveAssembliesPath ?? Directory.GetCurrentDirectory(); try { @@ -128,7 +131,7 @@ namespace System.Linq.Expressions.Compiler { ); } -#if CLR2 +#if !FEATURE_CORE_DLR //Return the location of the saved assembly file. //The file location is used by PE verification in Microsoft.Scripting. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] @@ -170,10 +173,5 @@ namespace System.Linq.Expressions.Compiler { } #endif } - - internal static class SymbolGuids { - internal static readonly Guid DocumentType_Text = - new Guid(0x5a869d0b, 0x6611, 0x11d3, 0xbd, 0x2a, 0, 0, 0xf8, 8, 0x49, 0xbd); - } } - +#endif \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/BoundConstants.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/BoundConstants.cs index 5afdbd31f7b..e7b604209ca 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/BoundConstants.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/BoundConstants.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,11 +20,7 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Dynamic.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { @@ -52,11 +48,13 @@ namespace System.Linq.Expressions.Compiler { } public override int GetHashCode() { - return RuntimeHelpers.GetHashCode(Value) ^ Type.GetHashCode(); + return ReferenceEqualityComparer.Instance.GetHashCode(Value) ^ Type.GetHashCode(); } + public bool Equals(TypedConstant other) { return object.ReferenceEquals(Value, other.Value) && Type.Equals(other.Type); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2231:OverloadOperatorEqualsOnOverridingValueTypeEquals")] public override bool Equals(object obj) { return (obj is TypedConstant) && Equals((TypedConstant)obj); diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs index 0adc8608ffa..6c8bd4bc3f1 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.Storage.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.Storage.cs index e736ac60f3f..18e7d5aa882 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.Storage.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.Storage.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -18,7 +18,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { @@ -183,4 +183,4 @@ namespace System.Linq.Expressions.Compiler { } } } -} +} \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.cs index ab3d884bd8c..4391c6d6abb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -21,12 +21,9 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Dynamic; using System.Dynamic.Utils; +using Microsoft.Scripting.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { @@ -205,7 +202,7 @@ namespace System.Linq.Expressions.Compiler { } // No visible variables - lc.IL.Emit(OpCodes.Call, typeof(RuntimeOps).GetMethod("CreateRuntimeVariables", Type.EmptyTypes)); + lc.IL.Emit(OpCodes.Call, typeof(RuntimeOps).GetMethod("CreateRuntimeVariables", ReflectionUtils.EmptyTypes)); return; } @@ -321,13 +318,13 @@ namespace System.Linq.Expressions.Compiler { ResolveVariable(v, _closureHoistedLocals).EmitLoad(); lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(new Type[] { v.Type })); } else { -#if CLR2 +#if !FEATURE_CORE_DLR // array[i] = new StrongBox(default(T)); lc.IL.EmitDefault(v.Type); lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(new Type[] { v.Type })); #else // array[i] = new StrongBox(); - lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(Type.EmptyTypes)); + lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(ReflectionUtils.EmptyTypes)); #endif } // if we want to cache this into a local, do it now diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ConstantCheck.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ConstantCheck.cs index b901792925c..11470281c84 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ConstantCheck.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ConstantCheck.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,7 +17,7 @@ using System; using System.Diagnostics; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs index c20cde6f58a..95dea78f1fe 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; using Microsoft.Scripting.Ast.Compiler; #else @@ -30,7 +30,7 @@ using System.Diagnostics.SymbolStore; using System.Reflection; namespace System.Runtime.CompilerServices { -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT using ILGenerator = OffsetTrackingILGenerator; #endif @@ -38,6 +38,7 @@ namespace System.Runtime.CompilerServices { /// Generates debug information for lambdas in an expression tree. /// public abstract class DebugInfoGenerator { +#if FEATURE_PDBEMIT /// /// Creates PDB symbol generator. /// @@ -45,7 +46,7 @@ namespace System.Runtime.CompilerServices { public static DebugInfoGenerator CreatePdbGenerator() { return new SymbolDocumentGenerator(); } - +#endif /// /// Marks a sequence point. /// diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs index fe319376ff5..b2e172ff8fb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs @@ -21,7 +21,7 @@ using System.Dynamic; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { using Microsoft.Scripting.Utils; #else diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs index 47079f8894d..d16f40e4354 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs @@ -18,7 +18,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Reflection.Emit; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { @@ -30,6 +30,7 @@ namespace System.Linq.Expressions.Compiler { private static readonly Type[] _DelegateCtorSignature = new Type[] { typeof(object), typeof(IntPtr) }; private static Type MakeNewCustomDelegate(Type[] types) { +#if FEATURE_REFEMIT Type returnType = types[types.Length - 1]; Type[] parameters = types.RemoveLast(); @@ -37,6 +38,9 @@ namespace System.Linq.Expressions.Compiler { builder.DefineConstructor(CtorAttributes, CallingConventions.Standard, _DelegateCtorSignature).SetImplementationFlags(ImplAttributes); builder.DefineMethod("Invoke", InvokeAttributes, returnType, parameters).SetImplementationFlags(ImplAttributes); return builder.CreateType(); +#else + throw new NotSupportedException("Method signature not supported on this platform"); +#endif } } } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ExpressionQuoter.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ExpressionQuoter.cs index 059308be44e..b26a8266d18 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ExpressionQuoter.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ExpressionQuoter.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; using Microsoft.Scripting.Ast.Compiler; #else diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/HoistedLocals.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/HoistedLocals.cs index 8c315fff4f7..b6db15ad2e2 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/HoistedLocals.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/HoistedLocals.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -18,7 +18,7 @@ using System.Collections.ObjectModel; using System.Runtime.CompilerServices; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ILGen.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ILGen.cs index c08076ec0d3..5577d656495 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ILGen.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/ILGen.cs @@ -20,17 +20,14 @@ using System.Dynamic.Utils; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; +using Microsoft.Scripting.Utils; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { #endif -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT using ILGenerator = OffsetTrackingILGenerator; #endif @@ -526,7 +523,12 @@ namespace System.Linq.Expressions.Compiler { } internal static bool ShouldLdtoken(Type t) { - return t is TypeBuilder || t.IsGenericParameter || t.IsVisible; +#if FEATURE_REFEMIT + if (t is TypeBuilder) { + return true; + } +#endif + return t.IsGenericParameter || t.IsVisible; } internal static bool ShouldLdtoken(MethodBase mb) { @@ -878,7 +880,7 @@ namespace System.Linq.Expressions.Compiler { internal static void EmitGetValueOrDefault(this ILGenerator il, Type nullableType) { - MethodInfo mi = nullableType.GetMethod("GetValueOrDefault", System.Type.EmptyTypes); + MethodInfo mi = nullableType.GetMethod("GetValueOrDefault", ReflectionUtils.EmptyTypes); Debug.Assert(nullableType.IsValueType); il.Emit(OpCodes.Call, mi); } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/KeyedQueue.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/KeyedQueue.cs index fdd6e2f8066..cdca6446351 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/KeyedQueue.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/KeyedQueue.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -15,11 +15,7 @@ using System.Collections.Generic; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LabelInfo.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LabelInfo.cs index 435f066910a..74e05ff3090 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LabelInfo.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LabelInfo.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -19,16 +19,12 @@ using System.Diagnostics; using System.Dynamic.Utils; using System.Reflection.Emit; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { #endif -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT using ILGenerator = OffsetTrackingILGenerator; #endif diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Address.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Address.cs index cb208f2b9fa..5b34dd25aed 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Address.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Address.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,7 +20,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Reflection.Emit; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs index 6e4ac1f0112..a089b81222d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,11 +20,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Reflection.Emit; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.ControlFlow.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.ControlFlow.cs index 0501f9d660a..2e8cede7064 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.ControlFlow.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.ControlFlow.cs @@ -16,7 +16,7 @@ using System.Diagnostics; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs index 70538606d7b..10abcd4ef62 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -22,11 +22,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { @@ -179,7 +175,7 @@ namespace System.Linq.Expressions.Compiler { expr = node.Expression; if (typeof(LambdaExpression).IsAssignableFrom(expr.Type)) { // if the invoke target is a lambda expression tree, first compile it into a delegate - expr = Expression.Call(expr, expr.Type.GetMethod("Compile", Type.EmptyTypes)); + expr = Expression.Call(expr, expr.Type.GetMethod("Compile", new Type[0])); } expr = Expression.Call(expr, expr.Type.GetMethod("Invoke"), node.Arguments); @@ -494,7 +490,7 @@ namespace System.Linq.Expressions.Compiler { // Emit the temp as type CallSite so we get more reuse _ilg.Emit(OpCodes.Dup); -#if CLR2 +#if !FEATURE_CORE_DLR // For 3.5, emit the temp as CallSite to work around a Jit32 // verifier issue (fixed in 3.5 sp1) var siteTemp = GetLocal(siteType); diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Generated.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Generated.cs index 405eb6ddf09..bd79a7a50de 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Generated.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Generated.cs @@ -16,7 +16,7 @@ using System.Diagnostics; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Lambda.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Lambda.cs index a2e58076f08..40756223bdf 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Lambda.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Lambda.cs @@ -1,193 +1,199 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. - * - * This source code is subject to terms and conditions of the Apache License, Version 2.0. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Apache License, Version 2.0, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Apache License, Version 2.0. - * - * You must not remove this notice, or any other, from this software. - * - * - * ***************************************************************************/ - -using System; -using System.Diagnostics; -using System.Dynamic.Utils; -using System.Reflection; -using System.Reflection.Emit; -using System.Runtime.CompilerServices; -using System.Threading; - -#if CLR2 -namespace Microsoft.Scripting.Ast.Compiler { -#else -namespace System.Linq.Expressions.Compiler { -#endif - - /// - /// Dynamic Language Runtime Compiler. - /// This part compiles lambdas. - /// - partial class LambdaCompiler { - private static int _Counter; - - internal void EmitConstantArray(T[] array) { - // Emit as runtime constant if possible - // if not, emit into IL - if (_method is DynamicMethod) { - EmitConstant(array, typeof(T[])); - } else if(_typeBuilder != null) { - // store into field in our type builder, we will initialize - // the value only once. - FieldBuilder fb = CreateStaticField("ConstantArray", typeof(T[])); - Label l = _ilg.DefineLabel(); - _ilg.Emit(OpCodes.Ldsfld, fb); - _ilg.Emit(OpCodes.Ldnull); - _ilg.Emit(OpCodes.Bne_Un, l); - _ilg.EmitArray(array); - _ilg.Emit(OpCodes.Stsfld, fb); - _ilg.MarkLabel(l); - _ilg.Emit(OpCodes.Ldsfld, fb); - } else { - _ilg.EmitArray(array); - } - } - - private void EmitClosureCreation(LambdaCompiler inner) { - bool closure = inner._scope.NeedsClosure; - bool boundConstants = inner._boundConstants.Count > 0; - - if (!closure && !boundConstants) { - _ilg.EmitNull(); - return; - } - - // new Closure(constantPool, currentHoistedLocals) - if (boundConstants) { - _boundConstants.EmitConstant(this, inner._boundConstants.ToArray(), typeof(object[])); - } else { - _ilg.EmitNull(); - } - if (closure) { - _scope.EmitGet(_scope.NearestHoistedLocals.SelfVariable); - } else { - _ilg.EmitNull(); - } - _ilg.EmitNew(typeof(Closure).GetConstructor(new Type[] { typeof(object[]), typeof(object[]) })); - } - - /// - /// Emits code which creates new instance of the delegateType delegate. - /// - /// Since the delegate is getting closed over the "Closure" argument, this - /// cannot be used with virtual/instance methods (inner must be static method) - /// - private void EmitDelegateConstruction(LambdaCompiler inner) { - Type delegateType = inner._lambda.Type; - DynamicMethod dynamicMethod = inner._method as DynamicMethod; - if (dynamicMethod != null) { - // dynamicMethod.CreateDelegate(delegateType, closure) - _boundConstants.EmitConstant(this, dynamicMethod, typeof(DynamicMethod)); - _ilg.EmitType(delegateType); - EmitClosureCreation(inner); - _ilg.Emit(OpCodes.Callvirt, typeof(DynamicMethod).GetMethod("CreateDelegate", new Type[] { typeof(Type), typeof(object) })); - _ilg.Emit(OpCodes.Castclass, delegateType); - } else { - // new DelegateType(closure) - EmitClosureCreation(inner); - _ilg.Emit(OpCodes.Ldftn, (MethodInfo)inner._method); - _ilg.Emit(OpCodes.Newobj, (ConstructorInfo)(delegateType.GetMember(".ctor")[0])); - } - } - - /// - /// Emits a delegate to the method generated for the LambdaExpression. - /// May end up creating a wrapper to match the requested delegate type. - /// - /// Lambda for which to generate a delegate - /// - private void EmitDelegateConstruction(LambdaExpression lambda) { - // 1. Create the new compiler - LambdaCompiler impl; - if (_method is DynamicMethod) { - impl = new LambdaCompiler(_tree, lambda); - } else { - // When the lambda does not have a name or the name is empty, generate a unique name for it. - string name = String.IsNullOrEmpty(lambda.Name) ? GetUniqueMethodName() : lambda.Name; - MethodBuilder mb = _typeBuilder.DefineMethod(name, MethodAttributes.Private | MethodAttributes.Static); - impl = new LambdaCompiler(_tree, lambda, mb); - } - - // 2. emit the lambda - // Since additional ILs are always emitted after the lambda's body, should not emit with tail call optimization. - impl.EmitLambdaBody(_scope, false, CompilationFlags.EmitAsNoTail); - - // 3. emit the delegate creation in the outer lambda - EmitDelegateConstruction(impl); - } - - private static Type[] GetParameterTypes(LambdaExpression lambda) { - return lambda.Parameters.Map(p => p.IsByRef ? p.Type.MakeByRefType() : p.Type); - } - - private static string GetUniqueMethodName() { - return "{" + Interlocked.Increment(ref _Counter) + "}lambda_method"; - } - - private void EmitLambdaBody() { - // The lambda body is the "last" expression of the lambda - CompilationFlags tailCallFlag = _lambda.TailCall ? CompilationFlags.EmitAsTail : CompilationFlags.EmitAsNoTail; - EmitLambdaBody(null, false, tailCallFlag); - } - - /// - /// Emits the lambda body. If inlined, the parameters should already be - /// pushed onto the IL stack. - /// - /// The parent scope. - /// true if the lambda is inlined; false otherwise. - /// - /// The emum to specify if the lambda is compiled with the tail call optimization. - /// - private void EmitLambdaBody(CompilerScope parent, bool inlined, CompilationFlags flags) { - _scope.Enter(this, parent); - - if (inlined) { - // The arguments were already pushed onto the IL stack. - // Store them into locals, popping in reverse order. - // - // If any arguments were ByRef, the address is on the stack and - // we'll be storing it into the variable, which has a ref type. - for (int i = _lambda.Parameters.Count - 1; i >= 0; i--) { - _scope.EmitSet(_lambda.Parameters[i]); - } - } - - // Need to emit the expression start for the lambda body - flags = UpdateEmitExpressionStartFlag(flags, CompilationFlags.EmitExpressionStart); - if (_lambda.ReturnType == typeof(void)) { - EmitExpressionAsVoid(_lambda.Body, flags); - } else { - EmitExpression(_lambda.Body, flags); - } - - // Return must be the last instruction in a CLI method. - // But if we're inlining the lambda, we want to leave the return - // value on the IL stack. - if (!inlined) { - _ilg.Emit(OpCodes.Ret); - } - - _scope.Exit(); - - // Validate labels - Debug.Assert(_labelBlock.Parent == null && _labelBlock.Kind == LabelScopeKind.Lambda); - foreach (LabelInfo label in _labelInfo.Values) { - label.ValidateFinish(); - } - } - } -} +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System; +using System.Diagnostics; +using System.Dynamic.Utils; +using System.Reflection; +using System.Reflection.Emit; +using System.Runtime.CompilerServices; +using System.Threading; + +#if !FEATURE_CORE_DLR +namespace Microsoft.Scripting.Ast.Compiler { +#else +namespace System.Linq.Expressions.Compiler { +#endif + + /// + /// Dynamic Language Runtime Compiler. + /// This part compiles lambdas. + /// + partial class LambdaCompiler { + private static int _Counter; + + internal void EmitConstantArray(T[] array) { + // Emit as runtime constant if possible + // if not, emit into IL + if (_method is DynamicMethod) { + EmitConstant(array, typeof(T[])); +#if FEATURE_REFEMIT + } else if(_typeBuilder != null) { + // store into field in our type builder, we will initialize + // the value only once. + FieldBuilder fb = CreateStaticField("ConstantArray", typeof(T[])); + Label l = _ilg.DefineLabel(); + _ilg.Emit(OpCodes.Ldsfld, fb); + _ilg.Emit(OpCodes.Ldnull); + _ilg.Emit(OpCodes.Bne_Un, l); + _ilg.EmitArray(array); + _ilg.Emit(OpCodes.Stsfld, fb); + _ilg.MarkLabel(l); + _ilg.Emit(OpCodes.Ldsfld, fb); +#endif + } else { + _ilg.EmitArray(array); + } + } + + private void EmitClosureCreation(LambdaCompiler inner) { + bool closure = inner._scope.NeedsClosure; + bool boundConstants = inner._boundConstants.Count > 0; + + if (!closure && !boundConstants) { + _ilg.EmitNull(); + return; + } + + // new Closure(constantPool, currentHoistedLocals) + if (boundConstants) { + _boundConstants.EmitConstant(this, inner._boundConstants.ToArray(), typeof(object[])); + } else { + _ilg.EmitNull(); + } + if (closure) { + _scope.EmitGet(_scope.NearestHoistedLocals.SelfVariable); + } else { + _ilg.EmitNull(); + } + _ilg.EmitNew(typeof(Closure).GetConstructor(new Type[] { typeof(object[]), typeof(object[]) })); + } + + /// + /// Emits code which creates new instance of the delegateType delegate. + /// + /// Since the delegate is getting closed over the "Closure" argument, this + /// cannot be used with virtual/instance methods (inner must be static method) + /// + private void EmitDelegateConstruction(LambdaCompiler inner) { + Type delegateType = inner._lambda.Type; + DynamicMethod dynamicMethod = inner._method as DynamicMethod; + if (dynamicMethod != null) { + // dynamicMethod.CreateDelegate(delegateType, closure) + _boundConstants.EmitConstant(this, dynamicMethod, typeof(DynamicMethod)); + _ilg.EmitType(delegateType); + EmitClosureCreation(inner); + _ilg.Emit(OpCodes.Callvirt, typeof(DynamicMethod).GetMethod("CreateDelegate", new Type[] { typeof(Type), typeof(object) })); + _ilg.Emit(OpCodes.Castclass, delegateType); + } else { + // new DelegateType(closure) + EmitClosureCreation(inner); + _ilg.Emit(OpCodes.Ldftn, (MethodInfo)inner._method); + _ilg.Emit(OpCodes.Newobj, (ConstructorInfo)(delegateType.GetMember(".ctor")[0])); + } + } + + /// + /// Emits a delegate to the method generated for the LambdaExpression. + /// May end up creating a wrapper to match the requested delegate type. + /// + /// Lambda for which to generate a delegate + /// + private void EmitDelegateConstruction(LambdaExpression lambda) { + // 1. Create the new compiler + LambdaCompiler impl = CreateCompiler(lambda); + + // 2. emit the lambda + // Since additional ILs are always emitted after the lambda's body, should not emit with tail call optimization. + impl.EmitLambdaBody(_scope, false, CompilationFlags.EmitAsNoTail); + + // 3. emit the delegate creation in the outer lambda + EmitDelegateConstruction(impl); + } + + private LambdaCompiler CreateCompiler(LambdaExpression lambda) { +#if FEATURE_REFEMIT + if (!(_method is DynamicMethod)) { + // When the lambda does not have a name or the name is empty, generate a unique name for it. + string name = String.IsNullOrEmpty(lambda.Name) ? GetUniqueMethodName() : lambda.Name; + MethodBuilder mb = _typeBuilder.DefineMethod(name, MethodAttributes.Private | MethodAttributes.Static); + return new LambdaCompiler(_tree, lambda, mb); + } +#endif + return new LambdaCompiler(_tree, lambda); + } + + private static Type[] GetParameterTypes(LambdaExpression lambda) { + return lambda.Parameters.Map(p => p.IsByRef ? p.Type.MakeByRefType() : p.Type); + } + + private static string GetUniqueMethodName() { + return "{" + Interlocked.Increment(ref _Counter) + "}lambda_method"; + } + + private void EmitLambdaBody() { + // The lambda body is the "last" expression of the lambda + CompilationFlags tailCallFlag = _lambda.TailCall ? CompilationFlags.EmitAsTail : CompilationFlags.EmitAsNoTail; + EmitLambdaBody(null, false, tailCallFlag); + } + + /// + /// Emits the lambda body. If inlined, the parameters should already be + /// pushed onto the IL stack. + /// + /// The parent scope. + /// true if the lambda is inlined; false otherwise. + /// + /// The emum to specify if the lambda is compiled with the tail call optimization. + /// + private void EmitLambdaBody(CompilerScope parent, bool inlined, CompilationFlags flags) { + _scope.Enter(this, parent); + + if (inlined) { + // The arguments were already pushed onto the IL stack. + // Store them into locals, popping in reverse order. + // + // If any arguments were ByRef, the address is on the stack and + // we'll be storing it into the variable, which has a ref type. + for (int i = _lambda.Parameters.Count - 1; i >= 0; i--) { + _scope.EmitSet(_lambda.Parameters[i]); + } + } + + // Need to emit the expression start for the lambda body + flags = UpdateEmitExpressionStartFlag(flags, CompilationFlags.EmitExpressionStart); + if (_lambda.ReturnType == typeof(void)) { + EmitExpressionAsVoid(_lambda.Body, flags); + } else { + EmitExpression(_lambda.Body, flags); + } + + // Return must be the last instruction in a CLI method. + // But if we're inlining the lambda, we want to leave the return + // value on the IL stack. + if (!inlined) { + _ilg.Emit(OpCodes.Ret); + } + + _scope.Exit(); + + // Validate labels + Debug.Assert(_labelBlock.Parent == null && _labelBlock.Kind == LabelScopeKind.Lambda); + foreach (LabelInfo label in _labelInfo.Values) { + label.ValidateFinish(); + } + } + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs index 5c846fb7e0f..5af3a571386 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -19,11 +19,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Reflection.Emit; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Statements.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Statements.cs index 4fbbe062d6d..7ab065c2d93 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Statements.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Statements.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -21,11 +21,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Globalization; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Unary.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Unary.cs index 1ace72b4e9d..79726b09a0d 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Unary.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Unary.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -20,11 +20,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.cs index 4b004556c47..3c13eac7020 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.cs @@ -23,12 +23,12 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Threading; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { #endif -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT using ILGenerator = OffsetTrackingILGenerator; #endif @@ -47,9 +47,10 @@ namespace System.Linq.Expressions.Compiler { private readonly ILGenerator _ilg; +#if FEATURE_REFEMIT // The TypeBuilder backing this method, if any private readonly TypeBuilder _typeBuilder; - +#endif private readonly MethodInfo _method; // Currently active LabelTargets and their mapping to IL labels @@ -87,7 +88,7 @@ namespace System.Linq.Expressions.Compiler { private LambdaCompiler(AnalyzedTree tree, LambdaExpression lambda) { Type[] parameterTypes = GetParameterTypes(lambda).AddFirst(typeof(Closure)); -#if SILVERLIGHT && CLR2 +#if (SILVERLIGHT && CLR2) || WP75 var method = new DynamicMethod(lambda.Name ?? "lambda_method", lambda.ReturnType, parameterTypes); #else var method = new DynamicMethod(lambda.Name ?? "lambda_method", lambda.ReturnType, parameterTypes, true); @@ -97,7 +98,7 @@ namespace System.Linq.Expressions.Compiler { _lambda = lambda; _method = method; -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT _ilg = new OffsetTrackingILGenerator(method.GetILGenerator()); #else _ilg = method.GetILGenerator(); @@ -112,6 +113,7 @@ namespace System.Linq.Expressions.Compiler { InitializeMethod(); } +#if FEATURE_REFEMIT /// /// Creates a lambda compiler that will compile into the provided Methodbuilder /// @@ -136,7 +138,7 @@ namespace System.Linq.Expressions.Compiler { _typeBuilder = (TypeBuilder)method.DeclaringType; _method = method; -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT _ilg = new OffsetTrackingILGenerator(method.GetILGenerator()); #else _ilg = method.GetILGenerator(); @@ -148,6 +150,7 @@ namespace System.Linq.Expressions.Compiler { InitializeMethod(); } +#endif /// /// Creates a lambda compiler for an inlined lambda @@ -158,9 +161,11 @@ namespace System.Linq.Expressions.Compiler { _method = parent._method; _ilg = parent._ilg; _hasClosureArgument = parent._hasClosureArgument; - _typeBuilder = parent._typeBuilder; _scope = _tree.Scopes[lambda]; _boundConstants = parent._boundConstants; +#if FEATURE_REFEMIT + _typeBuilder = parent._typeBuilder; +#endif } private void InitializeMethod() { @@ -209,6 +214,7 @@ namespace System.Linq.Expressions.Compiler { return c.CreateDelegate(); } +#if FEATURE_REFEMIT /// /// Mutates the MethodBuilder parameter, filling in IL, parameters, /// and return type. @@ -227,7 +233,7 @@ namespace System.Linq.Expressions.Compiler { // 3. Emit c.EmitLambdaBody(); } - +#endif #endregion private static AnalyzedTree AnalyzeLambda(ref LambdaExpression lambda) { @@ -296,6 +302,7 @@ namespace System.Linq.Expressions.Compiler { return _method.CreateDelegate(_lambda.Type, new Closure(_boundConstants.ToArray(), null)); } +#if FEATURE_REFEMIT private FieldBuilder CreateStaticField(string name, Type type) { // We are emitting into someone else's type. We don't want name // conflicts, so choose a long name that is unlikely to confict. @@ -303,17 +310,18 @@ namespace System.Linq.Expressions.Compiler { // uses. return _typeBuilder.DefineField("{" + Interlocked.Increment(ref _Counter) + "}" + name, type, FieldAttributes.Static | FieldAttributes.Private); } - +#endif /// /// Creates an unitialized field suitible for private implementation details /// Works with DynamicMethods or TypeBuilders. /// private MemberExpression CreateLazyInitializedField(string name) { - if (_method is DynamicMethod) { - return Expression.Field(Expression.Constant(new StrongBox(default(T))), "Value"); - } else { +#if FEATURE_REFEMIT + if (!(_method is DynamicMethod)) { return Expression.Field(null, CreateStaticField(name, typeof(T))); - } + } +#endif + return Expression.Field(Expression.Constant(new StrongBox(default(T))), "Value"); } } } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/OffsetTrackingILGenerator.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/OffsetTrackingILGenerator.cs index 0630f0be074..024cfb90aff 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/OffsetTrackingILGenerator.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/OffsetTrackingILGenerator.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -23,9 +23,9 @@ using System.Diagnostics.SymbolStore; // Not needed in CLR 4 builds because we have the // ILGenerator.ILOffset property. -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/RuntimeVariableList.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/RuntimeVariableList.cs index b69a5a442cc..3b22542c2dc 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/RuntimeVariableList.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/RuntimeVariableList.cs @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast.Compiler; #else using System.Linq.Expressions.Compiler; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Set.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Set.cs index 96ec6d33974..4c864ad58fb 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Set.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/Set.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,7 +17,7 @@ using System.Collections; using System.Collections.Generic; // Note: can't move to Utils because name conflicts with System.Linq.Set -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Bindings.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Bindings.cs index 95ceba84068..1c166a6ce4e 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Bindings.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Bindings.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -17,11 +17,7 @@ using System.Collections.ObjectModel; using System.Dynamic.Utils; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs index f96780dd8b8..d0aea62ff84 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Generated.cs @@ -16,7 +16,7 @@ using System.Diagnostics; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs index cee6fab837b..fce1b961e57 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Temps.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -19,7 +19,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Dynamic.Utils; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.cs index 38ba4a45170..ff1077ce758 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -21,11 +21,7 @@ using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; -#if SILVERLIGHT -using System.Core; -#endif - -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs index bd883fe92d3..4042f904e98 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -12,8 +12,9 @@ * * * ***************************************************************************/ +#if FEATURE_REFEMIT && FEATURE_PDBEMIT -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; using Microsoft.Scripting.Ast.Compiler; #else @@ -21,10 +22,6 @@ using System.Linq.Expressions; using System.Linq.Expressions.Compiler; #endif -#if SILVERLIGHT -using System.Core; -#endif - using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.SymbolStore; @@ -32,7 +29,7 @@ using System.Reflection; using System.Reflection.Emit; namespace System.Runtime.CompilerServices { -#if CLR2 || SILVERLIGHT +#if !FEATURE_CORE_DLR || SILVERLIGHT using ILGenerator = OffsetTrackingILGenerator; #endif @@ -72,3 +69,4 @@ namespace System.Runtime.CompilerServices { } } } +#endif \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs new file mode 100644 index 00000000000..ec8f0f84c2d --- /dev/null +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/SymbolGuids.cs @@ -0,0 +1,12 @@ +using System; + +#if !FEATURE_CORE_DLR +namespace Microsoft.Scripting.Ast.Compiler { +#else +namespace System.Linq.Expressions.Compiler { +#endif + internal static class SymbolGuids { + internal static readonly Guid DocumentType_Text = + new Guid(0x5a869d0b, 0x6611, 0x11d3, 0xbd, 0x2a, 0, 0, 0xf8, 8, 0x49, 0xbd); + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs index 0984a04619e..2711f48d08f 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -22,7 +22,7 @@ using System.Dynamic.Utils; using System.Core; #endif -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast.Compiler { #else namespace System.Linq.Expressions.Compiler { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/GlobalSuppressions.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/GlobalSuppressions.cs index cbf8fe85816..a21aeca06cf 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/GlobalSuppressions.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/GlobalSuppressions.cs @@ -9,7 +9,7 @@ // You do not need to add suppressions to this file manually. //UnhandledExpressionType is used by System.Linq.Expressions.OldExpressionVisitor -#if CLR2 +#if !FEATURE_CORE_DLR [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Scripting.Ast.Error.#UnhandledExpressionType(System.Object)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Scripting.Ast.Strings.#UnhandledExpressionType(System.Object)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Scripting.Ast.Error.#InvalidNullValue(System.Object)")] diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj index 5d67e73f9d4..0d0b5797f25 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj @@ -1,227 +1,163 @@ - - - - - - v2Debug - AnyCPU - 10.0.20624 - 2.0 - {2AE75F5A-CD1F-4925-9647-AF4D1C282FB4} - Library - Properties - System.Scripting - Microsoft.Scripting.Core - $(SolutionDir)..\bin\$(Configuration)\Microsoft.Scripting.Core.XML - true - 618 - 1591 - 855638016 - Microsoft.Scripting.Core.ruleset - - - pdbonly - true - $(SolutionDir)..\bin\FxCop - TRACE;$(SignedSym);CLR2 - prompt - 4 - true - v3.5 - - - true - full - false - $(SolutionDir)..\bin\v2Debug - DEBUG;TRACE;$(SignedSym);CLR2 - prompt - 4 - false - v3.5 - - - pdbonly - true - $(SolutionDir)..\bin\v2Release - TRACE;$(SignedSym);CLR2 - prompt - 4 - false - v3.5 - - - true - $(SolutionDir)..\bin\Silverlight3Debug - TRACE;DEBUG;SILVERLIGHT;CLR2 - full - AnyCPU - false - prompt - v3.5 - - - $(SolutionDir)..\bin\Silverlight3Release - TRACE;SILVERLIGHT;CLR2 - pdbonly - AnyCPU - prompt - v3.5 - - - - Properties\SilverlightVersion.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ast\System.Linq.Expressions.txt - - - - - - - - - - - - - $(SilverlightPath)\mscorlib.dll - - - $(SilverlightPath)\System.dll - - - $(SilverlightPath)\System.Core.dll - - - - - - - - - - + + + + + 2.0 + {2AE75F5A-CD1F-4925-9647-AF4D1C282FB4} + Library + Properties + System.Scripting + Microsoft.Scripting.Core + 855638016 + $(AssemblyName).ruleset + $(SolutionDir)..\bin\$(Configuration)\$(AssemblyName).xml + + + + + + + + + + + + + + + + + + Properties\SilverlightVersion.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/.gitattributes b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/.gitattributes deleted file mode 100644 index 31e93e4e9e3..00000000000 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/ExtensionAssemblyInfo.cs -crlf diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs index 97fd02fdc0b..ef2378f2ce3 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs @@ -55,8 +55,11 @@ using System.Security; [assembly: System.Resources.NeutralResourcesLanguage("en-US")] #if !SILVERLIGHT -[assembly: AssemblyVersion("1.1.0.10")] -[assembly: AssemblyFileVersion("1.1.0.10")] +[assembly: AssemblyVersion("1.1.0.30")] +[assembly: AssemblyFileVersion("1.1.0.30")] [assembly: AssemblyInformationalVersion("1.1")] +#endif + +#if !SILVERLIGHT && !WP75 [assembly: AllowPartiallyTrustedCallers] #endif diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs index bc47e001f31..2a2c1c0f76c 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs @@ -1,62 +1,62 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. - * - * This source code is subject to terms and conditions of the Microsoft Public License. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Microsoft Public License, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Microsoft Public License. - * - * You must not remove this notice, or any other, from this software. - * - * - * ***************************************************************************/ - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Scripting.ExtensionAttribute")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft.Scripting.ExtensionAttribute")] -[assembly: AssemblyCopyright("� Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -[assembly: CLSCompliant(true)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b828a36d-f568-48a7-9bdd-412b0a1bfa32")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: SecurityTransparent] - -[assembly: System.Resources.NeutralResourcesLanguage("en-US")] - -#if !SILVERLIGHT -[assembly: AssemblyVersion("2.0.0.0")] // shouldn't change, this assembly is unchanged. This is the version it originally shipped as. -[assembly: AssemblyFileVersion("1.0.1.00")] -[assembly: AssemblyInformationalVersion("1.0.1")] -[assembly: AllowPartiallyTrustedCallers] -#endif +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Microsoft Public License. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Microsoft Public License, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Microsoft Public License. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Scripting.ExtensionAttribute")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft.Scripting.ExtensionAttribute")] +[assembly: AssemblyCopyright("� Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +[assembly: CLSCompliant(true)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b828a36d-f568-48a7-9bdd-412b0a1bfa32")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: SecurityTransparent] + +[assembly: System.Resources.NeutralResourcesLanguage("en-US")] + +#if !SILVERLIGHT +[assembly: AssemblyVersion("2.0.0.0")] // shouldn't change, this assembly is unchanged. This is the version it originally shipped as. +[assembly: AssemblyFileVersion("1.0.1.00")] +[assembly: AssemblyInformationalVersion("1.0.1")] +[assembly: AllowPartiallyTrustedCallers] +#endif diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Stubs.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Stubs.cs index b8e796f54fb..36b11a43990 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Stubs.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Stubs.cs @@ -13,200 +13,36 @@ * * ***************************************************************************/ -using System; using System.Diagnostics; -using System.Dynamic.Utils; -#if SILVERLIGHT // Stubs +namespace Microsoft.Scripting.Utils { -// This is needed so we can build Silverlight version on Codeplex -// where System.Core namespace is not defined. -namespace System.Core -{ - class Dummy { } } -namespace System { - - /// - /// An application exception. - /// - public class ApplicationException : Exception { - private const int error = unchecked((int)0x80131600); - /// - /// The constructor. - /// - public ApplicationException() - : base("Application Exception") { - HResult = error; - } - - /// - /// The constructor. - /// - /// The message. - public ApplicationException(string message) - : base(message) { - HResult = error; - } - - /// - /// The constructor. - /// - /// The message. - /// The inner exception. - public ApplicationException(string message, Exception innerException) - : base(message, innerException) { - HResult = error; - } - } - - namespace Runtime.InteropServices { - /// - /// The Default Parameter Value Attribute. - /// - public sealed class DefaultParameterValueAttribute : Attribute { - /// - /// The constructor - /// - /// The value. - public DefaultParameterValueAttribute(object value) { } - } - } - - // We reference these namespaces via "using" - // We don't actually use them because the code is #if !SILVERLIGHT - // Rather than fix the usings all over the place, just define these here - namespace Runtime.Remoting { class Dummy {} } - namespace Security.Policy { class Dummy {} } - namespace Xml.XPath { class Dummy {} } - - namespace Reflection { - /// - /// PortableExecutableKinds enum. - /// - public enum PortableExecutableKinds { - /// - /// ILOnly - /// - ILOnly = 0 - } - - /// - /// ImageFileMachine enum. - /// - public enum ImageFileMachine { - /// - /// I386 - /// - I386 = 1 - } - } - - namespace ComponentModel { - - /// - /// The Warning exception. - /// - public class WarningException : SystemException { - /// - /// The constructor. - /// - /// The message. - public WarningException(string message) : base(message) { } - } - } +#if !FEATURE_SERIALIZATION +namespace System { /// /// The serializable attribute. /// - public class SerializableAttribute : Attribute { + [Conditional("STUB")] + internal class SerializableAttribute : Attribute { } /// /// Non serializable attribute. /// - public class NonSerializedAttribute : Attribute { + [Conditional("STUB")] + internal class NonSerializedAttribute : Attribute { } namespace Runtime.Serialization { /// /// ISerializable interface. /// - public interface ISerializable { + internal interface ISerializable { } } - - /// - /// The ConsoleColor enum. - /// - public enum ConsoleColor { - /// - /// Black. - /// - Black = 0, - /// - /// DarkBlue. - /// - DarkBlue = 1, - /// - /// DarkGreen. - /// - DarkGreen = 2, - /// - /// DaryCyan. - /// - DarkCyan = 3, - /// - /// DarkRed - /// - DarkRed = 4, - /// - /// DarkMagenta - /// - DarkMagenta = 5, - /// - /// DarkYellow - /// - DarkYellow = 6, - /// - /// Gray - /// - Gray = 7, - /// - /// DarkGray - /// - DarkGray = 8, - /// - /// Blue - /// - Blue = 9, - /// - /// Green - /// - Green = 10, - /// - /// Cyan - /// - Cyan = 11, - /// - /// Red - /// - Red = 12, - /// - /// Magenta - /// - Magenta = 13, - /// - /// Yellow - /// - Yellow = 14, - /// - /// White - /// - White = 15, - } - } -#endif +#endif \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Action.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Action.cs index 9e7e53cf34d..f6d2381a2bf 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Action.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Action.cs @@ -13,7 +13,8 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_FUNCS_5_16 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Utils { #else namespace System { @@ -24,7 +25,7 @@ namespace System { // *** BEGIN GENERATED CODE *** // generated by function: gen_action_types from: generate_dynsites.py -#if CLR2 || SILVERLIGHT +#if !FEATURE_VARIANCE /// /// Encapsulates a method that takes five parameters and does not return a value. @@ -605,3 +606,4 @@ namespace System { #endregion } +#endif \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs index 1b94d705030..81371c66e28 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CacheDict.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs index fd7ac36114d..d9dcd196ae9 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Utils; using Microsoft.Scripting.Ast; #else @@ -35,9 +35,6 @@ namespace System.Dynamic.Utils { /// changed after creation. The exception is if the enumerable is /// already a ReadOnlyCollection{T}, in which case we just return it. /// -#if !CLR2 - [Pure] -#endif internal static ReadOnlyCollection ToReadOnly(this IEnumerable enumerable) { if (enumerable == null) { return EmptyReadOnlyCollection.Instance; @@ -90,9 +87,6 @@ namespace System.Dynamic.Utils { return h; } -#if !CLR2 - [Pure] -#endif internal static bool ListEquals(this ICollection first, ICollection second) { if (first.Count != second.Count) { return false; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs index d8cc36be2bb..26f809e0359 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs index 08454fa43df..5cc9f88a4e5 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -15,7 +15,7 @@ using System; -#if CLR2 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Ast { #else namespace System.Linq.Expressions { diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Function.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Function.cs index 143e6b32ec6..e3c06d45af4 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Function.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Function.cs @@ -13,7 +13,8 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_FUNCS_5_16 +#if !FEATURE_CORE_DLR namespace Microsoft.Scripting.Utils { #else namespace System { @@ -24,7 +25,7 @@ namespace System { // *** BEGIN GENERATED CODE *** // generated by function: gen_func_types from: generate_dynsites.py -#if CLR2 || SILVERLIGHT +#if !FEATURE_VARIANCE /// /// Encapsulates a method that has five parameters and returns a value of the type specified by the TResult parameter. @@ -645,3 +646,4 @@ namespace System { #endregion } +#endif \ No newline at end of file diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Helpers.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Helpers.cs index 6f2cc98ffe2..d8827d16968 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Helpers.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/Helpers.cs @@ -1,4 +1,4 @@ - + /* **************************************************************************** * * Copyright (c) Microsoft Corporation. @@ -14,7 +14,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; using Microsoft.Scripting.Utils; #else diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/IRuntimeVariables.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/IRuntimeVariables.cs index 8130a617d86..126763ea03f 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/IRuntimeVariables.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/IRuntimeVariables.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs index 2c272b81e72..c5bb77cc03e 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; @@ -31,9 +31,7 @@ namespace System.Runtime.CompilerServices { /// The builder for read only collection. /// /// The type of the collection element. -#if !SILVERLIGHT [Serializable] -#endif [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public sealed class ReadOnlyCollectionBuilder : IList, System.Collections.IList { private const int DefaultCapacity = 4; @@ -42,9 +40,7 @@ namespace System.Runtime.CompilerServices { private int _size; private int _version; -#if !SILVERLIGHT [NonSerialized] -#endif private Object _syncRoot; static readonly T[] _emptyArray = new T[0]; @@ -452,9 +448,7 @@ namespace System.Runtime.CompilerServices { throw new ArgumentException(Strings.InvalidObjectType(value != null ? value.GetType() : (object)"null", typeof(T)), argument); } -#if !SILVERLIGHT [Serializable] -#endif private class Enumerator : IEnumerator, System.Collections.IEnumerator { private readonly ReadOnlyCollectionBuilder _builder; private readonly int _version; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs index 1202e9db274..33194716d1f 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#if CLR2 +#if !FEATURE_CORE_DLR using Microsoft.Scripting.Ast; #else using System.Linq.Expressions; diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs index fff90a5c6f0..6b7d1fc1e68 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReferenceEqualityComparer.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * @@ -27,7 +27,8 @@ namespace System.Dynamic.Utils { } public int GetHashCode(T obj) { - return RuntimeHelpers.GetHashCode(obj); + // CF RH.GetHashCode throws NullReferenceException if the argument is null + return obj != null ? RuntimeHelpers.GetHashCode(obj) : 0; } } } diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs new file mode 100644 index 00000000000..a4df5d651b5 --- /dev/null +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/ReflectionUtils.cs @@ -0,0 +1,7 @@ +using System; + +namespace Microsoft.Scripting.Utils { + internal static class ReflectionUtils { + public static readonly Type[] EmptyTypes = new Type[0]; + } +} diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs index da9cf38ee0d..fc0ed6b3676 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TrueReadOnlyCollection.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs index fd0da9097b2..78d5226492a 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs @@ -1,4 +1,4 @@ -/* **************************************************************************** +/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * diff --git a/mcs/class/dlr/sync.sh b/mcs/class/dlr/sync.sh index 7a84ed56b96..133bb21ff31 100755 --- a/mcs/class/dlr/sync.sh +++ b/mcs/class/dlr/sync.sh @@ -1,2 +1,5 @@ -rsync -r /home/marek/svn/dlr/svn/DLR_Main/Runtime/Microsoft.Dynamic/ Runtime/Microsoft.Dynamic --exclude=".*/" --exclude="*.snk" -rsync -r /home/marek/svn/dlr/svn/DLR_Main/Runtime/Microsoft.Scripting.Core/ Runtime/Microsoft.Scripting.Core --exclude=".*/" --exclude="*.snk" + +# git clone git://github.com/IronLanguages/main.git + +rsync -r /home/marek/git/dlr/main/Runtime/Microsoft.Dynamic/ Runtime/Microsoft.Dynamic --exclude=".*/" --exclude="*.snk" +rsync -r /home/marek/git/dlr/main/Runtime/Microsoft.Scripting.Core/ Runtime/Microsoft.Scripting.Core --exclude=".*/" --exclude="*.snk" diff --git a/mcs/docs/compiler.txt b/mcs/docs/compiler.txt index 6508d21888d..aff44d051b1 100755 --- a/mcs/docs/compiler.txt +++ b/mcs/docs/compiler.txt @@ -71,7 +71,7 @@ Code to do semantic analysis and emit the attributes is here. - rootcontext.cs: + module.cs: Keeps track of the types defined in the source code, as well as the assemblies loaded. @@ -301,11 +301,6 @@ The token 0 is reserved for ``anonymous'' locations, ie. if we don't know the location (Location.Null). - The tokenizer also tracks the column number for a token, but - this is currently not being used or encoded. It could - probably be encoded in the low 9 bits, allowing for columns - from 1 to 512 to be encoded. - * The Parser The parser is written using Jay, which is a port of Berkeley @@ -493,6 +488,28 @@ a [i++]++ a [i++] += 5; + +** Optimalizations + + Compiler does some limited high-level optimalizations when + -optimize option is used + +*** Instance field initializer to default value + + Code to optimize: + + class C + { + enum E + { + Test + } + + int i = 0; // Field will not be redundantly assigned + int i2 = new int (); // This will be also completely optimized out + + E e = E.Test; // Even this will go out. + } ** Statements @@ -562,6 +579,49 @@ * Elements that contain code are now invoked to perform semantic analysis and code generation. + +* References loading + + Most programs use external references (assemblies and modules). + Compiler loads all referenced top-level types from referenced + assemblies into import cached. It imports initialy only C# + valid top-level types all other members are imported on demand + when needed. + +* Namespaces definition + + Before any type resolution can be done we define all compiled + namespaces. This is mainly done to prepare using clauses of each + namespace block before any type resolution takes a place. + +* Types definition + + The first step of type definition is to resolve base class or + base interfaces to correctly setup type hierarchy before any + member is defined. + + At this point we do some error checking and verify that the + members inheritance is correct and some other members + oriented checks. + + By the time we are done, all classes, structs and interfaces + have been defined and all their members have been defined as + well. + +* MemberCache + + MemberCache is one of core compiler components. It maintains information + about types and their members. It tries to be as fast as possible + because almost all resolve operations end up querying members info in + some way. + + MemberCache is not definition but specification oriented to maintain + differences between inflated versions of generic types. This makes usage + of MemberCache simple because consumer does not need to care how to inflate + current member and returned type information will always give correctly + inflated type. However setting MemberCache up is one of the most complicated + parts of the compiler due to possible dependencies when types are defined + and complexity of nested types. * Output Generation @@ -831,6 +891,40 @@ into an empty operation. Otherwise the above will become a return statement that can infer return types. +* Debugger support + + Compiler produces .mdb symbol file for better debugging experience. The + process is quite straightforward. For every statement or a block there + is an entry in symbol file. Each entry includes of start location of + the statement and it's starting IL offset in the method. For most statements + this is easy but few need special handling (e.g. do, while). + + When sequence point is needed to represent original location and no IL + entry is written for the line we emit `nop' instruction. This is done only + for very few constructs (e.g. block opening brace). + + Captured variables are not treated differently at the moment. Debugger has + internal knowledge of their mangled names and how to decode them. + +* IKVM.Reflection vs System.Reflection + + Mono compiler can be compiled using different reflection backends. At the + moment we support System.Reflection and IKVM.Reflection they both use same + API as official System.Reflection.Emit API which allows us to maintain only + single version of compiler with few using aliases to specialise. + + The backends are not plug-able but require compiler to be compiled with + specific STATIC define when targeting IKVM.Reflection. + + IKVM.Reflection is used for static compilation. This means the compiler runs + in batch mode like most compilers do. It can target any runtime version and + use any mscorlib. The mcs.exe is using IKVM.Reflection. + + System.Reflection is used for dynamic compilation. This mode is used by + our REPL and Evaluator API. Produced IL code is not written to disc but + executed by runtime (JIT). Mono.CSharp.dll is using System.Reflection and + System.Reflection.Emit. + * Evaluation API The compiler can now be used as a library, the API exposed diff --git a/mcs/errors/CS0122-8-lib.il b/mcs/errors/CS0122-8-lib.il new file mode 100644 index 00000000000..64142033f65 --- /dev/null +++ b/mcs/errors/CS0122-8-lib.il @@ -0,0 +1,74 @@ +.assembly extern mscorlib +{ +} + +.assembly 'CS0108-8-lib' +{ +} + +.module 'CS0108-8-lib.dll' + + +.class public auto ansi beforefieldinit A + extends [mscorlib]System.Object +{ + .class auto ansi nested family beforefieldinit AA + extends [mscorlib]System.Object + { + .method public hidebysig newslot virtual + instance void Foo() cil managed + { + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void [mscorlib]System.Object::.ctor() + ret + } + + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void [mscorlib]System.Object::.ctor() + ret + } + +} + +.class public auto ansi beforefieldinit B + extends A +{ + .class auto ansi nested public beforefieldinit BB + extends A/AA + { + .method public hidebysig virtual instance void + Foo() cil managed + { + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void A/AA::.ctor() + ret + } + + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void A::.ctor() + ret + } + +} diff --git a/mcs/errors/Makefile b/mcs/errors/Makefile index 57ff9ef4490..96085dde45b 100644 --- a/mcs/errors/Makefile +++ b/mcs/errors/Makefile @@ -22,7 +22,7 @@ DISTFILES = \ TEST_SUPPORT_FILES = \ CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0029-26-lib.dll \ - CS0103-2-lib.dll CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll \ + CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll \ CS0205-3-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \ CS0315-2-lib.dll \ CS0425-7-lib.dll CS0433-lib.dll CS0433-2-lib.dll \ diff --git a/mcs/errors/cs0120-18.cs b/mcs/errors/cs0120-18.cs new file mode 100644 index 00000000000..a4aefc787bd --- /dev/null +++ b/mcs/errors/cs0120-18.cs @@ -0,0 +1,23 @@ +// CS0120: An object reference is required to access non-static member `Derived.Foo()' +// Line: 16 + +using System; + +public class Base +{ + public Base (Action a) + { + } +} + +public class Derived : Base +{ + public Derived () + : base (() => Foo ()) + { + } + + void Foo () + { + } +} \ No newline at end of file diff --git a/mcs/errors/cs0122-8.cs b/mcs/errors/cs0122-8.cs new file mode 100644 index 00000000000..5f115025ed0 --- /dev/null +++ b/mcs/errors/cs0122-8.cs @@ -0,0 +1,11 @@ +// CS0122: `A.AA.Foo()' is inaccessible due to its protection level +// Line: 16 +// Compiler options: -r:CS0122-8-lib.dll + +public class Test +{ + public static void Main () + { + new B.BB ().Foo (); + } +} diff --git a/mcs/errors/cs0127-3.cs b/mcs/errors/cs0127-3.cs new file mode 100644 index 00000000000..5e39cb9da7a --- /dev/null +++ b/mcs/errors/cs0127-3.cs @@ -0,0 +1,16 @@ +// CS0127: `System.Action': A return keyword must not be followed by any expression when delegate returns void +// Line: 10 + +using System; + +class C +{ + public void Test () + { + Action a = () => { return Skip (); }; + } + + void Skip () + { + } +} diff --git a/mcs/errors/cs0127-4.cs b/mcs/errors/cs0127-4.cs new file mode 100644 index 00000000000..64e3f96ae04 --- /dev/null +++ b/mcs/errors/cs0127-4.cs @@ -0,0 +1,11 @@ +// CS0127: `D': A return keyword must not be followed by any expression when delegate returns void +// Line: 9 + +delegate void D (int x); + +class X { + static void Main () + { + D d6 = delegate (int x) { return x; }; // Return type mismatch. + } +} diff --git a/mcs/errors/cs0649-5.cs b/mcs/errors/cs0649-5.cs new file mode 100644 index 00000000000..20778691b1e --- /dev/null +++ b/mcs/errors/cs0649-5.cs @@ -0,0 +1,25 @@ +// CS0649: Field `TestClass.b' is never assigned to, and will always have its default value +// Line: 12 +// Compiler options: -warnaserror -warn:4 + +public struct Bar +{ + public int x; +} + +public class TestClass +{ + Bar b; + + public bool Foo () + { + if (b.x == 0) + return false; + + return true; + } + + public static void Main () + { + } +} diff --git a/mcs/errors/cs1662-2.cs b/mcs/errors/cs1662-2.cs deleted file mode 100644 index b287fcc4686..00000000000 --- a/mcs/errors/cs1662-2.cs +++ /dev/null @@ -1,15 +0,0 @@ -// CS1662: Cannot convert `lambda expression' to delegate type `D' because some of the return types in the block are not implicitly convertible to the delegate return type -// Line: 13 - - -using System; - -delegate int D (int i); - -class X -{ - static void Main () - { - D d = (int l) => Main (); - } -} diff --git a/mcs/errors/cs1662.cs b/mcs/errors/cs1662.cs index 419048631c2..7035c189cec 100644 --- a/mcs/errors/cs1662.cs +++ b/mcs/errors/cs1662.cs @@ -1,11 +1,14 @@ -// CS1662: Cannot convert `anonymous method' to delegate type `D' because some of the return types in the block are not implicitly convertible to the delegate return type -// Line: 11 +// CS1662: Cannot convert `lambda expression' to delegate type `D' because some of the return types in the block are not implicitly convertible to the delegate return type +// Line: 12 -delegate void D (int x); +using System; -class X { +delegate int D (int i); + +class X +{ static void Main () { - D d6 = delegate (int x) { return x; }; // Return type mismatch. + D d = (int l) => Main (); } } diff --git a/mcs/errors/cs1691-4.cs b/mcs/errors/cs1691-4.cs new file mode 100644 index 00000000000..cd9ce646a4e --- /dev/null +++ b/mcs/errors/cs1691-4.cs @@ -0,0 +1,4 @@ +// CS1691: `20' is not a valid warning number +// Line: 0 +// Compiler options: -warnaserror -nowarn:20 + diff --git a/mcs/errors/cs1697.cs b/mcs/errors/cs1697.cs new file mode 100644 index 00000000000..1b6cc6fd4f1 --- /dev/null +++ b/mcs/errors/cs1697.cs @@ -0,0 +1,13 @@ +// CS1697: Different checksum values specified for file `a.xml' +// Line: 6 +// Compiler options: -debug -warnaserror + +#pragma checksum "a.xml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "60d1c7f99b6e992275cf155c8a54c018" +#pragma checksum "a.xml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "60d1c7f99b6e992275cf155c8a54c019" + +class TestClass +{ + static void Main() + { + } +} diff --git a/mcs/jay/Makefile b/mcs/jay/Makefile index 74609852fe3..f14055f8276 100644 --- a/mcs/jay/Makefile +++ b/mcs/jay/Makefile @@ -49,4 +49,4 @@ jay: $(sources:.c=.o) $(CCOMPILE) $(LDFLAGS) -o $@ $^ %.o: %.c - $(CCOMPILE) -c -o $@ $^ + $(CCOMPILE) $(JAY_CFLAGS) -c -o $@ $^ diff --git a/mcs/jay/skeleton.cs b/mcs/jay/skeleton.cs index f8fc4370b1f..dda3811bdbe 100644 --- a/mcs/jay/skeleton.cs +++ b/mcs/jay/skeleton.cs @@ -22,10 +22,10 @@ . public void yyerror (string message) { . yyerror(message, null); . } -. +.#pragma warning disable 649 . /* An EOF token */ . public int eof_token; -. +.#pragma warning restore 649 . /** (syntax) error message. . Can be overwritten to control message format. . @param message text to be displayed. @@ -59,7 +59,9 @@ t if ((name = yyNames[token]) != null) return name; t return "[unknown]"; t } . +.#pragma warning disable 414 . int yyExpectingState; +.#pragma warning restore 414 . /** computes list of expected tokens on error by tracing the tables. . @param state for which to compute the list. . @return list of token names. @@ -125,7 +127,9 @@ t this.debug = (yydebug.yyDebug)yyd; . . static int[] global_yyStates; . static object[] global_yyVals; +.#pragma warning disable 649 . protected bool use_global_stacks; +.#pragma warning restore 649 . object[] yyVals; // value stack . object yyVal; // value stack ptr . int yyToken; // current input diff --git a/mcs/mcs/Makefile b/mcs/mcs/Makefile index c3447ffbf57..e45aeb008f9 100644 --- a/mcs/mcs/Makefile +++ b/mcs/mcs/Makefile @@ -8,13 +8,9 @@ include ../build/rules.make EXTRA_DISTFILES = \ mcs.csproj \ - compiler.doc \ mcs.sln \ cs-parser.jay \ - mcs.exe.sources \ - NOTES \ - TODO \ - ikvm.cs + mcs.exe.sources ifeq (basic, $(PROFILE)) PROGRAM = basic.exe @@ -103,6 +99,7 @@ profile : $(PROGRAM) $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response) debug-parser: + rm cs-parser.cs $(MAKE) JAY_FLAGS=-cvt # diff --git a/mcs/mcs/OPTIMIZE b/mcs/mcs/OPTIMIZE deleted file mode 100644 index 6fa1e31e947..00000000000 --- a/mcs/mcs/OPTIMIZE +++ /dev/null @@ -1,26 +0,0 @@ -This document describes all code optimalizations performed by Mono C# compiler -when optimalizations are enabled via /optimize+ option. - -Optimalizations: - -* Instance field initializer to default value ---------------------------------------------- - -Code to optimize: - -class C -{ - enum E - { - Test - } - - int i = 0; // Field will not be redundantly assigned - int i2 = new int (); // This will be also completely optimized out - - E e = E.Test; // Even this will go out. - -} - - - diff --git a/mcs/mcs/OTODO b/mcs/mcs/OTODO deleted file mode 100644 index ee2cc56f831..00000000000 --- a/mcs/mcs/OTODO +++ /dev/null @@ -1,239 +0,0 @@ ----- This is a list of old tasks, just here for historical value ---- - -Open question: - Create a toplevel block for anonymous methods? - -Anonymous Methods ------------------ - - Plan: - - * Resolve anonymous methods before. - * Each time a Local matches, if the mode is `InAnonymous', flag - the VariableInfo for `proxying'. - * During Resolve track the depth required for local variables. - * Before Emit, create proxy classes with proper depth. - * Emit. - -Notes on memory allocation --------------------------- - - Outdated: - - A run of the AllocationProfile shows that the compiler allocates roughly - 30 megabytes of strings. From those, 20 megabytes come from - LookupType. - - See the notes on current_container problems below on memory usage. - -LookupTypeReflection: ---------------------- - - With something like `System.Object', LookupTypeReflection will be called - twice: once to find out that `System' is not a type and once - for System.Object. - - This is required because System.Reflection requires that the type/nested types are - not separated by a dot but by a plus sign. - - A nested class would be My+Class (My being the toplevel, Class the nested one). - - It is interesting to look at the most called lookups when bootstrapping MCS: - - 647 LTR: ArrayList - 713 LTR: System.Globalization - 822 LTR: System.Object+Expression - 904 LTR: Mono.CSharp.ArrayList - 976 LTR: System.Runtime.CompilerServices - 999 LTR: Type - 1118 LTR: System.Runtime - 1208 LTR: Mono.CSharp.Type - 1373 LTR: Mono.Languages - 1599 LTR: System.Diagnostics - 2036 LTR: System.Text - 2302 LTR: System.Reflection.Emit - 2515 LTR: System.Collections - 4527 LTR: System.Reflection - 22273 LTR: Mono.CSharp - 24245 LTR: System - 27005 LTR: Mono - - Analysis: - The top 9 lookups are done for things which are not types. - - Mono.CSharp.Type happens to be a common lookup: the class Type - used heavily in the compiler in the default namespace. - - RED FLAG: - - Then `Type' is looked up alone a lot of the time, this happens - in parameter declarations and am not entirely sure that this is - correct (FindType will pass to LookupInterfaceOrClass a the current_type.FullName, - which for some reason is null!). This seems to be a problem with a lost - piece of context during FindType. - - System.Object is also used a lot as a toplevel class, and we assume it will - have children, we should just shortcut this. - - A cache: - - Adding a cache and adding a catch for `System.Object' to flag that it wont be the - root of a hierarchy reduced the MCS bootstrap time from 10.22 seconds to 8.90 seconds. - - This cache is currently enabled with SIMPLE_SPEEDUP in typemanager.cs. Memory consumption - went down from 74 megs to 65 megs with this change. - -Major tasks: ------------- - - Pinned and volatile require type modifiers that can not be encoded - with Reflection.Emit. - -* Revisit - - Primary-expression, as it has now been split into - non-array-creation-expression and array-creation-expression. - -* Emit `pinned' for pinned local variables. - - Both `modreq' and pinned will require special hacks in the compiler. - -* Make sure that we are pinning the right variable - -* local_variable_declaration - - Not sure that this grammar is correct, we might have to - resolve this during semantic analysis. - -* Optimizations - - In Indexers and Properties, probably support an EmitWithDup - That emits the code to call Get and then leaves a this pointer - in the stack, so that later a Store can be emitted using that - this pointer (consider Property++ or Indexer++) - -* Use of local temporary in UnaryMutator - - We should get rid of the Localtemporary there for some cases - - This turns out to be very complex, at least for the post-version, - because this case: - - a = i++ - - To produce optimal code, it is necessary for UnaryMutator to know - that it is being assigned to a variable (the way the stack is laid - out using dup requires the store to happen inside UnaryMutator). - -* Interface indexers - - I have not figured out why the Microsoft version puts an - `instance' attribute, and I am not generating this `instance' attribute. - - Explanation: The reason for the `instance' attribute on - indexers is that indexers only apply to instances - -* Check for Final when overriding, if the parent is Final, then we cant - allow an override. - - Implement base indexer access. - -current_container/current_namespace and the DeclSpace ------------------------------------------------------ - - We are storing fully qualified names in the DeclSpace instead of the node, - this is because `current_namespace' (Namepsace) is not a DeclSpace like - `current_container'. - - The reason for storing the full names today is this: - - namespace X { - class Y { - } - } - - namespace A { - class Y { - } - } - - The problem is that we only use the namespace stack to track the "prefix" - for typecontainers, but they are not typecontainers themselves, so we have - to use fully qualified names, because both A.X and A.Y would be entered - in the toplevel type container. If we use the short names, there would be - a name clash. - - To fix this problem, we have to make namespaces DeclSpaces. - - The full size, contrasted with the size that could be stored is: - corlib: - Size of strings held: 368901 - Size of strings short: 147863 - - System: - Size of strings held: 212677 - Size of strings short: 97521 - - System.XML: - Size of strings held: 128055 - Size of strings short: 35782 - - System.Data: - Size of strings held: 117896 - Size of strings short: 36153 - - System.Web: - Size of strings held: 194527 - Size of strings short: 58064 - - System.Windows.Forms: - Size of strings held: 220495 - Size of strings short: 64923 - - -The use of DottedName ---------------------- - - We could probably use a different system to represent names, like this: - - class Name { - string simplename; - Name parent; - } - - So `System.ComponentModel' becomes: - - x: (System, null) - y: (ComponentModel, x) - - The problem is that we would still need to construct the name to pass to - GetType. - - This has been now implemented, its called "QualifiedIdentifier" - -TODO: - - 1. Create a "partial" emit context for each TypeContainer.. - - 2. EmitContext should be partially constructed. No IL Generator. - - interface_type review. - - parameter_array, line 952: `note: must be a single dimension array type'. Validate this - -Instance idea -------------- - - It would be nice to have things that can be "instances" to have an - EmitInstance method (this would default to nothing). - - The idea is to be able to use efficiently the instance data on stack - manipulations, as opposed to the current scheme, where we basically have - a few special cases. - - * `yield' is no longer a keyword, it only has special - meaning before a return or break keywords. - - * Study side effects with assign - * Study TemporaryStorage/LocalStorage -> Merge/rename - diff --git a/mcs/mcs/README b/mcs/mcs/README index f7023e675c7..6bab5b4d9f5 100644 --- a/mcs/mcs/README +++ b/mcs/mcs/README @@ -1,18 +1,4 @@ -Completion support -================== - - Supported: - - a. to complete members of type `a' - a for types and namespaces - a.W - a for local variables - - Unsupported: - - delegate { FOO. - using statement autocompletion - + These are the sources to the Mono C# compiler --------------------------------------------- diff --git a/mcs/mcs/TODO b/mcs/mcs/TODO deleted file mode 100644 index 1abb0382b7b..00000000000 --- a/mcs/mcs/TODO +++ /dev/null @@ -1,223 +0,0 @@ -=========================================== - -* Value Parameter - - I believe that `Value Parameter' might have been introduced - after C# 1.0, also notice than in the treatment of Value Parameter - the parameters are defined in four categories: - - Section 9.3 in the latest spec. - - -Large project: --------------- - -New ---- - - It would be nice to optimize the case of: - - Method (new ValueType ()) - - So that no temporary is created, and we only use a newobj call - that remains on the stack, as opposed to ldloca, initobj, ldloc - call. - -NEW NOTES: ----------- - - ImplicitStandardConversionExists and ImplicitStandardConversion - should always be the same, but there are a few diverging lines that - must be studied: - - if (expr_type == target_type && !(expr is NullLiteral)) - return expr; - - vs: - - if (expr_type == target_type) - return true; - -**************************************************************************************** -* -* The information on the rest of this file is mostly outdated, and its kept here for -* historical reasons -* -**************************************************************************************** - -Error Reporting: ----------------- - - * Make yyerror show a nice syntax error, instead of the current mess. - -Optimization ideas ------------------- - - Currently when we build a type cache, it contains private members, - internal members, and internal protected members; We should trim - these out, as it shows up on the profile. - - We create too many Arraylists; When we know the size, we should create - an array; - - During parsing we use arraylists to accumulate data, like this: - - thing: - - thing_list - : thing { $$ =new ArrayList (); $$.Add ($1); } - | thing_list thing { ArrayList a = $1; a.Add ($2); $$ = a; } - - We probably could start using "Pairs" there: - - thing_list - : thing { $$ = new Pair ($1, null); } - | thing_list thing { Pair p = $1; $$ = new Pair ($2, $1); } - - -EmitContext.ResolveTypeTree ---------------------------- - - We should investigate its usage. The problem is that by default - this will be set when calling FindType, that triggers a more expensive - lookup. - - I believe we should pass the current EmitContext (which has this turned off - by default) to ResolveType/REsolveTypeExpr and then have the routines that - need ResolveType to pass null as the emit context. - -DeclareLocal audit ------------------- - - DeclareLocal is used in various statements. The audit should be done - in two steps: - - * Identify all the declare locals. - - * Identify its uses. - - * Find if we can make wrapper functions for all of them. - - Then we can move DeclareLocal into a helper class. - - This is required to fix foreach in iterators. - -Ideas: ------- - - Instead of the hack that *knows* about System.Object not having any children classes, - we should just make it simple for a probe to know that there is no need for it. - -Dead Code Elimination bugs: ---------------------------- - - I should also resolve all the children expressions in Switch, Fixed, Using. - -Major tasks: ------------- - Properties and 17.6.3: Finish it. - -readonly variables and ref/out - -BUGS ----- - -* Break/Continue statements - - A finally block should reset the InLoop/LoopBegin/LoopEnd, as - they are logically outside the scope of the loop. - -* Break/continue part 2. - - They should transfer control to the finally block if inside a try/catch - block. - -* -> // CSC sets beforefieldinit -> class X { -> // .cctor will be generated by compiler -> public static readonly object O = new System.Object (); -> public static void Main () {} -> } -> - -PENDING TASKS -------------- - -* Merge test 89 and test-34 - -* Code cleanup - - The information when registering a method in InternalParameters - is duplicated, you can always get the types from the InternalParameters - -* Emit modreq for volatiles - - Handle modreq from public apis. - -* Merge tree.cs, rootcontext.cs - -OPTIMIZATIONS -------------- - -* User Defined Conversions is doing way too many calls to do union sets that are not needed - -* Add test case for destructors - -* Places that use `Ldelema' are basically places where I will be - initializing a value type. I could apply an optimization to - disable the implicit local temporary from being created (by using - the method in New). - -* Dropping TypeContainer as an argument to EmitContext - - My theory is that I can get rid of the TypeBuilder completely from - the EmitContext, and have typecasts where it is used (from - DeclSpace to where it matters). - - The only pending problem is that the code that implements Aliases - is on TypeContainer, and probably should go in DeclSpace. - -* Tests - - Write tests for the various reference conversions. We have - test for all the numeric conversions. - -* Optimizations: variable allocation. - - When local variables of a type are required, we should request - the variable and later release it when we are done, so that - the same local variable slot can be reused later on. - -* Add a cache for the various GetArrayMethod operations. - -* MakeUnionSet Callers - - If the types are the same, there is no need to compute the unionset, - we can just use the list from one of the types. - -* Factor the lookup code for class declarations an interfaces - (interface.cs:GetInterfaceByName) - -RECOMMENDATIONS ---------------- - -* Use of lexer.Location in the parser - - Currently we do: - - TOKEN nt TERMINAL nt TERMINAL nt3 { - $$ = new Blah ($2, $4, $6, lexer.Location); - } - - This is bad, because the lexer.Location is for the last item in `nt3' - - We need to change that to use this pattern: - - TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 { - $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ()); - } - - Notice how numbering of the arguments changes as the - { oob_stack.Push (lexer.Location) } takes a "slot" in the productions. - diff --git a/mcs/mcs/anonymous.cs b/mcs/mcs/anonymous.cs index 54e314a99c0..9bc786205a2 100644 --- a/mcs/mcs/anonymous.cs +++ b/mcs/mcs/anonymous.cs @@ -815,7 +815,7 @@ namespace Mono.CSharp { sealed class HoistedFieldAssign : CompilerAssign { public HoistedFieldAssign (Expression target, Expression source) - : base (target, source, source.Location) + : base (target, source, target.Location) { } @@ -1492,6 +1492,9 @@ namespace Mono.CSharp { if (ec.HasSet (ResolveContext.Options.ExpressionTreeConversion)) flags |= ResolveContext.Options.ExpressionTreeConversion; + if (ec.HasSet (ResolveContext.Options.BaseInitializer)) + flags |= ResolveContext.Options.BaseInitializer; + aec.Set (flags); var errors = ec.Report.Errors; @@ -2004,11 +2007,11 @@ namespace Mono.CSharp { IntConstant FNV_prime = new IntConstant (Compiler.BuiltinTypes, 16777619, loc); rs_hashcode = new Binary (Binary.Operator.Multiply, - new Binary (Binary.Operator.ExclusiveOr, rs_hashcode, field_hashcode, loc), - FNV_prime, loc); + new Binary (Binary.Operator.ExclusiveOr, rs_hashcode, field_hashcode), + FNV_prime); Expression field_to_string = new Conditional (new BooleanExpression (new Binary (Binary.Operator.Inequality, - new MemberAccess (new This (f.Location), f.Name), new NullLiteral (loc), loc)), + new MemberAccess (new This (f.Location), f.Name), new NullLiteral (loc))), new Invocation (new MemberAccess ( new MemberAccess (new This (f.Location), f.Name), "ToString"), null), new StringConstant (Compiler.BuiltinTypes, string.Empty, loc), loc); @@ -2019,9 +2022,7 @@ namespace Mono.CSharp { string_concat, new Binary (Binary.Operator.Addition, new StringConstant (Compiler.BuiltinTypes, " " + p.Name + " = ", loc), - field_to_string, - loc), - loc); + field_to_string)); continue; } @@ -2031,18 +2032,15 @@ namespace Mono.CSharp { string_concat = new Binary (Binary.Operator.Addition, new Binary (Binary.Operator.Addition, string_concat, - new StringConstant (Compiler.BuiltinTypes, ", " + p.Name + " = ", loc), - loc), - field_to_string, - loc); + new StringConstant (Compiler.BuiltinTypes, ", " + p.Name + " = ", loc)), + field_to_string); - rs_equals = new Binary (Binary.Operator.LogicalAnd, rs_equals, field_equal, loc); + rs_equals = new Binary (Binary.Operator.LogicalAnd, rs_equals, field_equal); } string_concat = new Binary (Binary.Operator.Addition, string_concat, - new StringConstant (Compiler.BuiltinTypes, " }", loc), - loc); + new StringConstant (Compiler.BuiltinTypes, " }", loc)); // // Equals (object obj) override @@ -2053,9 +2051,9 @@ namespace Mono.CSharp { new As (equals_block.GetParameterReference (0, loc), current_type, loc), loc))); - Expression equals_test = new Binary (Binary.Operator.Inequality, other_variable, new NullLiteral (loc), loc); + Expression equals_test = new Binary (Binary.Operator.Inequality, other_variable, new NullLiteral (loc)); if (rs_equals != null) - equals_test = new Binary (Binary.Operator.LogicalAnd, equals_test, rs_equals, loc); + equals_test = new Binary (Binary.Operator.LogicalAnd, equals_test, rs_equals); equals_block.AddStatement (new Return (equals_test, loc)); equals.Block = equals_block; @@ -2097,19 +2095,19 @@ namespace Mono.CSharp { var hash_variable = new LocalVariableReference (li_hash, loc); hashcode_block.AddStatement (new StatementExpression ( new CompoundAssign (Binary.Operator.Addition, hash_variable, - new Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 13, loc), loc), loc))); + new Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 13, loc))))); hashcode_block.AddStatement (new StatementExpression ( new CompoundAssign (Binary.Operator.ExclusiveOr, hash_variable, - new Binary (Binary.Operator.RightShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 7, loc), loc), loc))); + new Binary (Binary.Operator.RightShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 7, loc))))); hashcode_block.AddStatement (new StatementExpression ( new CompoundAssign (Binary.Operator.Addition, hash_variable, - new Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 3, loc), loc), loc))); + new Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 3, loc))))); hashcode_block.AddStatement (new StatementExpression ( new CompoundAssign (Binary.Operator.ExclusiveOr, hash_variable, - new Binary (Binary.Operator.RightShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 17, loc), loc), loc))); + new Binary (Binary.Operator.RightShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 17, loc))))); hashcode_block.AddStatement (new StatementExpression ( new CompoundAssign (Binary.Operator.Addition, hash_variable, - new Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 5, loc), loc), loc))); + new Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 5, loc))))); hashcode_block.AddStatement (new Return (hash_variable, loc)); hashcode.Block = hashcode_top; diff --git a/mcs/mcs/argument.cs b/mcs/mcs/argument.cs index 9da98b8a80c..22e28eaf729 100644 --- a/mcs/mcs/argument.cs +++ b/mcs/mcs/argument.cs @@ -320,20 +320,20 @@ namespace Mono.CSharp if (a.Expr is Constant) { info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "Constant", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "Constant", loc)); } else if (a.ArgType == Argument.AType.Ref) { info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "IsRef", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "IsRef", loc)); info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "UseCompileTimeType", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "UseCompileTimeType", loc)); } else if (a.ArgType == Argument.AType.Out) { info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "IsOut", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "IsOut", loc)); info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "UseCompileTimeType", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "UseCompileTimeType", loc)); } else if (a.ArgType == Argument.AType.DynamicTypeName) { info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "IsStaticType", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "IsStaticType", loc)); } var arg_type = a.Expr.Type; @@ -354,14 +354,14 @@ namespace Mono.CSharp } info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "UseCompileTimeType", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "UseCompileTimeType", loc)); } string named_value; NamedArgument na = a as NamedArgument; if (na != null) { info_flags = new Binary (Binary.Operator.BitwiseOr, info_flags, - new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "NamedArgument", loc), loc); + new MemberAccess (new MemberAccess (binder, info_flags_enum, loc), "NamedArgument", loc)); named_value = na.Name; } else { diff --git a/mcs/mcs/assembly.cs b/mcs/mcs/assembly.cs index 1cdbf451875..f95a4d3cfa1 100644 --- a/mcs/mcs/assembly.cs +++ b/mcs/mcs/assembly.cs @@ -624,9 +624,16 @@ namespace Mono.CSharp new MemberAccess (system_security_permissions, "SecurityPermissionAttribute"), new Arguments[] { pos, named }, loc, false); g.AttachTo (module, module); - var ctor = g.Resolve (); - if (ctor != null) { - g.ExtractSecurityPermissionSet (ctor, ref declarative_security); + + // Disable no-location warnings (e.g. obsolete) for compiler generated attribute + Compiler.Report.DisableReporting (); + try { + var ctor = g.Resolve (); + if (ctor != null) { + g.ExtractSecurityPermissionSet (ctor, ref declarative_security); + } + } finally { + Compiler.Report.EnableReporting (); } } diff --git a/mcs/mcs/assign.cs b/mcs/mcs/assign.cs index 1822ac65eea..fdb24f20fc2 100644 --- a/mcs/mcs/assign.cs +++ b/mcs/mcs/assign.cs @@ -538,11 +538,11 @@ namespace Mono.CSharp { ExpressionStatement resolved; IMemberContext mc; - public FieldInitializer (FieldSpec spec, Expression expression, IMemberContext mc) - : base (new FieldExpr (spec, expression.Location), expression, expression.Location) + public FieldInitializer (FieldBase mc, Expression expression, Location loc) + : base (new FieldExpr (mc.Spec, expression.Location), expression, loc) { this.mc = mc; - if (!spec.IsStatic) + if (!mc.IsStatic) ((FieldExpr)target).InstanceExpression = new CompilerGeneratedThis (mc.CurrentType, expression.Location); } @@ -649,15 +649,15 @@ namespace Mono.CSharp { Expression right; Expression left; - public CompoundAssign (Binary.Operator op, Expression target, Expression source, Location loc) - : base (target, source, loc) + public CompoundAssign (Binary.Operator op, Expression target, Expression source) + : base (target, source, target.Location) { right = source; this.op = op; } - public CompoundAssign (Binary.Operator op, Expression target, Expression source, Expression left, Location loc) - : this (op, target, source, loc) + public CompoundAssign (Binary.Operator op, Expression target, Expression source, Expression left) + : this (op, target, source) { this.left = left; } @@ -720,7 +720,7 @@ namespace Mono.CSharp { if (left == null) left = new TargetExpression (target); - source = new Binary (op, left, right, true, loc); + source = new Binary (op, left, right, true); if (target is DynamicMemberAssignable) { Arguments targs = ((DynamicMemberAssignable) target).Arguments; diff --git a/mcs/mcs/async.cs b/mcs/mcs/async.cs index c2885de8e0b..47ae7570870 100644 --- a/mcs/mcs/async.cs +++ b/mcs/mcs/async.cs @@ -221,7 +221,9 @@ namespace Mono.CSharp // // awaiter = expr.GetAwaiter (); // - fe_awaiter.EmitAssign (ec, expr, false, false); + using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) { + fe_awaiter.EmitAssign (ec, expr, false, false); + } Label skip_continuation = ec.DefineLabel (); @@ -278,14 +280,8 @@ namespace Mono.CSharp awaiter.IsAvailableForReuse = true; - if (ResultType.Kind != MemberKind.Void) { - var storey = (AsyncTaskStorey) machine_initializer.Storey; - - if (storey.HoistedReturn != null) - storey.HoistedReturn.EmitAssign (ec); - else - ec.Emit (OpCodes.Pop); - } + if (ResultType.Kind != MemberKind.Void) + ec.Emit (OpCodes.Pop); } void Error_WrongAwaiterPattern (ResolveContext rc, TypeSpec awaiter) diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index ae9627e93be..a73d7870ca0 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -1457,6 +1457,12 @@ namespace Mono.CSharp { Encode (type.MemberDefinition.IsImported ? old_type.AssemblyQualifiedName : old_type.FullName); } + public void EncodeTypeName (TypeContainer type) + { + Encode (type.GetSignatureForMetadata ()); + } + + // // Encodes single property named argument per call // @@ -1610,6 +1616,10 @@ namespace Mono.CSharp { // New in .NET 4.0 public readonly PredefinedDynamicAttribute Dynamic; + // New in .NET 4.5 + public readonly PredefinedStateMachineAttribute AsyncStateMachine; + public readonly PredefinedStateMachineAttribute IteratorStateMachine; + // // Optional types which are used as types and for member lookup // @@ -1671,6 +1681,11 @@ namespace Mono.CSharp { StructLayout = new PredefinedAttribute (module, "System.Runtime.InteropServices", "StructLayoutAttribute"); FieldOffset = new PredefinedAttribute (module, "System.Runtime.InteropServices", "FieldOffsetAttribute"); + AsyncStateMachine = new PredefinedStateMachineAttribute (module, "System.Runtime.CompilerServices", "AsyncStateMachineAttribute"); + IteratorStateMachine = new PredefinedStateMachineAttribute (module, "System.Runtime.CompilerServices", "IteratorStateMachineAttribute") { + IsIterator = true + }; + CallerMemberNameAttribute = new PredefinedAttribute (module, "System.Runtime.CompilerServices", "CallerMemberNameAttribute"); CallerLineNumberAttribute = new PredefinedAttribute (module, "System.Runtime.CompilerServices", "CallerLineNumberAttribute"); CallerFilePathAttribute = new PredefinedAttribute (module, "System.Runtime.CompilerServices", "CallerFilePathAttribute"); @@ -1858,6 +1873,34 @@ namespace Mono.CSharp { } } + public class PredefinedStateMachineAttribute : PredefinedAttribute + { + public PredefinedStateMachineAttribute (ModuleContainer module, string ns, string name) + : base (module, ns, name) + { + } + + public bool IsIterator { get; set; } + + public void EmitAttribute (MethodBuilder builder, StateMachine type) + { + var predefined_ctor = IsIterator ? + module.PredefinedMembers.IteratorStateMachineAttributeCtor : + module.PredefinedMembers.AsyncStateMachineAttributeCtor; + + var ctor = predefined_ctor.Get (); + + if (ctor == null) + return; + + AttributeEncoder encoder = new AttributeEncoder (); + encoder.EncodeTypeName (type); + encoder.EncodeEmptyNamedArguments (); + + builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ()); + } + } + public class PredefinedDynamicAttribute : PredefinedAttribute { MethodSpec tctor; diff --git a/mcs/mcs/cfold.cs b/mcs/mcs/cfold.cs index 9e2cfc8b96c..8724e48b52d 100644 --- a/mcs/mcs/cfold.cs +++ b/mcs/mcs/cfold.cs @@ -187,7 +187,7 @@ namespace Mono.CSharp { // if ((lt.BuiltinType == BuiltinTypeSpec.Type.Bool && right is NullLiteral) || (rt.BuiltinType == BuiltinTypeSpec.Type.Bool && left is NullLiteral)) { - var b = new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + var b = new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); // false | null => null // null | false => null @@ -231,7 +231,7 @@ namespace Mono.CSharp { // if ((lt.BuiltinType == BuiltinTypeSpec.Type.Bool && right is NullLiteral) || (rt.BuiltinType == BuiltinTypeSpec.Type.Bool && left is NullLiteral)) { - var b = new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + var b = new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); // false & null => false // null & false => false @@ -469,7 +469,7 @@ namespace Mono.CSharp { if (left is NullLiteral && right is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (!DoBinaryNumericPromotions (ec, ref left, ref right)) @@ -566,7 +566,7 @@ namespace Mono.CSharp { if (left is NullLiteral && right is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (!DoBinaryNumericPromotions (ec, ref left, ref right)) @@ -662,7 +662,7 @@ namespace Mono.CSharp { if (left is NullLiteral && right is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (!DoBinaryNumericPromotions (ec, ref left, ref right)) @@ -762,7 +762,7 @@ namespace Mono.CSharp { if (left is NullLiteral && right is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (!DoBinaryNumericPromotions (ec, ref left, ref right)) @@ -852,7 +852,7 @@ namespace Mono.CSharp { if (left is NullLiteral && right is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } IntConstant ic = right.ConvertImplicitly (ec.BuiltinTypes.Int) as IntConstant; @@ -873,7 +873,7 @@ namespace Mono.CSharp { // null << value => null if (left is NullLiteral) - return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); left = left.ConvertImplicitly (ec.BuiltinTypes.Int); if (left.Type.BuiltinType == BuiltinTypeSpec.Type.Int) @@ -889,7 +889,7 @@ namespace Mono.CSharp { if (left is NullLiteral && right is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } IntConstant sic = right.ConvertImplicitly (ec.BuiltinTypes.Int) as IntConstant; @@ -909,7 +909,7 @@ namespace Mono.CSharp { // null >> value => null if (left is NullLiteral) - return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); left = left.ConvertImplicitly (ec.BuiltinTypes.Int); if (left.Type.BuiltinType == BuiltinTypeSpec.Type.Int) @@ -925,7 +925,7 @@ namespace Mono.CSharp { if (left.IsNull || right.IsNull) { return ReducedExpression.Create ( new BoolConstant (ec.BuiltinTypes, left.IsNull == right.IsNull, left.Location), - new Binary (oper, left, right, loc)); + new Binary (oper, left, right)); } if (left is StringConstant && right is StringConstant) @@ -969,7 +969,7 @@ namespace Mono.CSharp { if (left.IsNull || right.IsNull) { return ReducedExpression.Create ( new BoolConstant (ec.BuiltinTypes, left.IsNull != right.IsNull, left.Location), - new Binary (oper, left, right, loc)); + new Binary (oper, left, right)); } if (left is StringConstant && right is StringConstant) @@ -1011,11 +1011,11 @@ namespace Mono.CSharp { if (left is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (left is Nullable.LiftedNull) { - return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); } } @@ -1051,11 +1051,11 @@ namespace Mono.CSharp { if (left is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (left is Nullable.LiftedNull) { - return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); } } @@ -1091,11 +1091,11 @@ namespace Mono.CSharp { if (left is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (left is Nullable.LiftedNull) { - return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); } } @@ -1131,11 +1131,11 @@ namespace Mono.CSharp { if (left is NullLiteral) { var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc); lifted_int.ResolveAsType (ec); - return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec); } if (left is Nullable.LiftedNull) { - return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec); + return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec); } } diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index b4c0f6753c6..faa84758853 100644 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -346,12 +346,31 @@ namespace Mono.CSharp return MemberName.GetSignatureForError (); } + public string GetSignatureForMetadata () + { +#if STATIC + var name = TypeNameParser.Escape (MemberName.Basename); + + if (Parent is TypeDefinition) { + return Parent.GetSignatureForMetadata () + "+" + name; + } + + if (Parent != null && Parent.MemberName != null) + return Parent.GetSignatureForMetadata () + "." + name; + + return name; +#else + throw new NotImplementedException (); +#endif + } + public virtual void RemoveContainer (TypeContainer cont) { if (containers != null) containers.Remove (cont); - defined_names.Remove (cont.Basename); + var tc = Parent == Module ? Module : this; + tc.defined_names.Remove (cont.Basename); } public virtual void VerifyMembers () @@ -1821,13 +1840,20 @@ namespace Mono.CSharp return; string class_indexer_name = null; - has_normal_indexers = true; // // Check normal indexers for consistent name, explicit interface implementation // indexers are ignored // foreach (var indexer in indexers) { + // + // FindMembers can return unfiltered full hierarchy names + // + if (indexer.DeclaringType != spec) + continue; + + has_normal_indexers = true; + if (class_indexer_name == null) { indexer_name = class_indexer_name = indexer.Name; continue; @@ -1905,7 +1931,7 @@ namespace Mono.CSharp continue; // - // Don't be pendatic over serializable attributes + // Don't be pedantic when type requires specific layout // if (f.OptAttributes != null || PartialContainer.HasStructLayout) continue; @@ -1917,10 +1943,6 @@ namespace Mono.CSharp } else if (TypeSpec.IsReferenceType (f.MemberType)) { value = "null"; } else { - // Ignore this warning for struct value fields (they are always initialized) - if (f.MemberType.IsStruct) - continue; - value = null; } diff --git a/mcs/mcs/codegen.cs b/mcs/mcs/codegen.cs index 026d4106980..9bb7066758d 100644 --- a/mcs/mcs/codegen.cs +++ b/mcs/mcs/codegen.cs @@ -944,10 +944,10 @@ namespace Mono.CSharp if (method.ReturnType.Kind == MemberKind.Void && method.IsConditionallyExcluded (ec.MemberContext, loc)) return; - EmitPredefined (ec, method, Arguments); + EmitPredefined (ec, method, Arguments, loc); } - public void EmitPredefined (EmitContext ec, MethodSpec method, Arguments Arguments) + public void EmitPredefined (EmitContext ec, MethodSpec method, Arguments Arguments, Location? loc = null) { Expression instance_copy = null; @@ -1006,6 +1006,18 @@ namespace Mono.CSharp ec.Emit (OpCodes.Constrained, InstanceExpression.Type); } + if (loc != null) { + // + // Emit explicit sequence point for expressions like Foo.Bar () to help debugger to + // break at right place when LHS expression can be stepped-into + // + // TODO: The list is probably not comprehensive, need to do more testing + // + if (InstanceExpression is PropertyExpr || InstanceExpression is Invocation || InstanceExpression is IndexerExpr || + InstanceExpression is New || InstanceExpression is DelegateInvocation) + ec.Mark (loc.Value); + } + // // Set instance expression to actual result expression. When it contains await it can be // picked up by caller diff --git a/mcs/mcs/compiler.doc b/mcs/mcs/compiler.doc deleted file mode 100644 index 391788d479f..00000000000 --- a/mcs/mcs/compiler.doc +++ /dev/null @@ -1,106 +0,0 @@ -Compiler operations - -The compiler has a number of phases: - -* Parsing - - Initially the compiler parses all the source files and keeps a - parsed representation in memory. Also syntax error checking - is performed at this point. - - The compiler stores the information in classes whose names - represent the language construct, for example, the "if" - construct is stored in an `If' class. A class is stored in a - `Class'. - -* Type creation - - Once the parsing has happened, compiled types are created. What - is actually created is only a type skeleton including name, - correct nesting, type parameters definitions. Types are created - before any referenced types are loaded to ensure that locally - defined type is used when an external assembly references a type - with same name as compiled type. - -* References loading - - As a next step referenced assemblies and modules are loaded and - their top-level types are imported and cached. We import only - C# valid top level types at this point all other members are - imported on demand when needed. - -* Namespaces definition - - Before any type resolution can be done we define all compiled - namespaces. This is mainly done to prepare using clauses of each - namespace block before any type resolution takes a place. - -* Types definition - - The first step of type definition is to resolve base class or - base interfaces to correctly setup type hierarchy before any - member is defined. - - At this point we do some error checking and verify that the - members inheritance is correct and some other members - oriented checks. - - By the time we are done, all classes, structs and interfaces - have been defined and all their members have been defined as - well. - -* Emit aka Code Generation - - At this stage the CIL code is generated together with other - metadata including attributes, constants, type parameter constraints. - Before any method body code is generated its body is first - resolved and check for errors including flow analysis. - -* Statements - - Most of the statements are handled in the statement.cs file. - -* Expressions - -* MemberCache - - MemberCache is one of core compiler components. It maintains information - about types and their members. It tries to be as fast as possible - because almost all resolve operations end up querying members info in - some way. - - MemberCache is not definition but specification oriented to maintain - differences between inflated versions of generic types. This makes usage - of MemberCache simple because consumer does not need to care how to inflate - current member and returned type information will always give correctly - inflated type. However setting MemberCache up is one of the most complicated - parts of the compiler due to possible dependencies when types are defined - and complexity of nested types. - -* Error reporting - - Always use `Report::Error' or `Report::Warning' methods of Report - class. The actual Report instance is available via local context. - An expression error reporting has to be done during Resolve phase, - except when it's Emit specific (very rare). - - Error reporting should try to use the same codes that the - Microsoft compiler uses (if only so we can track which errors - we handle and which ones we don't). - - If there is an error which is specific to MSC, use negative - numbers, and register the number in mcs/errors/errors.txt - - Try to write a test case for any error that you run into the - code of the compiler if there is none already. - - Put your test case in a file called csNNNN.cs in the - mcs/errors directory, and have the first two lines be: - - // csNNNN.cs: This is the error message - // Line: XXX - // Compiler options: an optional compiler options - - Where `XXX' is the line where the error ocurrs. We will later - use this as a regression test suite for catching errors in the - compiler. diff --git a/mcs/mcs/const.cs b/mcs/mcs/const.cs index 883b0d2c23f..7d149aae26c 100644 --- a/mcs/mcs/const.cs +++ b/mcs/mcs/const.cs @@ -59,7 +59,7 @@ namespace Mono.CSharp { if ((field_attr & FieldAttributes.InitOnly) != 0) Parent.PartialContainer.RegisterFieldForInitialization (this, - new FieldInitializer (spec, initializer, this)); + new FieldInitializer (this, initializer, Location)); if (declarators != null) { var t = new TypeExpression (MemberType, TypeExpression.Location); diff --git a/mcs/mcs/context.cs b/mcs/mcs/context.cs index 5f309854bda..0e45bd5deb2 100644 --- a/mcs/mcs/context.cs +++ b/mcs/mcs/context.cs @@ -13,6 +13,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Security.Cryptography; namespace Mono.CSharp { @@ -730,4 +731,28 @@ namespace Mono.CSharp return new FlagsHandle (this, options, enable ? options : 0); } } + + // + // Parser session objects. We could recreate all these objects for each parser + // instance but the best parser performance the session object can be reused + // + public class ParserSession + { + MD5 md5; + + public readonly char[] StreamReaderBuffer = new char[SeekableStreamReader.DefaultReadAheadSize * 2]; + public readonly Dictionary[] Identifiers = new Dictionary[Tokenizer.MaxIdentifierLength + 1]; + public readonly List ParametersStack = new List (4); + public readonly char[] IDBuilder = new char[Tokenizer.MaxIdentifierLength]; + public readonly char[] NumberBuilder = new char[Tokenizer.MaxNumberLength]; + + public LocationsBag LocationsBag { get; set; } + public bool UseJayGlobalArrays { get; set; } + public Tokenizer.LocatedToken[] LocatedTokens { get; set; } + + public MD5 GetChecksumAlgorithm () + { + return md5 ?? (md5 = MD5.Create ()); + } + } } diff --git a/mcs/mcs/convert.cs b/mcs/mcs/convert.cs index a9a304dfc91..3020c8814c5 100644 --- a/mcs/mcs/convert.cs +++ b/mcs/mcs/convert.cs @@ -1337,8 +1337,7 @@ namespace Mono.CSharp { try { c = c.ConvertImplicitly (target_type); } catch { - Console.WriteLine ("Conversion error happened in line {0}", loc); - throw; + throw new InternalErrorException ("Conversion error", loc); } if (c != null) return c; diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay index 1a011b7587e..dd0a8a96673 100644 --- a/mcs/mcs/cs-parser.jay +++ b/mcs/mcs/cs-parser.jay @@ -10,12 +10,7 @@ // // (C) 2001 Ximian, Inc (http://www.ximian.com) // (C) 2004-2011 Novell, Inc -// Copyright 2011 Xamarin Inc. -// -// TODO: -// (1) Figure out why error productions dont work. `type-declaration' is a -// great spot to put an `error' because you can reproduce it with this input: -// "public X { }" +// Copyright 2011-2012 Xamarin Inc. // using System.Text; @@ -81,7 +76,7 @@ namespace Mono.CSharp /// /// An out-of-band stack. /// - static Stack oob_stack; + Stack oob_stack; /// /// Controls the verbosity of the errors produced by the parser @@ -137,7 +132,7 @@ namespace Mono.CSharp // share the bucket for very common constructs which can never // be recursive // - static List parameters_bucket = new List (6); + List parameters_bucket; // // Full AST support members @@ -2577,6 +2572,22 @@ enum_member_declaration $$ = em; } + | opt_attributes IDENTIFIER error + { + Error_SyntaxError (yyToken); + + var lt = (Tokenizer.LocatedToken) $2; + var em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) $1); + ((Enum) current_type).AddEnumMember (em); + + if (doc_support) { + em.DocComment = Lexer.consume_doc_comment (); + Lexer.doc_state = XmlCommentState.Allowed; + } + + $$ = em; + } + | attributes_without_members ; delegate_declaration @@ -3090,6 +3101,14 @@ invocation_expression $$ = new Invocation ((Expression) $1, (Arguments) $3); lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4)); } + | primary_expression open_parens_any argument_list error + { + Error_SyntaxError (yyToken); + + $$ = new Invocation ((Expression) $1, (Arguments) $3); + lbag.AddLocation ($$, GetLocation ($2)); + } + ; opt_object_or_collection_initializer @@ -3821,18 +3840,18 @@ multiplicative_expression : prefixed_unary_expression | multiplicative_expression STAR prefixed_unary_expression { - $$ = new Binary (Binary.Operator.Multiply, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Multiply, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | multiplicative_expression DIV prefixed_unary_expression { - $$ = new Binary (Binary.Operator.Division, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Division, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | multiplicative_expression PERCENT prefixed_unary_expression { - $$ = new Binary (Binary.Operator.Modulus, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Modulus, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3840,18 +3859,14 @@ additive_expression : multiplicative_expression | additive_expression PLUS multiplicative_expression { - $$ = new Binary (Binary.Operator.Addition, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Addition, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | additive_expression MINUS multiplicative_expression { - $$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } - | parenthesized_expression MINUS multiplicative_expression - { - // Shift/Reduce conflict - $$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3, GetLocation ($2)); - } | additive_expression AS type { $$ = new As ((Expression) $1, (Expression) $3, GetLocation ($2)); @@ -3866,13 +3881,13 @@ shift_expression : additive_expression | shift_expression OP_SHIFT_LEFT additive_expression { - $$ = new Binary (Binary.Operator.LeftShift, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.LeftShift, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | shift_expression OP_SHIFT_RIGHT additive_expression { - $$ = new Binary (Binary.Operator.RightShift, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.RightShift, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3880,23 +3895,23 @@ relational_expression : shift_expression | relational_expression OP_LT shift_expression { - $$ = new Binary (Binary.Operator.LessThan, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.LessThan, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | relational_expression OP_GT shift_expression { - $$ = new Binary (Binary.Operator.GreaterThan, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.GreaterThan, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | relational_expression OP_LE shift_expression { - $$ = new Binary (Binary.Operator.LessThanOrEqual, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.LessThanOrEqual, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | relational_expression OP_GE shift_expression { - $$ = new Binary (Binary.Operator.GreaterThanOrEqual, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3904,13 +3919,13 @@ equality_expression : relational_expression | equality_expression OP_EQ relational_expression { - $$ = new Binary (Binary.Operator.Equality, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Equality, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | equality_expression OP_NE relational_expression { - $$ = new Binary (Binary.Operator.Inequality, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.Inequality, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3918,8 +3933,8 @@ and_expression : equality_expression | and_expression BITWISE_AND equality_expression { - $$ = new Binary (Binary.Operator.BitwiseAnd, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.BitwiseAnd, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3927,8 +3942,8 @@ exclusive_or_expression : and_expression | exclusive_or_expression CARRET and_expression { - $$ = new Binary (Binary.Operator.ExclusiveOr, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.ExclusiveOr, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3936,8 +3951,8 @@ inclusive_or_expression : exclusive_or_expression | inclusive_or_expression BITWISE_OR exclusive_or_expression { - $$ = new Binary (Binary.Operator.BitwiseOr, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.BitwiseOr, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3945,8 +3960,8 @@ conditional_and_expression : inclusive_or_expression | conditional_and_expression OP_AND inclusive_or_expression { - $$ = new Binary (Binary.Operator.LogicalAnd, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.LogicalAnd, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3954,8 +3969,8 @@ conditional_or_expression : conditional_and_expression | conditional_or_expression OP_OR conditional_and_expression { - $$ = new Binary (Binary.Operator.LogicalOr, - (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Binary (Binary.Operator.LogicalOr, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3966,7 +3981,8 @@ null_coalescing_expression if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation ($2), "null coalescing operator"); - $$ = new Nullable.NullCoalescingOperator ((Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new Nullable.NullCoalescingOperator ((Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -3987,57 +4003,58 @@ conditional_expression assignment_expression : prefixed_unary_expression ASSIGN expression { - $$ = new SimpleAssign ((Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new SimpleAssign ((Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_MULT_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.Multiply, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.Multiply, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_DIV_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.Division, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.Division, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_MOD_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.Modulus, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.Modulus, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_ADD_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.Addition, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.Addition, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_SUB_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.Subtraction, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_SHIFT_LEFT_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.LeftShift, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.LeftShift, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_SHIFT_RIGHT_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.RightShift, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.RightShift, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_AND_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.BitwiseAnd, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.BitwiseAnd, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_OR_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.BitwiseOr, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.BitwiseOr, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } | prefixed_unary_expression OP_XOR_ASSIGN expression { - $$ = new CompoundAssign ( - Binary.Operator.ExclusiveOr, (Expression) $1, (Expression) $3, GetLocation ($2)); + $$ = new CompoundAssign (Binary.Operator.ExclusiveOr, (Expression) $1, (Expression) $3); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -4805,7 +4822,7 @@ identifier_inside_body { if (async_block) { report.Error (4003, GetLocation ($1), "`await' cannot be used as an identifier within an async method or lambda expression"); - $$ = Tokenizer.LocatedToken.Create ("await", GetLocation ($1)); + $$ = new Tokenizer.LocatedToken ("await", GetLocation ($1)); } } ; @@ -5158,19 +5175,19 @@ while_statement do_statement : DO embedded_statement WHILE open_parens_any boolean_expression CLOSE_PARENS SEMICOLON { - $$ = new Do ((Statement) $2, (BooleanExpression) $5, GetLocation ($1)); + $$ = new Do ((Statement) $2, (BooleanExpression) $5, GetLocation ($1), GetLocation ($3)); lbag.AddStatement ($$, GetLocation ($3), GetLocation ($4), GetLocation ($6), GetLocation ($7)); } | DO embedded_statement error { Error_SyntaxError (yyToken); - $$ = new Do ((Statement) $2, null, GetLocation ($1)); + $$ = new Do ((Statement) $2, null, GetLocation ($1), Location.Null); } | DO embedded_statement WHILE open_parens_any boolean_expression error { Error_SyntaxError (yyToken); - $$ = new Do ((Statement) $2, (BooleanExpression) $5, GetLocation ($1)); + $$ = new Do ((Statement) $2, (BooleanExpression) $5, GetLocation ($1), GetLocation ($3)); lbag.AddStatement ($$, GetLocation ($3), GetLocation ($4)); } ; @@ -5420,6 +5437,11 @@ return_statement $$ = new Return ((Expression) $2, GetLocation ($1)); lbag.AddStatement ($$, GetLocation ($3)); } + | RETURN expression error + { + Error_SyntaxError (yyToken); + $$ = new Return ((Expression) $2, GetLocation ($1)); + } | RETURN error { Error_SyntaxError (yyToken); @@ -5457,6 +5479,24 @@ yield_statement $$ = new Yield ((Expression) $3, lt.Location); lbag.AddStatement ($$, GetLocation ($2), GetLocation ($4)); } + | identifier_inside_body RETURN expression error + { + Error_SyntaxError (yyToken); + + var lt = (Tokenizer.LocatedToken) $1; + string s = lt.Value; + if (s != "yield"){ + report.Error (1003, lt.Location, "; expected"); + } else if ($3 == null) { + report.Error (1627, GetLocation ($4), "Expression expected after yield return"); + } else if (lang_version == LanguageVersion.ISO_1){ + FeatureIsNotAvailable (lt.Location, "iterators"); + } + + current_block.Explicit.RegisterIteratorYield (); + $$ = new Yield ((Expression) $3, lt.Location); + lbag.AddStatement ($$, GetLocation ($2)); + } | identifier_inside_body BREAK SEMICOLON { var lt = (Tokenizer.LocatedToken) $1; @@ -6534,17 +6574,12 @@ public Tokenizer Lexer { } } -static CSharpParser () +public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, ParserSession session) + : this (reader, file, file.Compiler.Report, session) { - oob_stack = new Stack (); } -public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file) - : this (reader, file, file.Compiler.Report) -{ -} - -public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Report report) +public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Report report, ParserSession session) { this.file = file; current_container = current_namespace = file; @@ -6557,22 +6592,16 @@ public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Re lang_version = settings.Version; yacc_verbose_flag = settings.VerboseParserFlag; doc_support = settings.DocumentationFile != null; - oob_stack.Clear (); - lexer = new Tokenizer (reader, file); - -#if FULL_AST - lbag = new LocationsBag (); -#else - lbag = null; -#endif - - use_global_stacks = true; + lexer = new Tokenizer (reader, file, session); + oob_stack = new Stack (); + lbag = session.LocationsBag; + use_global_stacks = session.UseJayGlobalArrays; + parameters_bucket = session.ParametersStack; } public void parse () { eof_token = Token.EOF; - Tokenizer.LocatedToken.Initialize (); try { if (yacc_verbose_flag > 1) @@ -6639,12 +6668,6 @@ Location GetLocation (object obj) return lexer.Location; } -public LocationsBag LocationsBag { - get { - return lbag; - } -} - void start_block (Location loc) { if (current_block == null) { diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs index 2ec4d96b3ac..4ec1bd90881 100644 --- a/mcs/mcs/cs-tokenizer.cs +++ b/mcs/mcs/cs-tokenizer.cs @@ -17,6 +17,7 @@ using System.Text; using System.Collections.Generic; using System.Globalization; using System.Diagnostics; +using System.Collections; namespace Mono.CSharp { @@ -73,27 +74,60 @@ namespace Mono.CSharp // public class LocatedToken { - int row, column; - string value; + public int row, column; + public string value; - static LocatedToken[] buffer = new LocatedToken[0]; - static int pos; + public LocatedToken () + { + } - private LocatedToken () + public LocatedToken (string value, Location loc) { + this.value = value; + row = loc.Row; + column = loc.Column; } - public static LocatedToken Create (int row, int column) + public override string ToString () + { + return string.Format ("Token '{0}' at {1},{2}", Value, row, column); + } + + public Location Location { + get { return new Location (row, column); } + } + + public string Value { + get { return value; } + } + } + + public class LocatedTokenBuffer + { + readonly LocatedToken[] buffer; + public int pos; + + public LocatedTokenBuffer () + { + buffer = new LocatedToken[0]; + } + + public LocatedTokenBuffer (LocatedToken[] buffer) + { + this.buffer = buffer ?? new LocatedToken[0]; + } + + public LocatedToken Create (int row, int column) { return Create (null, row, column); } - public static LocatedToken Create (string value, Location loc) + public LocatedToken Create (string value, Location loc) { return Create (value, loc.Row, loc.Column); } - - public static LocatedToken Create (string value, int row, int column) + + public LocatedToken Create (string value, int row, int column) { // // TODO: I am not very happy about the logic but it's the best @@ -107,10 +141,10 @@ namespace Mono.CSharp if (pos >= buffer.Length) { entry = new LocatedToken (); } else { - entry = buffer [pos]; + entry = buffer[pos]; if (entry == null) { entry = new LocatedToken (); - buffer [pos] = entry; + buffer[pos] = entry; } ++pos; @@ -125,32 +159,10 @@ namespace Mono.CSharp // Used for token not required by expression evaluator // [Conditional ("FULL_AST")] - public static void CreateOptional (int row, int col, ref object token) + public void CreateOptional (int row, int col, ref object token) { token = Create (row, col); } - - public static void Initialize () - { -#if !FULL_AST - if (buffer.Length == 0) - buffer = new LocatedToken [15000]; -#endif - pos = 0; - } - - public override string ToString () - { - return string.Format ("Token '{0}' at {1},{2}", Value, row, column); - } - - public Location Location { - get { return new Location (row, column); } - } - - public string Value { - get { return value; } - } } public enum PreprocessorDirective @@ -194,6 +206,7 @@ namespace Mono.CSharp List escaped_identifiers; int parsing_generic_less_than; readonly bool doc_processing; + readonly LocatedTokenBuffer ltb; // // Used mainly for parser optimizations. Some expressions for instance @@ -356,28 +369,15 @@ namespace Mono.CSharp // Stack ifstack; - const int max_id_size = 512; - const int max_number_size = 512; - -#if FULL_AST - readonly char [] id_builder = new char [max_id_size]; - - Dictionary[] identifiers = new Dictionary[max_id_size + 1]; + public const int MaxIdentifierLength = 512; + public const int MaxNumberLength = 512; - char [] number_builder = new char [max_number_size]; + readonly char[] id_builder; + readonly Dictionary[] identifiers; + readonly char[] number_builder; int number_pos; - char[] value_builder = new char[256]; -#else - static readonly char [] id_builder = new char [max_id_size]; - - static Dictionary[] identifiers = new Dictionary[max_id_size + 1]; - - static char [] number_builder = new char [max_number_size]; - static int number_pos; - - static char[] value_builder = new char[256]; -#endif + char[] value_builder = new char[64]; public int Line { get { @@ -428,11 +428,15 @@ namespace Mono.CSharp } } - public Tokenizer (SeekableStreamReader input, CompilationSourceFile file) + public Tokenizer (SeekableStreamReader input, CompilationSourceFile file, ParserSession session) { this.source_file = file; this.context = file.Compiler; this.current_source = file.SourceFile; + this.identifiers = session.Identifiers; + this.id_builder = session.IDBuilder; + this.number_builder = session.NumberBuilder; + this.ltb = new LocatedTokenBuffer (session.LocatedTokens); reader = input; @@ -1318,7 +1322,7 @@ namespace Mono.CSharp bool seen_digits = false; if (c != -1){ - if (number_pos == max_number_size) + if (number_pos == MaxNumberLength) Error_NumericConstantTooLong (); number_builder [number_pos++] = (char) c; } @@ -1329,7 +1333,7 @@ namespace Mono.CSharp // while ((d = peek_char2 ()) != -1){ if (d >= '0' && d <= '9'){ - if (number_pos == max_number_size) + if (number_pos == MaxNumberLength) Error_NumericConstantTooLong (); number_builder [number_pos++] = (char) d; get_char (); @@ -1594,23 +1598,23 @@ namespace Mono.CSharp if (c == 'e' || c == 'E'){ is_real = true; - if (number_pos == max_number_size) + if (number_pos == MaxNumberLength) Error_NumericConstantTooLong (); number_builder [number_pos++] = (char) c; c = get_char (); if (c == '+'){ - if (number_pos == max_number_size) + if (number_pos == MaxNumberLength) Error_NumericConstantTooLong (); number_builder [number_pos++] = '+'; c = -1; } else if (c == '-') { - if (number_pos == max_number_size) + if (number_pos == MaxNumberLength) Error_NumericConstantTooLong (); number_builder [number_pos++] = '-'; c = -1; } else { - if (number_pos == max_number_size) + if (number_pos == MaxNumberLength) Error_NumericConstantTooLong (); number_builder [number_pos++] = '+'; } @@ -1815,13 +1819,10 @@ namespace Mono.CSharp public void putback (int c) { - if (putback_char != -1){ - Console.WriteLine ("Col: " + col); - Console.WriteLine ("Row: " + line); - Console.WriteLine ("Name: " + current_source.Name); - Console.WriteLine ("Current [{0}] putting back [{1}] ", putback_char, c); - throw new Exception ("This should not happen putback on putback"); + if (putback_char != -1) { + throw new InternalErrorException (string.Format ("Secondary putback [{0}] putting back [{1}] is not allowed", (char)putback_char, (char) c), Location); } + if (c == '\n' || col == 0) { // It won't happen though. line--; @@ -1946,7 +1947,7 @@ namespace Mono.CSharp } if (pos != 0) { - if (pos > max_id_size) + if (pos > MaxIdentifierLength) arg = new string (value_builder, 0, pos); else arg = InternIdentifier (value_builder, pos); @@ -2164,6 +2165,8 @@ namespace Mono.CSharp // // The syntax is ` "foo.txt" "{guid}" "hash"' // + // guid is predefined hash algorithm guid {406ea660-64cf-4c82-b6f0-42d48172a799} for md5 + // int c = get_char (); if (c != '"') @@ -2226,6 +2229,7 @@ namespace Mono.CSharp // Any length of checksum List checksum_bytes = new List (16); + var checksum_location = Location; c = peek_char (); while (c != '"' && c != -1) { checksum_bytes.Add (read_hex (out error)); @@ -2241,14 +2245,23 @@ namespace Mono.CSharp return false; } - file.SetChecksum (guid_bytes, checksum_bytes.ToArray ()); - current_source.AutoGenerated = true; + if (context.Settings.GenerateDebugInfo) { + var chsum = checksum_bytes.ToArray (); + + if (file.HasChecksum) { + if (!ArrayComparer.IsEqual (file.Checksum, chsum)) { + // TODO: Report.SymbolRelatedToPreviousError + Report.Warning (1697, 1, checksum_location, "Different checksum values specified for file `{0}'", file.Name); + } + } + + file.SetChecksum (guid_bytes, chsum); + current_source.AutoGenerated = true; + } + return true; } -#if !FULL_AST - static -#endif bool IsTokenIdentifierEqual (char[] identifier) { for (int i = 0; i < identifier.Length; ++i) { @@ -2982,22 +2995,19 @@ namespace Mono.CSharp if (id_builder [0] >= '_' && !quoted) { int keyword = GetKeyword (id_builder, pos); if (keyword != -1) { - val = LocatedToken.Create (keyword == Token.AWAIT ? "await" : null, ref_line, column); + val = ltb.Create (keyword == Token.AWAIT ? "await" : null, ref_line, column); return keyword; } } string s = InternIdentifier (id_builder, pos); - val = LocatedToken.Create (s, ref_line, column); + val = ltb.Create (s, ref_line, column); if (quoted && parsing_attribute_section) AddEscapedIdentifier (((LocatedToken) val).Location); return Token.IDENTIFIER; } -#if !FULL_AST - static -#endif string InternIdentifier (char[] charBuffer, int length) { // @@ -3062,17 +3072,17 @@ namespace Mono.CSharp return consume_identifier (c); case '{': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); return Token.OPEN_BRACE; case '}': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); return Token.CLOSE_BRACE; case '[': // To block doccomment inside attribute declaration. if (doc_state == XmlCommentState.Allowed) doc_state = XmlCommentState.NotAllowed; - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (parsing_block == 0 || lambda_arguments_parsing) return Token.OPEN_BRACKET; @@ -3098,10 +3108,10 @@ namespace Mono.CSharp return Token.OPEN_BRACKET_EXPR; } case ']': - LocatedToken.CreateOptional (ref_line, col, ref val); + ltb.CreateOptional (ref_line, col, ref val); return Token.CLOSE_BRACKET; case '(': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); // // An expression versions of parens can appear in block context only // @@ -3146,29 +3156,29 @@ namespace Mono.CSharp return Token.OPEN_PARENS; case ')': - LocatedToken.CreateOptional (ref_line, col, ref val); + ltb.CreateOptional (ref_line, col, ref val); return Token.CLOSE_PARENS; case ',': - LocatedToken.CreateOptional (ref_line, col, ref val); + ltb.CreateOptional (ref_line, col, ref val); return Token.COMMA; case ';': - LocatedToken.CreateOptional (ref_line, col, ref val); + ltb.CreateOptional (ref_line, col, ref val); return Token.SEMICOLON; case '~': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); return Token.TILDE; case '?': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); return TokenizePossibleNullableType (); case '<': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (parsing_generic_less_than++ > 0) return Token.OP_GENERICS_LT; return TokenizeLessThan (); case '>': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); d = peek_char (); if (d == '='){ @@ -3195,7 +3205,7 @@ namespace Mono.CSharp return Token.OP_GT; case '+': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); d = peek_char (); if (d == '+') { d = Token.OP_INC; @@ -3208,7 +3218,7 @@ namespace Mono.CSharp return d; case '-': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); d = peek_char (); if (d == '-') { d = Token.OP_DEC; @@ -3223,7 +3233,7 @@ namespace Mono.CSharp return d; case '!': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (peek_char () == '='){ get_char (); return Token.OP_NE; @@ -3231,7 +3241,7 @@ namespace Mono.CSharp return Token.BANG; case '=': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); d = peek_char (); if (d == '='){ get_char (); @@ -3245,7 +3255,7 @@ namespace Mono.CSharp return Token.ASSIGN; case '&': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); d = peek_char (); if (d == '&'){ get_char (); @@ -3258,7 +3268,7 @@ namespace Mono.CSharp return Token.BITWISE_AND; case '|': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); d = peek_char (); if (d == '|'){ get_char (); @@ -3271,7 +3281,7 @@ namespace Mono.CSharp return Token.BITWISE_OR; case '*': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (peek_char () == '='){ get_char (); return Token.OP_MULT_ASSIGN; @@ -3281,7 +3291,7 @@ namespace Mono.CSharp case '/': d = peek_char (); if (d == '='){ - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); get_char (); return Token.OP_DIV_ASSIGN; } @@ -3360,11 +3370,11 @@ namespace Mono.CSharp update_formatted_doc_comment (current_comment_start); continue; } - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); return Token.DIV; case '%': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (peek_char () == '='){ get_char (); return Token.OP_MOD_ASSIGN; @@ -3372,7 +3382,7 @@ namespace Mono.CSharp return Token.PERCENT; case '^': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (peek_char () == '='){ get_char (); return Token.OP_XOR_ASSIGN; @@ -3380,7 +3390,7 @@ namespace Mono.CSharp return Token.CARRET; case ':': - val = LocatedToken.Create (ref_line, col); + val = ltb.Create (ref_line, col); if (peek_char () == ':') { get_char (); return Token.DOUBLE_COLON; @@ -3404,7 +3414,7 @@ namespace Mono.CSharp if (d >= '0' && d <= '9') return is_number (c); - LocatedToken.CreateOptional (ref_line, col, ref val); + ltb.CreateOptional (ref_line, col, ref val); return Token.DOT; case '#': diff --git a/mcs/mcs/doc.cs b/mcs/mcs/doc.cs index e988178c434..631cc6991b5 100644 --- a/mcs/mcs/doc.cs +++ b/mcs/mcs/doc.cs @@ -47,6 +47,8 @@ namespace Mono.CSharp // Dictionary StoredDocuments = new Dictionary (); + ParserSession session; + public DocumentationBuilder (ModuleContainer module) { doc_module = new ModuleContainer (module.Compiler); @@ -324,12 +326,18 @@ namespace Mono.CSharp var encoding = module.Compiler.Settings.Encoding; var s = new MemoryStream (encoding.GetBytes (cref)); - SeekableStreamReader seekable = new SeekableStreamReader (s, encoding); var source_file = new CompilationSourceFile (doc_module); var report = new Report (doc_module.Compiler, new NullReportPrinter ()); - var parser = new CSharpParser (seekable, source_file, report); + if (session == null) + session = new ParserSession () { + UseJayGlobalArrays = true + }; + + SeekableStreamReader seekable = new SeekableStreamReader (s, encoding, session.StreamReaderBuffer); + + var parser = new CSharpParser (seekable, source_file, report, session); ParsedParameters = null; ParsedName = null; ParsedBuiltinType = null; diff --git a/mcs/mcs/driver.cs b/mcs/mcs/driver.cs index cd42b8974c6..18c904b3fca 100644 --- a/mcs/mcs/driver.cs +++ b/mcs/mcs/driver.cs @@ -41,7 +41,7 @@ namespace Mono.CSharp } } - void tokenize_file (SourceFile sourceFile, ModuleContainer module) + void tokenize_file (SourceFile sourceFile, ModuleContainer module, ParserSession session) { Stream input; @@ -56,7 +56,7 @@ namespace Mono.CSharp SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding); var file = new CompilationSourceFile (module, sourceFile); - Tokenizer lexer = new Tokenizer (reader, file); + Tokenizer lexer = new Tokenizer (reader, file, session); int token, tokens = 0, errors = 0; while ((token = lexer.token ()) != Token.EOF){ @@ -77,16 +77,21 @@ namespace Mono.CSharp Location.Initialize (sources); + var session = new ParserSession () { + UseJayGlobalArrays = true, + LocatedTokens = new Tokenizer.LocatedToken[15000] + }; + for (int i = 0; i < sources.Count; ++i) { if (tokenize_only) { - tokenize_file (sources[i], module); + tokenize_file (sources[i], module, session); } else { - Parse (sources[i], module); + Parse (sources[i], module, session); } } } - public void Parse (SourceFile file, ModuleContainer module) + public void Parse (SourceFile file, ModuleContainer module, ParserSession session) { Stream input; @@ -106,19 +111,26 @@ namespace Mono.CSharp } input.Position = 0; - SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding); + SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding, session.StreamReaderBuffer); + + Parse (reader, file, module, session); + + if (ctx.Settings.GenerateDebugInfo && ctx.Report.Errors == 0 && !file.HasChecksum) { + input.Position = 0; + var checksum = session.GetChecksumAlgorithm (); + file.SetChecksum (checksum.ComputeHash (input)); + } - Parse (reader, file, module); reader.Dispose (); input.Close (); } - public static void Parse (SeekableStreamReader reader, SourceFile sourceFile, ModuleContainer module) + public static void Parse (SeekableStreamReader reader, SourceFile sourceFile, ModuleContainer module, ParserSession session) { var file = new CompilationSourceFile (module, sourceFile); module.AddTypeContainer (file); - CSharpParser parser = new CSharpParser (reader, file); + CSharpParser parser = new CSharpParser (reader, file, session); parser.parse (); } @@ -344,7 +356,8 @@ namespace Mono.CSharp tr.Stop (TimeReporter.TimerType.CloseTypes); tr.Start (TimeReporter.TimerType.Resouces); - assembly.EmbedResources (); + if (!settings.WriteMetadataOnly) + assembly.EmbedResources (); tr.Stop (TimeReporter.TimerType.Resouces); if (Report.Errors > 0) diff --git a/mcs/mcs/dynamic.cs b/mcs/mcs/dynamic.cs index c9cea6927cd..b9d6967dccf 100644 --- a/mcs/mcs/dynamic.cs +++ b/mcs/mcs/dynamic.cs @@ -502,7 +502,7 @@ namespace Mono.CSharp using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) { if (s.Resolve (bc)) { - Statement init = new If (new Binary (Binary.Operator.Equality, site_field_expr, new NullLiteral (loc), loc), s, loc); + Statement init = new If (new Binary (Binary.Operator.Equality, site_field_expr, new NullLiteral (loc)), s, loc); init.Emit (ec); } diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index a7874f9a6a8..86918b1c7ad 100644 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -2969,7 +2969,7 @@ namespace Mono.CSharp { "An object reference is required to access non-static member `{0}'", GetSignatureForError ()); - InstanceExpression = new CompilerGeneratedThis (type, loc).Resolve (rc); + InstanceExpression = new CompilerGeneratedThis (rc.CurrentType, loc).Resolve (rc); return false; } @@ -3442,11 +3442,30 @@ namespace Mono.CSharp { best_candidate_return = best_candidate.ReturnType; } + // + // Additional check for possible imported base override method which + // could not be done during IsOverrideMethodBaseTypeAccessible + // + if (best_candidate.IsVirtual && (best_candidate.DeclaringType.Modifiers & Modifiers.PROTECTED) != 0 && + best_candidate.MemberDefinition.IsImported && !best_candidate.DeclaringType.IsAccessible (ec)) { + ec.Report.SymbolRelatedToPreviousError (best_candidate); + ErrorIsInaccesible (ec, best_candidate.GetSignatureForError (), loc); + } + return this; } public override MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original) { + var fe = left as FieldExpr; + if (fe != null) { + // + // Using method-group on struct fields makes the struct assigned. I am not sure + // why but that's what .net does + // + fe.Spec.MemberDefinition.SetIsAssigned (); + } + simple_name = original; return base.ResolveMemberAccess (ec, left, original); } diff --git a/mcs/mcs/eval.cs b/mcs/mcs/eval.cs index 04ba4a8aedc..e2a6ff26427 100644 --- a/mcs/mcs/eval.cs +++ b/mcs/mcs/eval.cs @@ -116,9 +116,10 @@ namespace Mono.CSharp Location.Initialize (ctx.SourceFiles); + var parser_session = new ParserSession (); for (int i = 0; i < startup_files; ++i) { var sf = ctx.SourceFiles [i]; - d.Parse (sf, module); + d.Parse (sf, module, parser_session); } } @@ -445,7 +446,7 @@ namespace Mono.CSharp // InputKind ToplevelOrStatement (SeekableStreamReader seekable) { - Tokenizer tokenizer = new Tokenizer (seekable, source_file); + Tokenizer tokenizer = new Tokenizer (seekable, source_file, new ParserSession ()); int t = tokenizer.token (); switch (t){ @@ -574,7 +575,7 @@ namespace Mono.CSharp seekable.Position = 0; source_file.DeclarationFound = false; - CSharpParser parser = new CSharpParser (seekable, source_file); + CSharpParser parser = new CSharpParser (seekable, source_file, new ParserSession ()); if (kind == InputKind.StatementOrExpression){ parser.Lexer.putback_char = Tokenizer.EvalStatementParserCharacter; @@ -979,7 +980,9 @@ namespace Mono.CSharp static public string help { get { return "Static methods:\n" + +#if !NET_2_1 " Describe (object); - Describes the object's type\n" + +#endif " LoadPackage (package); - Loads the given Package (like -pkg:FILE)\n" + " LoadAssembly (assembly); - Loads the given assembly (like -r:ASSEMBLY)\n" + " ShowVars (); - Shows defined local variables.\n" + diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index e1cb5f19ac6..b4f68f05c3b 100644 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -1211,7 +1211,7 @@ namespace Mono.CSharp var one = new IntConstant (ec.BuiltinTypes, 1, loc); var op = IsDecrement ? Binary.Operator.Subtraction : Binary.Operator.Addition; - operation = new Binary (op, source, one, loc); + operation = new Binary (op, source, one); operation = operation.Resolve (ec); if (operation == null) throw new NotImplementedException ("should not be reached"); @@ -1527,7 +1527,7 @@ namespace Mono.CSharp // Turn is check into simple null check for implicitly convertible reference types // return ReducedExpression.Create ( - new Binary (Binary.Operator.Inequality, expr, new NullLiteral (loc), loc).Resolve (ec), + new Binary (Binary.Operator.Inequality, expr, new NullLiteral (loc)).Resolve (ec), this).Resolve (ec); } @@ -2014,7 +2014,7 @@ namespace Mono.CSharp // b = b.left >> b.right & (0x1f|0x3f) // b.right = new Binary (Operator.BitwiseAnd, - b.right, new IntConstant (ec.BuiltinTypes, right_mask, b.right.Location), b.loc).Resolve (ec); + b.right, new IntConstant (ec.BuiltinTypes, right_mask, b.right.Location)).Resolve (ec); // // Expression tree representation does not use & mask @@ -2202,19 +2202,19 @@ namespace Mono.CSharp protected State state; Expression enum_conversion; - public Binary (Operator oper, Expression left, Expression right, bool isCompound, Location loc) - : this (oper, left, right, loc) + public Binary (Operator oper, Expression left, Expression right, bool isCompound) + : this (oper, left, right) { if (isCompound) state |= State.Compound; } - public Binary (Operator oper, Expression left, Expression right, Location loc) + public Binary (Operator oper, Expression left, Expression right) { this.oper = oper; this.left = left; this.right = right; - this.loc = loc; + this.loc = left.Location; } #region Properties @@ -2319,7 +2319,7 @@ namespace Mono.CSharp public static void Error_OperatorCannotBeApplied (ResolveContext ec, Expression left, Expression right, Operator oper, Location loc) { - new Binary (oper, left, right, loc).Error_OperatorCannotBeApplied (ec, left, right); + new Binary (oper, left, right).Error_OperatorCannotBeApplied (ec, left, right); } public static void Error_OperatorCannotBeApplied (ResolveContext ec, Expression left, Expression right, string oper, Location loc) @@ -3031,7 +3031,7 @@ namespace Mono.CSharp (TypeSpec.IsValueType (left.Type) && right is NullLiteral) || (right.Type.IsNullableType && (left is NullLiteral || left.Type.IsNullableType || TypeSpec.IsValueType (left.Type))) || (TypeSpec.IsValueType (right.Type) && left is NullLiteral))) { - var lifted = new Nullable.LiftedBinaryOperator (oper, left, right, loc); + var lifted = new Nullable.LiftedBinaryOperator (oper, left, right); lifted.state = state; return lifted.Resolve (ec); } @@ -4409,7 +4409,7 @@ namespace Mono.CSharp // TODO: Should be the checks resolve context sensitive? ResolveContext rc = new ResolveContext (ec.MemberContext, ResolveContext.Options.UnsafeScope); - right = new Binary (Binary.Operator.Multiply, right, right_const, loc).Resolve (rc); + right = new Binary (Binary.Operator.Multiply, right, right_const).Resolve (rc); if (right == null) return; } @@ -5250,8 +5250,10 @@ namespace Mono.CSharp { this.expr = expr; this.arguments = arguments; - if (expr != null) - loc = expr.Location; + if (expr != null) { + var ma = expr as MemberAccess; + loc = ma != null ? ma.GetLeftExpressionLocation () : expr.Location; + } } #region Properties @@ -7896,6 +7898,18 @@ namespace Mono.CSharp expr.Error_OperatorCannotBeApplied (rc, loc, ".", type); } + public Location GetLeftExpressionLocation () + { + Expression expr = LeftExpression; + MemberAccess ma = expr as MemberAccess; + while (ma != null && ma.LeftExpression != null) { + expr = ma.LeftExpression; + ma = expr as MemberAccess; + } + + return expr == null ? Location : expr.Location; + } + public static bool IsValidDotExpression (TypeSpec type) { const MemberKind dot_kinds = MemberKind.Class | MemberKind.Struct | MemberKind.Delegate | MemberKind.Enum | @@ -9400,7 +9414,7 @@ namespace Mono.CSharp this.left = left; this.spec = spec; - this.loc = spec.Location; + this.loc = left.Location; } public override TypeSpec ResolveAsType (IMemberContext ec) diff --git a/mcs/mcs/field.cs b/mcs/mcs/field.cs index a311e0af0a0..46ca117aa42 100644 --- a/mcs/mcs/field.cs +++ b/mcs/mcs/field.cs @@ -636,13 +636,12 @@ namespace Mono.CSharp } if (initializer != null) { - Parent.RegisterFieldForInitialization (this, - new FieldInitializer (spec, initializer, this)); + Parent.RegisterFieldForInitialization (this, new FieldInitializer (this, initializer, TypeExpression.Location)); } if (declarators != null) { - var t = new TypeExpression (MemberType, TypeExpression.Location); foreach (var d in declarators) { + var t = new TypeExpression (MemberType, d.Name.Location); var f = new Field (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) f.initializer = d.Initializer; diff --git a/mcs/mcs/import.cs b/mcs/mcs/import.cs index da3e3d7c708..605db44fb53 100644 --- a/mcs/mcs/import.cs +++ b/mcs/mcs/import.cs @@ -90,7 +90,7 @@ namespace Mono.CSharp if (cad.Count > 0) { foreach (var ca in cad) { var dt = ca.Constructor.DeclaringType; - if (dt.Name != "DynamicAttribute" && dt.Namespace != CompilerServicesNamespace) + if (dt.Name != "DynamicAttribute" || dt.Namespace != CompilerServicesNamespace) continue; if (ca.ConstructorArguments.Count == 0) { @@ -390,18 +390,21 @@ namespace Mono.CSharp if ((mod & Modifiers.OVERRIDE) != 0) { bool is_real_override = false; if (kind == MemberKind.Method && declaringType.BaseType != null) { - var filter = MemberFilter.Method (name, tparams != null ? tparams.Length : 0, parameters, null); - var candidate = MemberCache.FindMember (declaringType.BaseType, filter, BindingRestriction.None); - - // - // For imported class method do additional validation to be sure that metadata - // override flag was correct - // - // Difference between protected internal and protected is ok - // - const Modifiers conflict_mask = Modifiers.AccessibilityMask & ~Modifiers.INTERNAL; - if (candidate != null && (candidate.Modifiers & conflict_mask) == (mod & conflict_mask) && !candidate.IsStatic) { - is_real_override = true; + var btype = declaringType.BaseType; + if (IsOverrideMethodBaseTypeAccessible (btype)) { + var filter = MemberFilter.Method (name, tparams != null ? tparams.Length : 0, parameters, null); + var candidate = MemberCache.FindMember (btype, filter, BindingRestriction.None); + + // + // For imported class method do additional validation to be sure that metadata + // override flag was correct + // + // Difference between protected internal and protected is ok + // + const Modifiers conflict_mask = Modifiers.AccessibilityMask & ~Modifiers.INTERNAL; + if (candidate != null && (candidate.Modifiers & conflict_mask) == (mod & conflict_mask) && !candidate.IsStatic) { + is_real_override = true; + } } } @@ -434,6 +437,30 @@ namespace Mono.CSharp return ms; } + bool IsOverrideMethodBaseTypeAccessible (TypeSpec baseType) + { + switch (baseType.Modifiers & Modifiers.AccessibilityMask) { + case Modifiers.PUBLIC: + return true; + case Modifiers.INTERNAL: + // + // Check whether imported method in base type is accessible from compiled + // context + // + return baseType.MemberDefinition.IsInternalAsPublic (module.DeclaringAssembly); + case Modifiers.PRIVATE: + return false; + default: + // protected + // protected internal + // + // Method accessibility checks will be done later based on context + // where the method is called (CS0122 error will be reported for inaccessible) + // + return true; + } + } + // // Imports System.Reflection parameters // diff --git a/mcs/mcs/iterators.cs b/mcs/mcs/iterators.cs index 986445ad70a..9334ec1e6b2 100644 --- a/mcs/mcs/iterators.cs +++ b/mcs/mcs/iterators.cs @@ -972,7 +972,9 @@ namespace Mono.CSharp method.Block.IsCompilerGenerated = true; method.Block.AddStatement (new TryFinallyBlockProxyStatement (this, block)); - storey.AddMember (method); + // Cannot it add to storey because it'd be emitted before nested + // anonoymous methods which could capture shared variable + return method; } diff --git a/mcs/mcs/location.cs b/mcs/mcs/location.cs index a6ae554ac05..d513a296c20 100644 --- a/mcs/mcs/location.cs +++ b/mcs/mcs/location.cs @@ -52,13 +52,15 @@ namespace Mono.CSharp } } + static readonly byte[] MD5Algorith = { 96, 166, 110, 64, 207, 100, 130, 76, 182, 240, 66, 212, 129, 114, 167, 153 }; + public readonly string Name; public readonly string FullPathName; public readonly int Index; public bool AutoGenerated; SourceFileEntry file; - byte[] guid, checksum; + byte[] algGuid, checksum; List hidden_lines; public SourceFile (string name, string path, int index) @@ -68,15 +70,32 @@ namespace Mono.CSharp this.FullPathName = path; } + public byte[] Checksum { + get { + return checksum; + } + } + + public bool HasChecksum { + get { + return checksum != null; + } + } + public SourceFileEntry SourceFileEntry { get { return file; } } - public void SetChecksum (byte[] guid, byte[] checksum) + public void SetChecksum (byte[] checksum) + { + SetChecksum (MD5Algorith, checksum); + } + + public void SetChecksum (byte[] algorithmGuid, byte[] checksum) { - this.guid = guid; + this.algGuid = algorithmGuid; this.checksum = checksum; } @@ -85,13 +104,9 @@ namespace Mono.CSharp if (hidden_lines != null) hidden_lines.Sort (); - if (guid != null) { - file = new SourceFileEntry (symwriter, FullPathName, guid, checksum); - } else { - file = new SourceFileEntry (symwriter, FullPathName); - if (AutoGenerated) - file.SetAutoGenerated (); - } + file = new SourceFileEntry (symwriter, FullPathName, algGuid, checksum); + if (AutoGenerated) + file.SetAutoGenerated (); return file; } diff --git a/mcs/mcs/mcs.csproj b/mcs/mcs/mcs.csproj index e4bf026a3d6..5c99299ebe5 100644 --- a/mcs/mcs/mcs.csproj +++ b/mcs/mcs/mcs.csproj @@ -173,9 +173,6 @@ false - - false - false diff --git a/mcs/mcs/mcs.exe.sources b/mcs/mcs/mcs.exe.sources index 3a01e0cadd9..7acf63aeff2 100644 --- a/mcs/mcs/mcs.exe.sources +++ b/mcs/mcs/mcs.exe.sources @@ -62,6 +62,5 @@ visit.cs ../class/IKVM.Reflection/Metadata/*.cs ../class/IKVM.Reflection/Reader/*.cs ../class/IKVM.Reflection/Writer/*.cs -../class/IKVM.Reflection/Impl/CryptoHack.cs ../class/IKVM.Reflection/Impl/ITypeOwner.cs ../class/IKVM.Reflection/Impl/SymbolSupport.cs diff --git a/mcs/mcs/membercache.cs b/mcs/mcs/membercache.cs index 5374da9db9a..9ff3168869e 100644 --- a/mcs/mcs/membercache.cs +++ b/mcs/mcs/membercache.cs @@ -435,12 +435,15 @@ namespace Mono.CSharp { // A special method to work with member lookup only. It returns a list of all members named @name // starting from @container. It's very performance sensitive // - public static IList FindMembers (TypeSpec container, string name, bool declaredOnly) + // declaredOnlyClass cannot be used interfaces. Manual filtering is required because names are + // compacted + // + public static IList FindMembers (TypeSpec container, string name, bool declaredOnlyClass) { IList applicable; do { - if (container.MemberCache.member_hash.TryGetValue (name, out applicable) || declaredOnly) + if (container.MemberCache.member_hash.TryGetValue (name, out applicable) || declaredOnlyClass) return applicable; container = container.BaseType; diff --git a/mcs/mcs/method.cs b/mcs/mcs/method.cs index 21d46f80bc0..8c96171696e 100644 --- a/mcs/mcs/method.cs +++ b/mcs/mcs/method.cs @@ -1213,6 +1213,9 @@ namespace Mono.CSharp { block = (ToplevelBlock) block.ConvertToAsyncTask (this, Parent.PartialContainer, parameters, ReturnType, Location); ModFlags |= Modifiers.DEBUGGER_HIDDEN; } + + if (Compiler.Settings.WriteMetadataOnly) + block = null; } if ((ModFlags & Modifiers.STATIC) == 0) @@ -1301,10 +1304,18 @@ namespace Mono.CSharp { } } - base.Emit (); - + if (block != null && block.StateMachine != null) { + var psm = block.StateMachine is IteratorStorey ? + Module.PredefinedAttributes.IteratorStateMachine : + Module.PredefinedAttributes.AsyncStateMachine; + + psm.EmitAttribute (MethodBuilder, block.StateMachine); + } + if ((ModFlags & Modifiers.METHOD_EXTENSION) != 0) Module.PredefinedAttributes.Extension.EmitAttribute (MethodBuilder); + + base.Emit (); } catch { Console.WriteLine ("Internal compiler error at {0}: exception caught while emitting {1}", Location, MethodBuilder); @@ -1432,7 +1443,7 @@ namespace Mono.CSharp { base_ctor = ConstructorLookup (ec, type, ref argument_list, loc); } - if (base_ctor.MemberDefinition == caller_builder.Spec.MemberDefinition) { + if (base_ctor != null && base_ctor.MemberDefinition == caller_builder.Spec.MemberDefinition) { ec.Report.Error (516, loc, "Constructor `{0}' cannot call itself", caller_builder.GetSignatureForError ()); } @@ -1617,10 +1628,15 @@ namespace Mono.CSharp { Parent.MemberCache.AddMember (spec); - // It's here only to report an error - if (block != null && block.IsIterator) { - member_type = Compiler.BuiltinTypes.Void; - Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags); + if (block != null) { + // It's here only to report an error + if (block.IsIterator) { + member_type = Compiler.BuiltinTypes.Void; + Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags); + } + + if (Compiler.Settings.WriteMetadataOnly) + block = null; } return true; @@ -1656,14 +1672,14 @@ namespace Mono.CSharp { BlockContext bc = new BlockContext (this, block, Compiler.BuiltinTypes.Void); bc.Set (ResolveContext.Options.ConstructorScope); - // - // If we use a "this (...)" constructor initializer, then - // do not emit field initializers, they are initialized in the other constructor - // - if (!(Initializer is ConstructorThisInitializer)) - Parent.PartialContainer.ResolveFieldInitializers (bc); - if (block != null) { + // + // If we use a "this (...)" constructor initializer, then + // do not emit field initializers, they are initialized in the other constructor + // + if (!(Initializer is ConstructorThisInitializer)) + Parent.PartialContainer.ResolveFieldInitializers (bc); + if (!IsStatic) { if (Initializer == null) { if (Parent.PartialContainer.Kind == MemberKind.Struct) { @@ -1964,7 +1980,7 @@ namespace Mono.CSharp { // if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) { implementing = null; - } else if (optional && (container.Interfaces == null || Array.IndexOf (container.Interfaces, implementing.DeclaringType) < 0)) { + } else if (optional && (container.Interfaces == null || !container.Definition.Interfaces.Contains (implementing.DeclaringType))) { // // We are not implementing interface when base class already implemented it // @@ -2150,6 +2166,16 @@ namespace Mono.CSharp { return true; } + public override bool Define () + { + base.Define (); + + if (Compiler.Settings.WriteMetadataOnly) + block = null; + + return true; + } + public override void Emit() { var base_type = Parent.PartialContainer.BaseType; @@ -2513,13 +2539,18 @@ namespace Mono.CSharp { if (!base.Define ()) return false; - if (block != null && block.IsIterator) { - // - // Current method is turned into automatically generated - // wrapper which creates an instance of iterator - // - Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags); - ModFlags |= Modifiers.DEBUGGER_HIDDEN; + if (block != null) { + if (block.IsIterator) { + // + // Current method is turned into automatically generated + // wrapper which creates an instance of iterator + // + Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags); + ModFlags |= Modifiers.DEBUGGER_HIDDEN; + } + + if (Compiler.Settings.WriteMetadataOnly) + block = null; } // imlicit and explicit operator of same types are not allowed diff --git a/mcs/mcs/module.cs b/mcs/mcs/module.cs index 3117053fcf9..bf36e8f20e4 100644 --- a/mcs/mcs/module.cs +++ b/mcs/mcs/module.cs @@ -429,7 +429,7 @@ namespace Mono.CSharp base.EmitContainer (); - if (Compiler.Report.Errors == 0) + if (Compiler.Report.Errors == 0 && !Compiler.Settings.WriteMetadataOnly) VerifyMembers (); if (anonymous_types != null) { diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs index c26fc0a3c87..7004013267c 100644 --- a/mcs/mcs/namespace.cs +++ b/mcs/mcs/namespace.cs @@ -1180,11 +1180,23 @@ namespace Mono.CSharp { entry.Define (this); + // + // It's needed for repl only, when using clause cannot be resolved don't hold it in + // global list which is resolved for each evaluation + // + if (entry.ResolvedExpression == null) { + clauses.RemoveAt (i--); + continue; + } + Namespace using_ns = entry.ResolvedExpression as Namespace; if (using_ns == null) continue; if (list.Contains (using_ns)) { + // Ensure we don't report the warning multiple times in repl + clauses.RemoveAt (i--); + Compiler.Report.Warning (105, 3, entry.Location, "The using directive for `{0}' appeared previously in this namespace", using_ns.GetSignatureForError ()); } else { diff --git a/mcs/mcs/nullable.cs b/mcs/mcs/nullable.cs index 9397486a336..0c370b1f3a4 100644 --- a/mcs/mcs/nullable.cs +++ b/mcs/mcs/nullable.cs @@ -539,8 +539,8 @@ namespace Mono.CSharp.Nullable Expression user_operator; MethodSpec wrap_ctor; - public LiftedBinaryOperator (Binary.Operator op, Expression left, Expression right, Location loc) - : base (op, left, right, loc) + public LiftedBinaryOperator (Binary.Operator op, Expression left, Expression right) + : base (op, left, right) { } @@ -1001,11 +1001,11 @@ namespace Mono.CSharp.Nullable Expression left, right; Unwrap unwrap; - public NullCoalescingOperator (Expression left, Expression right, Location loc) + public NullCoalescingOperator (Expression left, Expression right) { this.left = left; this.right = right; - this.loc = loc; + this.loc = left.Location; } public Expression LeftExpression { diff --git a/mcs/mcs/property.cs b/mcs/mcs/property.cs index c74b12739bf..325b8f118f4 100644 --- a/mcs/mcs/property.cs +++ b/mcs/mcs/property.cs @@ -362,8 +362,13 @@ namespace Mono.CSharp CheckAbstractAndExtern (block != null); CheckProtectedModifier (); - if (block != null && block.IsIterator) - Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags); + if (block != null) { + if (block.IsIterator) + Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags); + + if (Compiler.Settings.WriteMetadataOnly) + block = null; + } return null; } @@ -906,7 +911,7 @@ namespace Mono.CSharp public override void Emit (TypeDefinition parent) { - if ((method.ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0) { + if ((method.ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 && !Compiler.Settings.WriteMetadataOnly) { block = new ToplevelBlock (Compiler, ParameterInfo, Location) { IsCompilerGenerated = true }; @@ -938,11 +943,10 @@ namespace Mono.CSharp var cond = new BooleanExpression (new Binary (Binary.Operator.Inequality, new Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj1, Location), Location), - new Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj2, Location), Location), - Location)); + new Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj2, Location), Location))); var body = new ExplicitBlock (block, Location, Location); - block.AddStatement (new Do (body, cond, Location)); + block.AddStatement (new Do (body, cond, Location, Location)); body.AddStatement (new StatementExpression ( new SimpleAssign (new LocalVariableReference (obj2, Location), new LocalVariableReference (obj1, Location)))); @@ -1194,6 +1198,9 @@ namespace Mono.CSharp if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) return null; + if (Compiler.Settings.WriteMetadataOnly) + block = null; + MethodBuilder mb = method_data.MethodBuilder; Spec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, mb, ParameterInfo, method.ModFlags); diff --git a/mcs/mcs/repl.txt b/mcs/mcs/repl.txt index 4f71772f6c9..ed3fe9bf48a 100644 --- a/mcs/mcs/repl.txt +++ b/mcs/mcs/repl.txt @@ -38,123 +38,10 @@ Documentation for the REPL mode for MCS can be found here: It currently has a few problems: - * Support for overwritting existing defined - classes is not supported. - * The usability is not as useful, since the defaults for C# are still to make members private, we should change this default to be public in those cases. - * The error lookup system lacks information from types, for - example this causes an unsupported call into a TypeBuilder: - - csharp>class D { void DD () {} } - csharp>var d = new D (); - csharp>d.DD (); - - Internal compiler error at Internal(1,1):: exception caught while emitting MethodBuilder [Class0::Host] - System.NotSupportedException: The invoked member is not supported in a dynamic module. - at System.Reflection.Emit.AssemblyBuilder.get_Location () [0x00000] in :0 - at Mono.CSharp.Report.SymbolRelatedToPreviousError (System.Reflection.MemberInfo mi) [0x00000] in - at Mono.CSharp.MethodGroupExpr.NoExactMatch (Mono.CSharp.ResolveContext ec, - Mono.CSharp.Arguments& Arguments, IDictionary`2 c - - - The above is caused by TypeManager.LookupDeclSpace (dt) - failing to return a value (it returns null) so our code - assumes we have an Assembly instead of an assemblybuilder. - - - -* Declaring a class twice produces an internal parse error: - - class X {} - class X {} - - The second declaration will no longer be parsed, so it could even - contain junk, and wont be flagged. We probably need to allow for - type redefinition in REPL modes, the exception from the second is: - - csharp -v -v - > class X {} - > class X {} - - System.ArgumentException: An element with the same key already exists in the dictionary. - at System.Collections.Generic.Dictionary`2[System.String,Mono.CSharp.DeclSpace].Add (System.String key, Mono.CSharp.DeclSpace value) [0x00000] in :0 - at Mono.CSharp.Namespace.AddDeclSpace (System.String name, Mono.CSharp.DeclSpace ds) [0x00000] in :0 - at Mono.CSharp.ModuleCompiled.AddMemberType (Mono.CSharp.DeclSpace ds) [0x00000] in :0 - at Mono.CSharp.TypeContainer.AddTypeContainer (Mono.CSharp.TypeContainer tc) [0x00000] in :0 - at Mono.CSharp.CSharpParser.push_current_class (Mono.CSharp.TypeContainer tc, System.Object partial_token) [0x00000] in :0 - at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] in :0 - at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex, System.Object yyd) [0x00000] in :0 - at Mono.CSharp.CSharpParser.parse () [0x00000] in :0 - -* Mix statements with other top-level declarations. - -csharp> class Y {static void Main () {Console.WriteLine ("Foo"); }} -csharp> typeof (Y); -Y -csharp> Y.Main (); -Exception caught by the compiler while compiling: - Block that caused the problem begin at: Internal(1,1): - Block being compiled: [(1,2):,(1,11):] -System.NotSupportedException: The invoked member is not supported in a dynamic module. -Internal compiler error at Internal(1,1):: exception caught while emitting MethodBuilder [Class2::Host] -System.NotSupportedException: The invoked member is not supported in a dynamic module. - at System.Reflection.Emit.AssemblyBuilder.get_Location () [0x00000] in /second/home/cvs/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs:214 - at Mono.CSharp.Report.SymbolRelatedToPreviousError (System.Reflection.MemberInfo mi) [0x00036] in /second/home/cvs/mcs/mcs/report.cs:664 - at Mono.CSharp.Expression.Error_MemberLookupFailed (System.Type container_type, System.Type qualifier_type, System.Type queried_type, System.String name, System.String class_name, MemberTypes mt, BindingFlags bf) [0x00121] in /second/home/cvs/mcs/mcs/ecore.cs:857 - at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression right_side) [0x00230] in /second/home/cvs/mcs/mcs/expression.cs:7426 - at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/expression.cs:7494 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479 - at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x0000d] in /second/home/cvs/mcs/mcs/expression.cs:4725 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506 - at Mono.CSharp.OptionalAssign.DoResolve (Mono.CSharp.EmitContext ec) [0x00013] in /second/home/cvs/mcs/mcs/repl.cs:681 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506 - at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:1307 - at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec) [0x0000b] in /second/home/cvs/mcs/mcs/statement.cs:743 - at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x000f0] in /second/home/cvs/mcs/mcs/statement.cs:2254 - at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/statement.cs:2550 - at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable) [0x00087] in /second/home/cvs/mcs/mcs/codegen.cs:796 -csharp> - -* Another one: - -csharp> class X { X (){ Console.WriteLine ("Called"); } } -csharp> new X (); -Exception caught by the compiler while compiling: - Block that caused the problem begin at: Internal(1,1): - Block being compiled: [(1,2):,(1,10):] -System.NotSupportedException: The invoked member is not supported in a dynamic module. -Internal compiler error at Internal(1,1):: exception caught while emitting MethodBuilder [Class0::Host] -System.NotSupportedException: The invoked member is not supported in a dynamic module. - at System.Reflection.Emit.AssemblyBuilder.get_Location () [0x00000] in /second/home/cvs/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs:214 - at Mono.CSharp.Report.SymbolRelatedToPreviousError (System.Reflection.MemberInfo mi) [0x00036] in /second/home/cvs/mcs/mcs/report.cs:664 - at Mono.CSharp.Expression.Error_MemberLookupFailed (System.Type container_type, System.Type qualifier_type, System.Type queried_type, System.String name, System.String class_name, MemberTypes mt, BindingFlags bf) [0x00121] in /second/home/cvs/mcs/mcs/ecore.cs:857 - at Mono.CSharp.Expression.MemberLookupFinal (Mono.CSharp.EmitContext ec, System.Type qualifier_type, System.Type queried_type, System.String name, MemberTypes mt, BindingFlags bf, Location loc) [0x0002f] in /second/home/cvs/mcs/mcs/ecore.cs:804 - at Mono.CSharp.New.DoResolve (Mono.CSharp.EmitContext ec) [0x002ad] in /second/home/cvs/mcs/mcs/expression.cs:5486 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506 - at Mono.CSharp.OptionalAssign.DoResolve (Mono.CSharp.EmitContext ec) [0x00013] in /second/home/cvs/mcs/mcs/repl.cs:687 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479 - at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506 - at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:1307 - at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec) [0x0000b] in /second/home/cvs/mcs/mcs/statement.cs:743 - at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x000f0] in /second/home/cvs/mcs/mcs/statement.cs:2254 - at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/statement.cs:2550 - at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable) [0x00087] in /second/home/cvs/mcs/mcs/codegen.cs:796 -csharp> - -* Important: we need to replace TypeBuidlers with Types after things - have been emitted, or stuff like this happens: - -csharp> public class y {} -csharp> typeof (y); -Class1 - - * Clearing data TODO: when clearing data for variables that have been overwritten @@ -166,3 +53,18 @@ Class1 This is easy to implement, just retry the parse with a semicolon, the question is whether this is a good idea to do in the first place or not. + +Completion support +================== + + Supported: + + a. to complete members of type `a' + a for types and namespaces + a.W + a for local variables + + Unsupported: + + delegate { FOO. + using statement autocompletion diff --git a/mcs/mcs/report.cs b/mcs/mcs/report.cs index f1b5ec65f59..b27b9c8a08e 100644 --- a/mcs/mcs/report.cs +++ b/mcs/mcs/report.cs @@ -49,7 +49,7 @@ namespace Mono.CSharp { 809, 824, 1030, 1058, 1060, 1066, 1522, 1570, 1571, 1572, 1573, 1574, 1580, 1581, 1584, 1587, 1589, 1590, 1591, 1592, - 1607, 1616, 1633, 1634, 1635, 1685, 1690, 1691, 1692, 1695, 1696, 1699, + 1607, 1616, 1633, 1634, 1635, 1685, 1690, 1691, 1692, 1695, 1696, 1697, 1699, 1700, 1701, 1702, 1709, 1711, 1717, 1718, 1720, 1735, 1901, 1956, 1981, 1998, 2002, 2023, 2029, @@ -170,12 +170,6 @@ namespace Mono.CSharp { extra_information.Add (msg); } - public bool CheckWarningCode (string code, Location loc) - { - Warning (1691, 1, loc, "`{0}' is not a valid warning number", code); - return false; - } - public bool CheckWarningCode (int code, Location loc) { if (AllWarningsHashSet == null) @@ -184,7 +178,8 @@ namespace Mono.CSharp { if (AllWarningsHashSet.Contains (code)) return true; - return CheckWarningCode (code.ToString (), loc); + Warning (1691, 1, loc, "`{0}' is not a valid warning number", code); + return false; } public void ExtraInformation (Location loc, string msg) diff --git a/mcs/mcs/settings.cs b/mcs/mcs/settings.cs index 1de9b4e9890..1556b5ca5fa 100644 --- a/mcs/mcs/settings.cs +++ b/mcs/mcs/settings.cs @@ -159,6 +159,8 @@ namespace Mono.CSharp { public RuntimeVersion StdLibRuntimeVersion; + public bool WriteMetadataOnly; + readonly List conditional_symbols; readonly List source_files; @@ -180,10 +182,8 @@ namespace Mono.CSharp { StdLibRuntimeVersion = RuntimeVersion.v4; WarningLevel = 4; - if (Environment.OSVersion.Platform == PlatformID.Win32NT) - TabSize = 4; - else - TabSize = 8; + // Default to 1 or mdb files would be platform speficic + TabSize = 1; AssemblyReferences = new List (); AssemblyReferencesAliases = new List> (); @@ -565,36 +565,22 @@ namespace Mono.CSharp { source_file_index.Add (path, unit.Index); } - void AddWarningAsError (string warningId, CompilerSettings settings) + public bool ProcessWarningsList (string text, Action action) { - int id; - try { - id = int.Parse (warningId); - } catch { - report.CheckWarningCode (warningId, Location.Null); - return; - } - - if (!report.CheckWarningCode (id, Location.Null)) - return; - - settings.AddWarningAsError (id); - } + bool valid = true; + foreach (string wid in text.Split (numeric_value_separator)) { + int id; + if (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) { + report.Error (1904, "`{0}' is not a valid warning number", wid); + valid = false; + continue; + } - void RemoveWarningAsError (string warningId, CompilerSettings settings) - { - int id; - try { - id = int.Parse (warningId); - } catch { - report.CheckWarningCode (warningId, Location.Null); - return; + if (report.CheckWarningCode (id, Location.Null)) + action (id); } - if (!report.CheckWarningCode (id, Location.Null)) - return; - - settings.AddWarningOnly (id); + return valid; } void Error_RequiresArgument (string option) @@ -684,8 +670,9 @@ namespace Mono.CSharp { { output.WriteLine ( "Other flags in the compiler\n" + - " --fatal[=COUNT] Makes errors after COUNT fatal\n" + + " --fatal[=COUNT] Makes error after COUNT fatal\n" + " --lint Enhanced warnings\n" + + " --metadata-only Produced assembly will contain metadata only\n" + " --parse Only parses the source file\n" + " --runtime:VERSION Sets mscorlib.dll metadata version: v1, v2, v4\n" + " --stacktrace Shows stack trace at error location\n" + @@ -947,7 +934,7 @@ namespace Mono.CSharp { return ParseResult.Success; case "/debug": - if (value == "full" || value == "pdbonly" || idx < 0) { + if (value.Equals ("full", StringComparison.OrdinalIgnoreCase) || value.Equals ("pdbonly", StringComparison.OrdinalIgnoreCase) || idx < 0) { settings.GenerateDebugInfo = true; return ParseResult.Success; } @@ -997,8 +984,8 @@ namespace Mono.CSharp { settings.WarningsAreErrors = true; parser_settings.WarningsAreErrors = true; } else { - foreach (string wid in value.Split (numeric_value_separator)) - AddWarningAsError (wid, settings); + if (!ProcessWarningsList (value, v => settings.AddWarningAsError (v))) + return ParseResult.Error; } return ParseResult.Success; @@ -1006,12 +993,13 @@ namespace Mono.CSharp { if (value.Length == 0) { settings.WarningsAreErrors = false; } else { - foreach (string wid in value.Split (numeric_value_separator)) - RemoveWarningAsError (wid, settings); + if (!ProcessWarningsList (value, v => settings.AddWarningOnly (v))) + return ParseResult.Error; } return ParseResult.Success; case "/warn": + case "/w": if (value.Length == 0) { Error_RequiresArgument (option); return ParseResult.Error; @@ -1021,28 +1009,15 @@ namespace Mono.CSharp { return ParseResult.Success; case "/nowarn": - if (value.Length == 0) { - Error_RequiresArgument (option); - return ParseResult.Error; - } + if (value.Length == 0) { + Error_RequiresArgument (option); + return ParseResult.Error; + } - var warns = value.Split (numeric_value_separator); - foreach (string wc in warns) { - try { - if (wc.Trim ().Length == 0) - continue; + if (!ProcessWarningsList (value, v => settings.SetIgnoreWarning (v))) + return ParseResult.Error; - int warn = Int32.Parse (wc); - if (warn < 1) { - throw new ArgumentOutOfRangeException ("warn"); - } - settings.SetIgnoreWarning (warn); - } catch { - report.Error (1904, "`{0}' is not a valid warning number", wc); - return ParseResult.Error; - } - } - return ParseResult.Success; + return ParseResult.Success; case "/noconfig": settings.LoadDefaultReferences = false; @@ -1451,6 +1426,10 @@ namespace Mono.CSharp { settings.LoadDefaultReferences = false; return ParseResult.Success; + case "--metadata-only": + settings.WriteMetadataOnly = true; + return ParseResult.Success; + default: if (arg.StartsWith ("--fatal", StringComparison.Ordinal)){ int fatal = 1; diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs index ae11782edbd..7dcde8d8be3 100644 --- a/mcs/mcs/statement.cs +++ b/mcs/mcs/statement.cs @@ -281,11 +281,16 @@ namespace Mono.CSharp { public Expression expr; public Statement EmbeddedStatement; - public Do (Statement statement, BooleanExpression bool_expr, Location l) + public Do (Statement statement, BooleanExpression bool_expr, Location doLocation, Location whileLocation) { expr = bool_expr; EmbeddedStatement = statement; - loc = l; + loc = doLocation; + WhileLocation = whileLocation; + } + + public Location WhileLocation { + get; private set; } public override bool Resolve (BlockContext ec) @@ -332,7 +337,7 @@ namespace Mono.CSharp { ec.MarkLabel (ec.LoopBegin); // Mark start of while condition - ec.Mark (expr.Location); + ec.Mark (WhileLocation); // // Dead code elimination @@ -461,7 +466,7 @@ namespace Mono.CSharp { ec.MarkLabel (ec.LoopBegin); - ec.Mark (expr.Location); + ec.Mark (loc); expr.EmitBranchable (ec, while_loop, true); ec.MarkLabel (ec.LoopEnd); @@ -878,7 +883,6 @@ namespace Mono.CSharp { return true; } - // TODO: Better error message if (async_type.Kind == MemberKind.Void) { ec.Report.Error (127, loc, "`{0}': A return keyword must not be followed by any expression when method returns void", @@ -909,6 +913,15 @@ namespace Mono.CSharp { } } } else { + // Same error code as .NET but better error message + if (block_return_type.Kind == MemberKind.Void) { + ec.Report.Error (127, loc, + "`{0}': A return keyword must not be followed by any expression when delegate returns void", + am.GetSignatureForError ()); + + return false; + } + var l = am as AnonymousMethodBody; if (l != null && l.ReturnTypeInference != null && expr != null) { l.ReturnTypeInference.AddCommonTypeBound (expr.Type); @@ -1620,8 +1633,10 @@ namespace Mono.CSharp { if (declarators != null) { foreach (var d in declarators) { d.Variable.CreateBuilder (ec); - if (d.Initializer != null) + if (d.Initializer != null) { + ec.Mark (d.Variable.Location); ((ExpressionStatement) d.Initializer).EmitStatement (ec); + } } } } @@ -4236,10 +4251,10 @@ namespace Mono.CSharp { Expression cond = null; for (int ci = 0; ci < s.Labels.Count; ++ci) { - var e = new Binary (Binary.Operator.Equality, value, s.Labels[ci].Converted, loc); + var e = new Binary (Binary.Operator.Equality, value, s.Labels[ci].Converted); if (ci > 0) { - cond = new Binary (Binary.Operator.LogicalOr, cond, e, loc); + cond = new Binary (Binary.Operator.LogicalOr, cond, e); } else { cond = e; } @@ -4529,6 +4544,12 @@ namespace Mono.CSharp { ec.MarkLabel (start_finally); if (finally_host != null) { + finally_host.Define (); + finally_host.Emit (); + + // Now it's safe to add, to close it properly and emit sequence points + finally_host.Parent.AddMember (finally_host); + var ce = new CallEmitter (); ce.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc); ce.EmitPredefined (ec, finally_host.Spec, new Arguments (0)); @@ -4743,21 +4764,9 @@ namespace Mono.CSharp { locked = false; } - using (ec.Set (ResolveContext.Options.LockScope)) { - ec.StartFlowBranching (this); - Statement.Resolve (ec); - ec.EndFlowBranching (); - } - - if (lv != null) { - lv.IsLockedByStatement = locked; - } - - base.Resolve (ec); - // // Have to keep original lock value around to unlock same location - // in the case the original has changed or is null + // in the case of original value has changed or is null // expr_copy = TemporaryVariableReference.Create (ec.BuiltinTypes.Object, ec.CurrentBlock, loc); expr_copy.Resolve (ec); @@ -4770,6 +4779,18 @@ namespace Mono.CSharp { lock_taken.Resolve (ec); } + using (ec.Set (ResolveContext.Options.LockScope)) { + ec.StartFlowBranching (this); + Statement.Resolve (ec); + ec.EndFlowBranching (); + } + + if (lv != null) { + lv.IsLockedByStatement = locked; + } + + base.Resolve (ec); + return true; } @@ -5123,8 +5144,8 @@ namespace Mono.CSharp { // fixed (T* e_ptr = (e == null || e.Length == 0) ? null : converted [0]) // converted = new Conditional (new BooleanExpression (new Binary (Binary.Operator.LogicalOr, - new Binary (Binary.Operator.Equality, initializer, new NullLiteral (loc), loc), - new Binary (Binary.Operator.Equality, new MemberAccess (initializer, "Length"), new IntConstant (bc.BuiltinTypes, 0, loc), loc), loc)), + new Binary (Binary.Operator.Equality, initializer, new NullLiteral (loc)), + new Binary (Binary.Operator.Equality, new MemberAccess (initializer, "Length"), new IntConstant (bc.BuiltinTypes, 0, loc)))), new NullLiteral (loc), converted, loc); @@ -5682,7 +5703,7 @@ namespace Mono.CSharp { // Add conditional call when disposing possible null variable if (!type.IsStruct || type.IsNullableType) - dispose = new If (new Binary (Binary.Operator.Inequality, lvr, new NullLiteral (loc), loc), dispose, dispose.loc); + dispose = new If (new Binary (Binary.Operator.Inequality, lvr, new NullLiteral (loc)), dispose, dispose.loc); return dispose; } @@ -5696,7 +5717,7 @@ namespace Mono.CSharp { { for (int i = declarators.Count - 1; i >= 0; --i) { var d = declarators [i]; - var vd = new VariableDeclaration (d.Variable, type_expr.Location); + var vd = new VariableDeclaration (d.Variable, d.Variable.Location); vd.Initializer = d.Initializer; vd.IsNested = true; vd.dispose_call = CreateDisposeCall (bc, d.Variable); @@ -5932,7 +5953,7 @@ namespace Mono.CSharp { if (variable_ref == null) return false; - for_each.body.AddScopeStatement (new StatementExpression (new CompilerAssign (variable_ref, access, Location.Null), for_each.variable.Location)); + for_each.body.AddScopeStatement (new StatementExpression (new CompilerAssign (variable_ref, access, Location.Null), for_each.type.Location)); bool ok = true; @@ -6028,7 +6049,7 @@ namespace Mono.CSharp { var idisaposable_test = new Binary (Binary.Operator.Inequality, new CompilerAssign ( dispose_variable.CreateReferenceExpression (bc, loc), new As (lv.CreateReferenceExpression (bc, loc), new TypeExpression (dispose_variable.Type, loc), loc), - loc), new NullLiteral (loc), loc); + loc), new NullLiteral (loc)); var m = bc.Module.PredefinedMembers.IDisposableDispose.Resolve (loc); @@ -6243,7 +6264,7 @@ namespace Mono.CSharp { if (variable_ref == null) return false; - for_each.body.AddScopeStatement (new StatementExpression (new CompilerAssign (variable_ref, current_pe, Location.Null), variable.Location)); + for_each.body.AddScopeStatement (new StatementExpression (new CompilerAssign (variable_ref, current_pe, Location.Null), for_each.type.Location)); var init = new Invocation (get_enumerator_mg, null); diff --git a/mcs/mcs/support.cs b/mcs/mcs/support.cs index 35066a16faf..164709da3f5 100644 --- a/mcs/mcs/support.cs +++ b/mcs/mcs/support.cs @@ -136,21 +136,23 @@ namespace Mono.CSharp { /// public class SeekableStreamReader : IDisposable { + public const int DefaultReadAheadSize = 2048; + StreamReader reader; Stream stream; - static char[] buffer; + char[] buffer; int read_ahead_length; // the length of read buffer int buffer_start; // in chars int char_count; // count of filled characters in buffer[] int pos; // index into buffer[] - public SeekableStreamReader (Stream stream, Encoding encoding) + public SeekableStreamReader (Stream stream, Encoding encoding, char[] sharedBuffer = null) { this.stream = stream; + this.buffer = sharedBuffer; - const int default_read_ahead = 2048; - InitializeStream (default_read_ahead); + InitializeStream (DefaultReadAheadSize); reader = new StreamReader (stream, encoding, true); } diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs index 6eb3fc6e447..f836bd58602 100644 --- a/mcs/mcs/typemanager.cs +++ b/mcs/mcs/typemanager.cs @@ -340,6 +340,7 @@ namespace Mono.CSharp public readonly PredefinedMember AsyncVoidMethodBuilderSetStateMachine; public readonly PredefinedMember AsyncVoidMethodBuilderOnCompleted; public readonly PredefinedMember AsyncVoidMethodBuilderOnCompletedUnsafe; + public readonly PredefinedMember AsyncStateMachineAttributeCtor; public readonly PredefinedMember DebuggerBrowsableAttributeCtor; public readonly PredefinedMember DecimalCtor; public readonly PredefinedMember DecimalCtorInt; @@ -357,6 +358,7 @@ namespace Mono.CSharp public readonly PredefinedMember IEnumerableGetEnumerator; public readonly PredefinedMember InterlockedCompareExchange; public readonly PredefinedMember InterlockedCompareExchange_T; + public readonly PredefinedMember IteratorStateMachineAttributeCtor; public readonly PredefinedMember FixedBufferAttributeCtor; public readonly PredefinedMember MethodInfoGetMethodFromHandle; public readonly PredefinedMember MethodInfoGetMethodFromHandle2; @@ -549,6 +551,10 @@ namespace Mono.CSharp }, false), btypes.Void)); + AsyncStateMachineAttributeCtor = new PredefinedMember (module, atypes.AsyncStateMachine, + MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved ( + btypes.Type))); + DebuggerBrowsableAttributeCtor = new PredefinedMember (module, atypes.DebuggerBrowsable, MemberFilter.Constructor (null)); @@ -625,6 +631,10 @@ namespace Mono.CSharp }, false), null)); + IteratorStateMachineAttributeCtor = new PredefinedMember (module, atypes.IteratorStateMachine, + MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved ( + btypes.Type))); + MethodInfoGetMethodFromHandle = new PredefinedMember (module, types.MethodBase, "GetMethodFromHandle", MemberKind.Method, types.RuntimeMethodHandle); @@ -843,7 +853,7 @@ namespace Mono.CSharp } } - class PredefinedMember where T : MemberSpec + public class PredefinedMember where T : MemberSpec { readonly ModuleContainer module; T member; diff --git a/mcs/mcs/typespec.cs b/mcs/mcs/typespec.cs index 5df85f770f9..8337ce59b8d 100644 --- a/mcs/mcs/typespec.cs +++ b/mcs/mcs/typespec.cs @@ -23,6 +23,9 @@ using System.Reflection; namespace Mono.CSharp { + // + // Inflated or non-inflated representation of any type. + // public class TypeSpec : MemberSpec { protected MetaType info; @@ -306,6 +309,9 @@ namespace Mono.CSharp } } + // + // A cache of all type members (including nested types) + // public MemberCache MemberCache { get { if (cache == null || (state & StateFlags.PendingMemberCacheMembers) != 0) @@ -435,6 +441,9 @@ namespace Mono.CSharp return aua; } + // + // Return metadata information used during emit to describe the type + // public virtual MetaType GetMetaInfo () { return info; @@ -445,6 +454,9 @@ namespace Mono.CSharp return this; } + // + // Text representation of type used by documentation writer + // public override string GetSignatureForDocumentation () { StringBuilder sb = new StringBuilder (); @@ -651,6 +663,9 @@ namespace Mono.CSharp return new InflatedTypeSpec (inflator.Context, this, inflator.TypeInstance, targs); } + // + // Inflates current type using specific type arguments + // public InflatedTypeSpec MakeGenericType (IModuleContext context, TypeSpec[] targs) { if (targs.Length == 0 && !IsNested) @@ -753,6 +768,10 @@ namespace Mono.CSharp } } + // + // Special version used for types which must exist in corlib or + // the compiler cannot work + // public sealed class BuiltinTypeSpec : TypeSpec { public enum Type @@ -934,6 +953,9 @@ namespace Mono.CSharp } } + // + // Various type comparers used by compiler + // static class TypeSpecComparer { // @@ -1459,6 +1481,9 @@ namespace Mono.CSharp #endregion } + // + // Common base class for composite types + // public abstract class ElementTypeSpec : TypeSpec, ITypeDefinition { protected ElementTypeSpec (MemberKind kind, TypeSpec element, MetaType info) diff --git a/mcs/mcs/visit.cs b/mcs/mcs/visit.cs index 42ad3104a71..f7ea686a46b 100644 --- a/mcs/mcs/visit.cs +++ b/mcs/mcs/visit.cs @@ -11,6 +11,7 @@ // using System; +using System.Diagnostics; namespace Mono.CSharp { @@ -18,7 +19,7 @@ namespace Mono.CSharp { public virtual void Visit (MemberCore member) { - Console.WriteLine ("unknown member type: " + member.GetType ()); + Debug.Fail ("unknown member type: " + member.GetType ()); } void VisitTypeContainer (TypeContainer tc) @@ -131,7 +132,7 @@ namespace Mono.CSharp public virtual object Visit (Statement stmt) { - Console.WriteLine ("unknown statement:" + stmt); + Debug.Fail ("unknown statement:" + stmt); return null; } @@ -310,7 +311,7 @@ namespace Mono.CSharp public virtual object Visit (Expression expression) { - Console.WriteLine ("Visit unknown expression:" + expression); + Debug.Fail ("Visit unknown expression:" + expression); return null; } diff --git a/mcs/tests/gtest-iter-24.cs b/mcs/tests/gtest-iter-24.cs new file mode 100644 index 00000000000..3fee4f7bb64 --- /dev/null +++ b/mcs/tests/gtest-iter-24.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; + +public class B : IDisposable +{ + public void Dispose () + { + } + + public void DoSomething () + { + } +} + +public class C +{ + public static IEnumerable Test () + { + using (var b = new B ()) { + Action a = () => b.DoSomething (); + a (); + + yield return 1; + } + } + + public static int Main () + { + foreach (var e in Test ()) { + Console.WriteLine (e); + } + + return 0; + } +} diff --git a/mcs/tests/gtest-iter-25.cs b/mcs/tests/gtest-iter-25.cs new file mode 100644 index 00000000000..4d039a00ccd --- /dev/null +++ b/mcs/tests/gtest-iter-25.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + +namespace Test +{ + public static class Program + { + public static void Main () + { + foreach (var a in Test ()) + Test (); + } + + public static IEnumerable Test () + { + lock (new object ()) { + yield return null; + yield break; + } + } + } +} \ No newline at end of file diff --git a/mcs/tests/gtest-iter-26.cs b/mcs/tests/gtest-iter-26.cs new file mode 100644 index 00000000000..c86b9e8937d --- /dev/null +++ b/mcs/tests/gtest-iter-26.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace Test +{ + public static class Program + { + public static int Main () + { + var m = typeof (Program).GetMethod ("Test"); + var attr = m.GetCustomAttribute (); + if (attr == null) + return 1; + + if (attr.StateMachineType == null) + return 2; + + return 0; + } + + public static IEnumerable Test () + { + yield return null; + } + } +} diff --git a/mcs/tests/test-514.cs b/mcs/tests/test-514.cs index 70d1edd01f9..9ce875854eb 100644 --- a/mcs/tests/test-514.cs +++ b/mcs/tests/test-514.cs @@ -1,4 +1,4 @@ -// Compiler options: -warnaserror -warn:2 +// Compiler options: -warnaserror -w:2 using System; class X { diff --git a/mcs/tests/test-715-lib.cs b/mcs/tests/test-715-lib.cs index 8cb901a678a..e90cb70cba6 100644 --- a/mcs/tests/test-715-lib.cs +++ b/mcs/tests/test-715-lib.cs @@ -3,5 +3,6 @@ using System.Reflection; [assembly:AssemblyKeyFile("test-715.snk")] -[assembly:AssemblyKeyName("foo")] +// Have to install the container first but Mono's sn is broken +// [assembly:AssemblyKeyName("foo")] [assembly:AssemblyDelaySign(false)] diff --git a/mcs/tests/test-796.cs b/mcs/tests/test-796.cs index cba7b21db66..b77d98d7290 100644 --- a/mcs/tests/test-796.cs +++ b/mcs/tests/test-796.cs @@ -8,6 +8,17 @@ struct S { } +class C2 +{ + S s; + + void Foo () + { + Func f = s.ToString; + Console.WriteLine (f); + } +} + [Foo (Product = "Mono")] class Program { diff --git a/mcs/tests/test-797.cs b/mcs/tests/test-797.cs index 289289aeba3..ac160226afd 100644 --- a/mcs/tests/test-797.cs +++ b/mcs/tests/test-797.cs @@ -2,7 +2,7 @@ #pragma checksum "c:\foo\Pragma.txt" "{606ea660-14cf-cc82-b6f0-42d48170a799}" "AB" #pragma checksum "b.txt" "{ee1816fc-aa5e-4d10-8ff7-6f4963833f60}" "EE0BAA" -#pragma checksum "b.txt" "{ee1816fc-aa5e-4d10-8ff7-6f4963833f60}" "7F9B77ACAA31C1F80B3DA15F6E748916" +#pragma checksum "d.txt" "{ee1816fc-aa5e-4d10-8ff7-6f4963833f60}" "7F9B77ACAA31C1F80B3DA15F6E748916" #pragma checksum " " "{00000000-0000-0000-0000-000000000000}" "" // some comments class C diff --git a/mcs/tests/test-845.cs b/mcs/tests/test-845.cs new file mode 100644 index 00000000000..cab90047bc9 --- /dev/null +++ b/mcs/tests/test-845.cs @@ -0,0 +1,51 @@ +interface IA +{ +} + +interface IB +{ + int Foo (); + int Foo2 (); +} + +interface IC : IA, IB +{ +} + +class C1 : IA, IB +{ + public int Foo () + { + return 5; + } + + public int Foo2 () + { + return 55; + } +} + +class C2 : C1, IC +{ + public new int Foo () + { + return 2; + } + + public int Foo2 () + { + return 2; + } + + public static int Main () + { + IC ic = new C2 (); + if (ic.Foo () != 2) + return 1; + + if (ic.Foo2 () != 2) + return 2; + + return 0; + } +} \ No newline at end of file diff --git a/mcs/tests/test-846-lib.il b/mcs/tests/test-846-lib.il new file mode 100644 index 00000000000..ab720ac3c23 --- /dev/null +++ b/mcs/tests/test-846-lib.il @@ -0,0 +1,48 @@ +.assembly extern mscorlib +{ +} + +.assembly 'test-846-lib' +{ + .hash algorithm 0x00008004 +} + +.module 'test-846-lib.dll' + +.class private auto ansi beforefieldinit A + extends [mscorlib]System.Object +{ + .method public hidebysig newslot virtual + instance void Foo() cil managed + { + newobj instance void [mscorlib]System.ApplicationException::.ctor() + throw + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void [mscorlib]System.Object::.ctor() + ret + } + +} + +.class public auto ansi beforefieldinit B + extends A +{ + .method public hidebysig virtual instance void + Foo() cil managed + { + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void A::.ctor() + ret + } +} diff --git a/mcs/tests/test-846.cs b/mcs/tests/test-846.cs new file mode 100644 index 00000000000..ca5373124de --- /dev/null +++ b/mcs/tests/test-846.cs @@ -0,0 +1,10 @@ +// Compiler options: -r:test-846-lib.dll + +class Test +{ + public static int Main () + { + new B ().Foo (); + return 0; + } +} \ No newline at end of file diff --git a/mcs/tests/test-847.cs b/mcs/tests/test-847.cs new file mode 100644 index 00000000000..2f22c422499 --- /dev/null +++ b/mcs/tests/test-847.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +interface IA +{ + int this[int arg] { get; set; } +} + +interface I : IA +{ +} + +class C +{ + public static int Main () + { + var attrs = typeof (I).GetCustomAttributes (false); + + // No DefaultMemberAttribute needed + if (attrs.Length != 0) + return 1; + + return 0; + } +} \ No newline at end of file diff --git a/mcs/tests/test-async-32.cs b/mcs/tests/test-async-32.cs index 7c319926884..f0e3fc64870 100644 --- a/mcs/tests/test-async-32.cs +++ b/mcs/tests/test-async-32.cs @@ -52,16 +52,21 @@ class Program return 12; bool faulted = false; + bool has_exception = false; t = TestException().ContinueWith(l => { faulted = l.IsFaulted; + has_exception = l.Exception != null; // Has to observe it or will throw on shutdown }, TaskContinuationOptions.ExecuteSynchronously); if (!faulted) return 21; + + if (!has_exception) + return 22; if (t.Exception != null) - return 22; + return 23; Console.WriteLine("ok"); return 0; diff --git a/mcs/tests/test-async-35.cs b/mcs/tests/test-async-35.cs new file mode 100644 index 00000000000..5b0532e1706 --- /dev/null +++ b/mcs/tests/test-async-35.cs @@ -0,0 +1,35 @@ +using System; +using System.Reflection; +using System.Threading.Tasks; +using System.Runtime.CompilerServices; +using System.Linq; + +class C +{ + public static async Task AsyncMethod () + { + await Task.Delay (1); + return 0; + } + + static int Main () + { + var m = typeof (C).GetMethod ("AsyncMethod"); + var attr = m.GetCustomAttribute (); + if (attr == null) + return 1; + + if (attr.StateMachineType == null) + return 2; + + Func> a = async () => await AsyncMethod (); + + var c = typeof (C).GetMethods (BindingFlags.NonPublic | BindingFlags.Static).Where (l => + l.IsDefined (typeof (AsyncStateMachineAttribute))).Count (); + + if (c != 1) + return 3; + + return 0; + } +} diff --git a/mcs/tests/test-async-36.cs b/mcs/tests/test-async-36.cs new file mode 100644 index 00000000000..151195b1e08 --- /dev/null +++ b/mcs/tests/test-async-36.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; + +class X +{ + internal Task ExecuteInternalAsync () + { + return Task.FromResult (1); + } + + public async Task ExecuteReaderAsync () + { + await ExecuteInternalAsync (); + return Task.FromResult (0); + } + + public static int Main () + { + var at = new X ().ExecuteReaderAsync (); + if (!at.Wait (1000)) + return 1; + + return 0; + } +} diff --git a/mcs/tests/test-debug-01-ref.xml b/mcs/tests/test-debug-01-ref.xml index 6dca8238a8d..6d3f12c1846 100644 --- a/mcs/tests/test-debug-01-ref.xml +++ b/mcs/tests/test-debug-01-ref.xml @@ -6,8 +6,8 @@ - diff --git a/mcs/tests/test-debug-02-ref.xml b/mcs/tests/test-debug-02-ref.xml index b22032eb28c..98ce07ad2ff 100644 --- a/mcs/tests/test-debug-02-ref.xml +++ b/mcs/tests/test-debug-02-ref.xml @@ -1,67 +1,68 @@  - + - - - - - - - diff --git a/mcs/tests/test-debug-02.cs b/mcs/tests/test-debug-02.cs index 42bed427018..67261a41dea 100644 --- a/mcs/tests/test-debug-02.cs +++ b/mcs/tests/test-debug-02.cs @@ -12,7 +12,7 @@ class C1 class C2 { - int a = 55; + int a = 55, b = 33; public C2 () { diff --git a/mcs/tests/test-debug-03-ref.xml b/mcs/tests/test-debug-03-ref.xml index 2a7efc64850..9cc8718343c 100644 --- a/mcs/tests/test-debug-03-ref.xml +++ b/mcs/tests/test-debug-03-ref.xml @@ -6,8 +6,8 @@ - @@ -24,16 +24,16 @@ - - @@ -45,8 +45,8 @@ - diff --git a/mcs/tests/test-debug-04-ref.xml b/mcs/tests/test-debug-04-ref.xml index bf66fc2a71f..114808d3dff 100644 --- a/mcs/tests/test-debug-04-ref.xml +++ b/mcs/tests/test-debug-04-ref.xml @@ -12,27 +12,27 @@ - - - diff --git a/mcs/tests/test-debug-05-ref.xml b/mcs/tests/test-debug-05-ref.xml index 749cca84757..0114c98f118 100644 --- a/mcs/tests/test-debug-05-ref.xml +++ b/mcs/tests/test-debug-05-ref.xml @@ -7,10 +7,10 @@ - @@ -20,9 +20,9 @@ - @@ -33,10 +33,10 @@ - diff --git a/mcs/tests/test-debug-06-ref.xml b/mcs/tests/test-debug-06-ref.xml index 9a12c737199..9714fb693d7 100644 --- a/mcs/tests/test-debug-06-ref.xml +++ b/mcs/tests/test-debug-06-ref.xml @@ -6,21 +6,21 @@ - - @@ -30,14 +30,14 @@ - @@ -49,17 +49,17 @@ - @@ -73,12 +73,12 @@ - @@ -88,16 +88,16 @@ - diff --git a/mcs/tests/test-debug-07-ref.xml b/mcs/tests/test-debug-07-ref.xml index be8726614cc..faccf800550 100644 --- a/mcs/tests/test-debug-07-ref.xml +++ b/mcs/tests/test-debug-07-ref.xml @@ -6,29 +6,29 @@ - - - diff --git a/mcs/tests/test-debug-08-ref.xml b/mcs/tests/test-debug-08-ref.xml index 25b23316267..c8083e9c1fd 100644 --- a/mcs/tests/test-debug-08-ref.xml +++ b/mcs/tests/test-debug-08-ref.xml @@ -6,7 +6,7 @@ - @@ -18,14 +18,14 @@ - - diff --git a/mcs/tests/test-debug-09-ref.xml b/mcs/tests/test-debug-09-ref.xml index 5429a7fb603..42d40c79d4b 100644 --- a/mcs/tests/test-debug-09-ref.xml +++ b/mcs/tests/test-debug-09-ref.xml @@ -16,8 +16,8 @@ - diff --git a/mcs/tests/test-debug-10-ref.xml b/mcs/tests/test-debug-10-ref.xml index c304d819625..925bc031451 100644 --- a/mcs/tests/test-debug-10-ref.xml +++ b/mcs/tests/test-debug-10-ref.xml @@ -6,40 +6,40 @@ - - - - - diff --git a/mcs/tests/test-debug-11-ref.xml b/mcs/tests/test-debug-11-ref.xml index 627abe00325..9a6c2dcacd7 100644 --- a/mcs/tests/test-debug-11-ref.xml +++ b/mcs/tests/test-debug-11-ref.xml @@ -6,36 +6,37 @@ - - - - @@ -47,12 +48,12 @@ - @@ -65,11 +66,11 @@ - @@ -81,12 +82,12 @@ - @@ -98,11 +99,11 @@ - @@ -111,11 +112,11 @@ - @@ -124,15 +125,15 @@ - @@ -142,13 +143,13 @@ - @@ -158,16 +159,16 @@ - @@ -177,12 +178,12 @@ - @@ -191,14 +192,14 @@ - @@ -211,15 +212,15 @@ - @@ -229,11 +230,11 @@ - @@ -244,11 +245,11 @@ - @@ -257,13 +258,13 @@ - @@ -273,16 +274,16 @@ - @@ -293,13 +294,13 @@ - @@ -309,15 +310,15 @@ - @@ -331,10 +332,10 @@ - @@ -346,14 +347,14 @@ - @@ -365,14 +366,13 @@ - @@ -384,14 +384,13 @@ - @@ -403,14 +402,14 @@ - diff --git a/mcs/tests/test-debug-12-ref.xml b/mcs/tests/test-debug-12-ref.xml index ddc64f6c200..338ebab2372 100644 --- a/mcs/tests/test-debug-12-ref.xml +++ b/mcs/tests/test-debug-12-ref.xml @@ -6,8 +6,8 @@ - diff --git a/mcs/tests/test-debug-13-ref.xml b/mcs/tests/test-debug-13-ref.xml index d9bdcf29731..5125b202491 100644 --- a/mcs/tests/test-debug-13-ref.xml +++ b/mcs/tests/test-debug-13-ref.xml @@ -6,8 +6,8 @@ - @@ -49,9 +49,9 @@ - @@ -93,8 +93,8 @@ - diff --git a/mcs/tests/test-debug-14-ref.xml b/mcs/tests/test-debug-14-ref.xml index b1f9f78f9fd..e550e8ecffa 100644 --- a/mcs/tests/test-debug-14-ref.xml +++ b/mcs/tests/test-debug-14-ref.xml @@ -6,17 +6,17 @@ - - @@ -25,9 +25,9 @@ - @@ -36,9 +36,9 @@ - @@ -47,9 +47,9 @@ - @@ -63,25 +63,25 @@ - - - @@ -93,7 +93,7 @@ - diff --git a/mcs/tests/test-debug-15-ref.xml b/mcs/tests/test-debug-15-ref.xml index cce12d1957c..1e4c752197b 100644 --- a/mcs/tests/test-debug-15-ref.xml +++ b/mcs/tests/test-debug-15-ref.xml @@ -6,9 +6,9 @@ - @@ -18,9 +18,9 @@ - diff --git a/mcs/tests/test-debug-16-ref.xml b/mcs/tests/test-debug-16-ref.xml index f54071b4b8b..f34f901bff4 100644 --- a/mcs/tests/test-debug-16-ref.xml +++ b/mcs/tests/test-debug-16-ref.xml @@ -6,19 +6,19 @@ - - @@ -27,11 +27,11 @@ - diff --git a/mcs/tests/test-debug-17-ref.xml b/mcs/tests/test-debug-17-ref.xml index 29fedfd787e..e71763c6366 100644 --- a/mcs/tests/test-debug-17-ref.xml +++ b/mcs/tests/test-debug-17-ref.xml @@ -6,18 +6,18 @@ - - @@ -26,9 +26,9 @@ - diff --git a/mcs/tests/test-debug-18-ref.xml b/mcs/tests/test-debug-18-ref.xml index 9e9644670cf..ccb72a21ebb 100644 --- a/mcs/tests/test-debug-18-ref.xml +++ b/mcs/tests/test-debug-18-ref.xml @@ -16,28 +16,28 @@ - - - @@ -47,10 +47,10 @@ - @@ -59,12 +59,12 @@ - @@ -75,10 +75,10 @@ - @@ -92,7 +92,7 @@ - diff --git a/mcs/tests/test-debug-19-ref.xml b/mcs/tests/test-debug-19-ref.xml index ae145805f92..4e9c2a3582b 100644 --- a/mcs/tests/test-debug-19-ref.xml +++ b/mcs/tests/test-debug-19-ref.xml @@ -6,8 +6,8 @@ - @@ -19,9 +19,10 @@ - @@ -33,9 +34,10 @@ - @@ -52,24 +54,24 @@ - - - @@ -81,9 +83,9 @@ - @@ -95,12 +97,12 @@ - @@ -112,7 +114,7 @@ - diff --git a/mcs/tests/test-debug-20-ref.xml b/mcs/tests/test-debug-20-ref.xml index 04e1ca617aa..ac2dc762dc3 100644 --- a/mcs/tests/test-debug-20-ref.xml +++ b/mcs/tests/test-debug-20-ref.xml @@ -6,16 +6,16 @@ - - diff --git a/mcs/tests/test-debug-21-ref.xml b/mcs/tests/test-debug-21-ref.xml index ce4fbe37afe..3b9f0055083 100644 --- a/mcs/tests/test-debug-21-ref.xml +++ b/mcs/tests/test-debug-21-ref.xml @@ -11,8 +11,8 @@ - @@ -44,30 +44,24 @@ - - + - - + - - - + @@ -80,9 +74,15 @@ - + + - + + + \ No newline at end of file diff --git a/mcs/tests/test-debug-22-ref.xml b/mcs/tests/test-debug-22-ref.xml index 2c5302f464d..2b4a8e44532 100644 --- a/mcs/tests/test-debug-22-ref.xml +++ b/mcs/tests/test-debug-22-ref.xml @@ -6,9 +6,9 @@ - @@ -25,16 +25,16 @@ - - @@ -71,9 +71,9 @@ - diff --git a/mcs/tests/test-debug-23-ref.xml b/mcs/tests/test-debug-23-ref.xml new file mode 100644 index 00000000000..ed5b7d85301 --- /dev/null +++ b/mcs/tests/test-debug-23-ref.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/tests/test-debug-23.cs b/mcs/tests/test-debug-23.cs new file mode 100644 index 00000000000..29d7ecac4b8 --- /dev/null +++ b/mcs/tests/test-debug-23.cs @@ -0,0 +1,47 @@ +// Tests for explicit sequence point on non-empty stack + +using System; + +class Program +{ + void Test_1 () + { + Prop.BindCore(); + } + + void Test_2 () + { + Prog ().BindCore(); + } + + void Test_3 () + { + new Program ().BindCore (); + } + + void Test_4 () + { + Func f = () => new Program (); + f ().BindCore (); + } + + public int BindCore () + { + return 3; + } + + public Program Prog () + { + return this; + } + + public Program Prop { + get { + return this; + } + } + + static void Main () + { + } +} \ No newline at end of file diff --git a/mcs/tests/test-debug-24-ref.xml b/mcs/tests/test-debug-24-ref.xml new file mode 100644 index 00000000000..b3de71ee978 --- /dev/null +++ b/mcs/tests/test-debug-24-ref.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/tests/test-debug-24.cs b/mcs/tests/test-debug-24.cs new file mode 100644 index 00000000000..647e9cbfd26 --- /dev/null +++ b/mcs/tests/test-debug-24.cs @@ -0,0 +1,18 @@ +// Tests for special columns handling + +class C +{ + void Test_1 () + { + object a = new object (), b = new object (); + } + + void Test_2 () + { + for (int i = 0; i <= 10; ++i) { } + } + + public static void Main () + { + } +} diff --git a/mcs/tests/test-debug-25-ref.xml b/mcs/tests/test-debug-25-ref.xml new file mode 100644 index 00000000000..28c1c5327ea --- /dev/null +++ b/mcs/tests/test-debug-25-ref.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/tests/test-debug-25.cs b/mcs/tests/test-debug-25.cs new file mode 100644 index 00000000000..b15040a1e85 --- /dev/null +++ b/mcs/tests/test-debug-25.cs @@ -0,0 +1,8 @@ +#pragma checksum "test-debug-25.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "60d1c7f99b6e992275cf155c8a54c018" + +class TestClass +{ + static void Main() + { + } +} \ No newline at end of file diff --git a/mcs/tests/ver-il-net_4_5.xml b/mcs/tests/ver-il-net_4_5.xml index ba35c1d4af2..a196344eef4 100644 --- a/mcs/tests/ver-il-net_4_5.xml +++ b/mcs/tests/ver-il-net_4_5.xml @@ -1,59901 +1,60207 @@ - - - - - - - 8 - - - 14 - - - 2 - - - 2 - - - 15 - - - 10 - - - 8 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 1216 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - - - 130 - - - 70 - - - 61 - - - 104 - - - 61 - - - 104 - - - 104 - - - 110 - - - 70 - - - 61 - - - 14 - - - 14 - - - 14 - - - 14 - - - 22 - - - - - 30 - - - 2 - - - 2 - - - 10 - - - 2 - - - 8 - - - 8 - - - - - 99 - - - 257 - - - 172 - - - 124 - - - 134 - - - 124 - - - 128 - - - 124 - - - 72 - - - 125 - - - 127 - - - 124 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 117 - - - 118 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 125 - - - 111 - - - 116 - - - 111 - - - 111 - - - 230 - - - 122 - - - 140 - - - 123 - - - 116 - - - 140 - - - 114 - - - 144 - - - 149 - - - 155 - - - 125 - - - 132 - - - 137 - - - 136 - - - 133 - - - 106 - - - 143 - - - 138 - - - 141 - - - 137 - - - 151 - - - 140 - - - 134 - - - 373 - - - 114 - - - 114 - - - 114 - - - 114 - - - 117 - - - 119 - - - 117 - - - 119 - - - 159 - - - 159 - - - 246 - - - 130 - - - 247 - - - 249 - - - 123 - - - 187 - - - 73 - - - 68 - - - 73 - - - 73 - - - 73 - - - 73 - - - 74 - - - 74 - - - 73 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 74 - - - 58 - - - 58 - - - 58 - - - 58 - - - 67 - - - 93 - - - 112 - - - 75 - - - 102 - - - 74 - - - 128 - - - 92 - - - 94 - - - 93 - - - 111 - - - 112 - - - 111 - - - 91 - - - 112 - - - 125 - - - 140 - - - 102 - - - 69 - - - 77 - - - 55 - - - 55 - - - 55 - - - 55 - - - 55 - - - 59 - - - 55 - - - 59 - - - 60 - - - 69 - - - 60 - - - 69 - - - 60 - - - 68 - - - 60 - - - 60 - - - 69 - - - 60 - - - 74 - - - 20 - - - 15 - - - 15 - - - 12 - - - 8 - - - 8 - - - 34 - - - - - 7 - - - - - 98 - - - 7 - - - - - 93 - - - 7 - - - - - 110 - - - 7 - - - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - - 120 - - - 7 - - - - - 0 - - - 0 - - - - - 120 - - - 7 - - - - - 80 - - - 7 - - - - - - - 7 - - - - - 15 - - - 19 - - - 121 - - - 7 - - - - - - - 35 - - - 35 - - - 7 - - - - - 260 - - - 7 - - - - - - - 16 - - - 16 - - - 9 - - - - - 14 - - - 8 - - - 7 - - - 22 - - - 19 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 25 - - - 28 - - - 25 - - - 25 - - - 28 - - - 28 - - - 19 - - - 17 - - - 23 - - - 23 - - - 21 - - - 21 - - - 22 - - - 19 - - - 26 - - - 9 - - - - - 15 - - - 15 - - - - - 16 - - - 22 - - - 9 - - - - - 42 - - - 42 - - - 80 - - - 41 - - - 34 - - - 1371 - - - 2279 - - - 875 - - - 348 - - - 1145 - - - 1155 - - - 14 - - - 444 - - - 322 - - - 877 - - - 4 - - - 1537 - - - 671 - - - 1809 - - - 912 - - - 684 - - - 1253 - - - 928 - - - 2307 - - - 4 - - - 1144 - - - 4 - - - 1266 - - - 83 - - - 23 - - - 503 - - - 90 - - - 168 - - - 1942 - - - 3034 - - - 1048 - - - 631 - - - 19 - - - 1547 - - - 1817 - - - 693 - - - 894 - - - 686 - - - 1984 - - - 2407 - - - 1048 - - - 1984 - - - 2407 - - - 1048 - - - 1367 - - - 1138 - - - 650 - - - 444 - - - 1984 - - - 2421 - - - 1048 - - - 1984 - - - 2407 - - - 1048 - - - 924 - - - 2295 - - - 1138 - - - 1168 - - - 2295 - - - 346 - - - 1328 - - - 320 - - - 1312 - - - 1118 - - - 54 - - - 405 - - - 1946 - - - 3034 - - - 1048 - - - 631 - - - 819 - - - 419 - - - 1547 - - - 675 - - - 1593 - - - 912 - - - 686 - - - 1258 - - - 1153 - - - 1137 - - - 650 - - - 443 - - - 1133 - - - 2290 - - - 897 - - - 349 - - - 1155 - - - 455 - - - 322 - - - 34 - - - 992 - - - 298 - - - 993 - - - 295 - - - 429 - - - 1115 - - - 1120 - - - 80 - - - 187 - - - 12 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 103 - - - 103 - - - 7 - - - - - 234 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 154 - - - 15 - - - 6 - - - 7 - - - - - 81 - - - 81 - - - 7 - - - - - 104 - - - 104 - - - 7 - - - - - 234 - - - 7 - - - - - 88 - - - 7 - - - - - 104 - - - 104 - - - 7 - - - - - 234 - - - 7 - - - - - 224 - - - 7 - - - - - 220 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 17 - - - 9 - - - 15 - - - 9 - - - 2 - - - 14 - - - 10 - - - 12 - - - 12 - - - 2 - - - 16 - - - 2 - - - 45 - - - 53 - - - 16 - - - - - 42 - - - 42 - - - 20 - - - 7 - - - - - 80 - - - 34 - - - 42 - - - 42 - - - 916 - - - 37 - - - 459 - - - 907 - - - 41 - - - 232 - - - 2674 - - - 811 - - - 37 - - - 2965 - - - 37 - - - 2901 - - - 37 - - - 80 - - - 187 - - - 9 - - - 112 - - - 2 - - - 9 - - - 10 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 92 - - - 7 - - - - - 0 - - - 0 - - - - - 86 - - - 7 - - - - - 96 - - - 7 - - - - - 102 - - - 7 - - - - - - - 14 - - - 2 - - - 7 - - - - - 419 - - - 312 - - - 235 - - - 619 - - - 99 - - - 7 - - - - - - - 2 - - - 131 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - 761 - - - 7 - - - - - - - 18 - - - 7 - - - 18 - - - 10 - - - 10 - - - 197 - - - 39 - - - 7 - - - - - - - 7 - - - - - 77 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 16 - - - 260 - - - 16 - - - 54 - - - 7 - - - - - - - 67 - - - 7 - - - - - - - 5 - - - 7 - - - - - 9 - - - 7 - - - - - 2 - - - 2 - - - 10 - - - 13 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 5 - - - 5 - - - 14 - - - 198 - - - 996 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 175 - - - 10 - - - 7 - - - - - - - 14 - - - 8 - - - 7 - - - - - 374 - - - 18 - - - - - - - 2 - - - 2 - - - 2 - - - 5 - - - 28 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 14 - - - 7 - - - - - 7 - - - - - 90 - - - 7 - - - - - 25 - - - 7 - - - - - - - 7 - - - - - 70 - - - 15 - - - 7 - - - - - 38 - - - 7 - - - - - - - 2 - - - 16 - - - 7 - - - - - - - 48 - - - 7 - - - - - - - 542 - - - 9 - - - 15 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 9 - - - - - 105 - - - 368 - - - 7 - - - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - - - - 375 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 382 - - - 7 - - - - - - - 9 - - - 6 - - - 7 - - - - - 2 - - - 255 - - - 7 - - - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - - - - 431 - - - 168 - - - 115 - - - 7 - - - - - - - 7 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 577 - - - 7 - - - - - - - 33 - - - 7 - - - - - 15 - - - 104 - - - 7 - - - - - 0 - - - 0 - - - - - - - 15 - - - - - 10 - - - 153 - - - 7 - - - - - 0 - - - 0 - - - - - - - 10 - - - 2 - - - 10 - - - 2 - - - 3609 - - - 39 - - - - - - - 17 - - - 7 - - - - - 482 - - - 7 - - - - - 0 - - - 0 - - - - - - - 15 - - - 2 - - - 24 - - - 2 - - - 10 - - - 2 - - - 20 - - - 75 - - - 1142 - - - 18 - - - - - - - 42 - - - 42 - - - 332 - - - 11 - - - 7 - - - - - - - 1207 - - - 7 - - - - - - - 2 - - - 379 - - - 7 - - - - - - - 10 - - - 10 - - - 16 - - - 2 - - - 10 - - - 15 - - - 2 - - - 7 - - - - - 15 - - - 45 - - - 2 - - - 35 - - - 2 - - - 7 - - - - - 224 - - - 545 - - - 7 - - - - - - - 18 - - - 7 - - - - - 38 - - - 7 - - - - - 406 - - - 7 - - - - - - - 18 - - - 7 - - - - - 16 - - - 7 - - - - - 90 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 2 - - - 14 - - - 7 - - - - - 90 - - - 12 - - - 7 - - - - - - - 347 - - - 7 - - - - - - - 10 - - - 10 - - - 868 - - - 7 - - - - - - - 249 - - - 7 - - - - - - - 1101 - - - 11 - - - 11 - - - 14 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - - - - 42 - - - 42 - - - 171 - - - 12 - - - 42 - - - - - 30 - - - 7 - - - - - - - 10 - - - 23 - - - 342 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 91 - - - 7 - - - - - - - 7 - - - 10 - - - 7 - - - - - 12 - - - 10 - - - 1195 - - - 7 - - - - - - - 15 - - - 11 - - - 491 - - - 14 - - - - - - - 192 - - - 2 - - - 7 - - - - - - - 8 - - - - - 21 - - - 7 - - - - - - - 21 - - - 34 - - - 21 - - - 34 - - - 2 - - - 9 - - - 72 - - - 103 - - - 105 - - - 7 - - - - - 46 - - - 7 - - - - - 114 - - - 7 - - - - - 118 - - - 7 - - - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - - - - 0 - - - 7 - - - - - 2 - - - 71 - - - 7 - - - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 253 - - - 35 - - - 7 - - - - - 10 - - - - - - - 101 - - - 2 - - - 14 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 488 - - - 7 - - - - - 15 - - - 18 - - - - - - - 11 - - - 7 - - - - - 41 - - - 41 - - - 42 - - - 48 - - - 72 - - - 85 - - - 187 - - - 86 - - - 92 - - - 106 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 110 - - - 7 - - - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - 143 - - - 7 - - - - - - - 7 - - - - - 106 - - - 7 - - - - - - - 7 - - - - - 153 - - - 7 - - - - - - - 2 - - - 2 - - - 383 - - - 7 - - - - - - - 191 - - - 7 - - - - - - - 91 - - - 7 - - - - - - - 2 - - - 112 - - - 7 - - - - - - - 23 - - - 23 - - - 2 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 5 - - - 130 - - - 7 - - - - - 0 - - - 0 - - - - - - - 39 - - - 39 - - - 44 - - - 52 - - - 227 - - - 7 - - - - - - - 15 - - - 15 - - - 7 - - - - - 10 - - - 2 - - - 10 - - - 882 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 31 - - - 37 - - - 18 - - - 24 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 22 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 12 - - - 7 - - - - - 28 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 26 - - - 2 - - - 7 - - - - - - - 14 - - - 2 - - - 7 - - - - - - - 2 - - - 8 - - - - - 38 - - - 7 - - - - - - - 4 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 13 - - - 14 - - - 7 - - - - - - - 2 - - - 8 - - - - - 13 - - - 14 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - - - 14 - - - 2 - - - 7 - - - - - - - 24 - - - 59 - - - - - 46 - - - 7 - - - - - 25 - - - 9 - - - - - 40 - - - 39 - - - 7 - - - - - - - 2 - - - 8 - - - 7 - - - - - 15 - - - 7 - - - - - 14 - - - 7 - - - - - - - 2 - - - 8 - - - 7 - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 13 - - - 8 - - - - - 9 - - - 14 - - - 7 - - - - - - - 14 - - - 13 - - - 8 - - - - - 13 - - - 14 - - - 7 - - - - - - - 8 - - - - - 16 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 37 - - - 2 - - - 7 - - - - - - - 20 - - - 15 - - - - - 15 - - - 21 - - - 7 - - - - - - - 15 - - - 20 - - - - - 20 - - - 7 - - - - - - - 2 - - - 8 - - - - - 2 - - - 8 - - - - - 25 - - - 14 - - - 7 - - - - - - - 25 - - - 2 - - - 7 - - - - - - - 25 - - - 2 - - - 7 - - - - - - - 36 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 9 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 9 - - - 7 - - - - - 9 - - - 7 - - - - - 9 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 15 - - - 13 - - - 75 - - - 39 - - - - - 22 - - - - - 17 - - - 7 - - - - - - - 15 - - - 16 - - - 15 - - - - - 52 - - - 22 - - - - - 32 - - - 7 - - - - - - - 15 - - - 15 - - - 15 - - - 67 - - - 27 - - - - - 2 - - - 15 - - - - - 20 - - - 15 - - - - - 15 - - - 15 - - - - - 20 - - - 20 - - - 15 - - - - - 7 - - - - - 10 - - - 7 - - - - - 7 - - - - - 49 - - - 7 - - - - - - - 2 - - - 7 - - - - - 37 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 14 - - - 7 - - - - - 145 - - - 177 - - - 7 - - - - - - - 22 - - - 15 - - - - - 38 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 87 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 25 - - - 7 - - - - - 13 - - - 37 - - - 7 - - - - - - - 8 - - - 7 - - - - - - - 15 - - - 21 - - - - - 23 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 7 - - - 41 - - - 7 - - - - - - - 44 - - - 7 - - - - - 12 - - - 7 - - - - - 7 - - - - - 19 - - - 7 - - - - - - - 44 - - - 7 - - - - - 12 - - - 19 - - - 8 - - - - - - - 16 - - - - - 26 - - - 16 - - - - - 16 - - - 26 - - - - - 16 - - - 26 - - - 16 - - - - - 16 - - - 7 - - - - - 26 - - - 16 - - - 7 - - - - - 16 - - - 26 - - - 7 - - - - - 16 - - - 26 - - - 16 - - - 7 - - - - - 51 - - - 7 - - - - - 98 - - - 7 - - - - - - - 7 - - - - - 2 - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 37 - - - 9 - - - 72 - - - 22 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 20 - - - 7 - - - - - - - 14 - - - 33 - - - 15 - - - 55 - - - 69 - - - 78 - - - 39 - - - 7 - - - - - 7 - - - - - 207 - - - 7 - - - - - - - 18 - - - 14 - - - 7 - - - - - 49 - - - 7 - - - - - - - 2 - - - 7 - - - - - 14 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 13 - - - 7 - - - - - 14 - - - 7 - - - - - 23 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 21 - - - 15 - - - - - 84 - - - 25 - - - 7 - - - - - - - 51 - - - 95 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 116 - - - 15 - - - 6 - - - 7 - - - - - - - 23 - - - 10 - - - 10 - - - 7 - - - - - 85 - - - 7 - - - - - - - 15 - - - 15 - - - 7 - - - - - 15 - - - - - 2 - - - 7 - - - - - - - 76 - - - 81 - - - 72 - - - 16 - - - - - 18 - - - 218 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 62 - - - 7 - - - - - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 12 - - - 27 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 8 - - - 13 - - - - - 2 - - - 7 - - - - - - - 20 - - - 7 - - - - - 22 - - - 7 - - - - - 7 - - - - - - - 14 - - - 33 - - - 15 - - - 55 - - - 69 - - - 78 - - - 39 - - - 7 - - - - - 7 - - - - - 212 - - - 186 - - - 7 - - - - - 16 - - - - - - - 15 - - - 15 - - - 7 - - - - - 9 - - - - - 57 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 16 - - - - - 22 - - - - - 113 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 9 - - - - - 15 - - - 7 - - - - - 54 - - - 7 - - - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - 7 - - - - - 238 - - - 36 - - - 7 - - - - - - - 19 - - - 2 - - - 7 - - - - - 19 - - - 2 - - - 7 - - - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 9 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 19 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 15 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 16 - - - 7 - - - - - 22 - - - 7 - - - - - - - 10 - - - 10 - - - 16 - - - 7 - - - - - 2 - - - 7 - - - - - - - 13 - - - 7 - - - - - 8 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - - - 10 - - - 7 - - - - - - - 5 - - - 11 - - - 7 - - - - - 2 - - - 7 - - - - - - - 20 - - - 7 - - - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 15 - - - 2 - - - 15 - - - - - 60 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 9 - - - 9 - - - 15 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 28 - - - 9 - - - 23 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 10 - - - 7 - - - - - 9 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 2 - - - 2 - - - 21 - - - 7 - - - - - 2 - - - 7 - - - - - - - 21 - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 2 - - - - - 10 - - - 7 - - - - - 26 - - - 15 - - - - - 34 - - - 7 - - - - - 8 - - - - - 10 - - - 7 - - - - - 26 - - - 15 - - - - - 33 - - - 7 - - - - - 12 - - - 7 - - - - - - - 2 - - - - - 10 - - - 7 - - - - - 26 - - - 22 - - - - - 33 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - 15 - - - - - 25 - - - 27 - - - 14 - - - 7 - - - - - - - 22 - - - 15 - - - - - 58 - - - 7 - - - - - 14 - - - 19 - - - 82 - - - 15 - - - 6 - - - 7 - - - - - - - 13 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 76 - - - 7 - - - - - - - 16 - - - 24 - - - - - 14 - - - 15 - - - - - 86 - - - 7 - - - - - - - 2 - - - 7 - - - - - 9 - - - - - 9 - - - 7 - - - - - 16 - - - 7 - - - - - 27 - - - 27 - - - - - 28 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - 43 - - - 21 - - - 7 - - - - - - - 23 - - - 7 - - - - - 29 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - 15 - - - 21 - - - 15 - - - 133 - - - 15 - - - 266 - - - 114 - - - 169 - - - 77 - - - 15 - - - 135 - - - 78 - - - 15 - - - 31 - - - 46 - - - - - 15 - - - 29 - - - - - 20 - - - 32 - - - 81 - - - 7 - - - 31 - - - 27 - - - - - 140 - - - 7 - - - - - 93 - - - 7 - - - - - 26 - - - 26 - - - 15 - - - 15 - - - - - 472 - - - 25 - - - 7 - - - - - - - 9 - - - 7 - - - - - 202 - - - 7 - - - - - - - 23 - - - 33 - - - 33 - - - 7 - - - - - 20 - - - 7 - - - - - 18 - - - 23 - - - 46 - - - 16 - - - 23 - - - 213 - - - 7 - - - - - - - 315 - - - 34 - - - 86 - - - 235 - - - 114 - - - 20 - - - 15 - - - - - 28 - - - 28 - - - 29 - - - 9 - - - - - 149 - - - 7 - - - - - - - 62 - - - 7 - - - - - - - 53 - - - 7 - - - - - 10 - - - 7 - - - - - 23 - - - 7 - - - - - - - 10 - - - 17 - - - 7 - - - - - 7 - - - - - 19 - - - 7 - - - - - - - 27 - - - 23 - - - 7 - - - - - 19 - - - 22 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - - - 18 - - - 2 - - - 7 - - - - - 22 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - - - 18 - - - 7 - - - - - 14 - - - 7 - - - - - 46 - - - 46 - - - 7 - - - - - - - 42 - - - 42 - - - 21 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 26 - - - 12 - - - 7 - - - - - - - 12 - - - 7 - - - - - 125 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 938 - - - 7 - - - - - - - 1332 - - - 7 - - - - - - - 68 - - - 64 - - - 7 - - - - - - - 15 - - - 9 - - - 9 - - - - - 202 - - - 7 - - - - - - - 114 - - - 7 - - - - - 53 - - - 15 - - - - - - - 117 - - - 7 - - - - - - - 22 - - - 9 - - - - - 22 - - - 9 - - - - - 149 - - - 7 - - - - - - - 158 - - - 7 - - - - - - - 62 - - - 7 - - - - - - - 10 - - - 10 - - - 11 - - - 10 - - - - - 78 - - - 7 - - - - - - - 134 - - - 7 - - - - - - - 92 - - - 7 - - - - - - - 14 - - - 26 - - - 19 - - - 19 - - - 25 - - - 25 - - - 37 - - - 37 - - - 7 - - - - - 2253 - - - 7 - - - - - - - 34 - - - 15 - - - 9 - - - 1157 - - - 38 - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 15 - - - - - 15 - - - 7 - - - - - - - 7 - - - - - 15 - - - - - 9 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - - - 7 - - - - - 2 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - - - 7 - - - - - 2 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 36 - - - 16 - - - - - 13 - - - 12 - - - - - - - 16 - - - - - 16 - - - 7 - - - - - - - 15 - - - 0 - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 57 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 21 - - - 38 - - - 10 - - - 10 - - - 7 - - - - - 14 - - - 7 - - - - - - - 57 - - - - - 2 - - - 7 - - - - - - - 12 - - - 19 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 102 - - - 7 - - - - - - - 7 - - - - - 14 - - - 18 - - - 7 - - - - - 2 - - - 7 - - - - - - - 57 - - - 16 - - - 22 - - - 7 - - - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 41 - - - 7 - - - - - - - 29 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 80 - - - 1 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 22 - - - 22 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 98 - - - 15 - - - 6 - - - 7 - - - - - - - 40 - - - 7 - - - - - - - 8 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 109 - - - 7 - - - - - - - 7 - - - - - 10 - - - 19 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 44 - - - 7 - - - - - 22 - - - 7 - - - - - - - 8 - - - 7 - - - - - 2 - - - 8 - - - 7 - - - - - - - 7 - - - - - 12 - - - 7 - - - - - 25 - - - 7 - - - - - - - 8 - - - 7 - - - - - - - 28 - - - 7 - - - - - 7 - - - - - 7 - - - - - 28 - - - 7 - - - - - - - 7 - - - 11 - - - - - 14 - - - 7 - - - - - - - 7 - - - - - 18 - - - 46 - - - 7 - - - - - - - 7 - - - - - 0 - - - 7 - - - - - 16 - - - 7 - - - - - 17 - - - 10 - - - 25 - - - 13 - - - 7 - - - - - - - 119 - - - 7 - - - 25 - - - - - 15 - - - 16 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 10 - - - 2 - - - 24 - - - 7 - - - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 7 - - - - - 289 - - - 7 - - - - - - - 15 - - - 2 - - - 37 - - - 2 - - - 211 - - - 7 - - - - - 14 - - - 14 - - - 149 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 168 - - - 15 - - - 6 - - - 7 - - - - - - - 11 - - - 7 - - - - - 16 - - - 12 - - - 7 - - - - - - - 37 - - - 7 - - - - - 75 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 91 - - - 15 - - - 6 - - - 7 - - - - - - - 69 - - - 20 - - - 7 - - - - - - - 48 - - - 7 - - - - - 155 - - - 7 - - - - - - - 22 - - - - - 121 - - - 7 - - - - - 18 - - - 26 - - - - - - - 15 - - - 7 - - - - - 7 - - - - - 15 - - - 7 - - - - - - - 22 - - - 42 - - - 42 - - - 12 - - - 205 - - - - - 7 - - - - - 47 - - - 7 - - - - - - - 7 - - - - - 26 - - - 15 - - - - - 19 - - - 7 - - - - - - - 14 - - - 15 - - - 7 - - - - - 7 - - - - - 7 - - - - - 22 - - - 7 - - - - - - - 23 - - - - - 23 - - - 7 - - - - - 23 - - - 7 - - - - - 23 - - - 7 - - - - - 37 - - - 7 - - - - - 37 - - - 7 - - - - - 37 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 77 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 89 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 89 - - - 15 - - - 6 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 36 - - - 7 - - - - - 23 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 49 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 23 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 36 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 49 - - - 1 - - - 6 - - - 7 - - - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 123 - - - 7 - - - - - - - 0 - - - 0 - - - 14 - - - 96 - - - 7 - - - - - 22 - - - 54 - - - 7 - - - - - 22 - - - 49 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 14 - - - 18 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 63 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 22 - - - 15 - - - - - 92 - - - 7 - - - - - 14 - - - 19 - - - 82 - - - 15 - - - 6 - - - 7 - - - - - - - 22 - - - 16 - - - 20 - - - - - 52 - - - 14 - - - - - - - 15 - - - 70 - - - 7 - - - - - 8 - - - 7 - - - - - 14 - - - 7 - - - - - - - 10 - - - 23 - - - 7 - - - - - 21 - - - 18 - - - - - 20 - - - 7 - - - - - - - 7 - - - - - 13 - - - 7 - - - - - 32 - - - 145 - - - 7 - - - - - - - 10 - - - 7 - - - - - 15 - - - 10 - - - 7 - - - - - - - 8 - - - 51 - - - 7 - - - - - - - 7 - - - - - 20 - - - 7 - - - - - 20 - - - 7 - - - - - - - 7 - - - - - 24 - - - 7 - - - - - - - 15 - - - 7 - - - - - 7 - - - - - 15 - - - 7 - - - - - - - 60 - - - 448 - - - 7 - - - - - - - 10 - - - - - 16 - - - 16 - - - 7 - - - - - - - 15 - - - 9 - - - - - 79 - - - 16 - - - 7 - - - - - - - 104 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 2 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 99 - - - 51 - - - 51 - - - 22 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 215 - - - 69 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 125 - - - 15 - - - 6 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 93 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 171 - - - 7 - - - - - - - 7 - - - - - 0 - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - - - 7 - - - - - 10 - - - 74 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 12 - - - 7 - - - - - - - 39 - - - 8 - - - - - 2 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 2 - - - - - 16 - - - 7 - - - - - - - 9 - - - - - 25 - - - - - 103 - - - 7 - - - - - - - 27 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 34 - - - 7 - - - - - - - 34 - - - 7 - - - - - - - 76 - - - 7 - - - - - - - 26 - - - 2 - - - 7 - - - - - - - 15 - - - 10 - - - 15 - - - 7 - - - - - - - 14 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 82 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 83 - - - 7 - - - - - - - 57 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 297 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - - - 14 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 186 - - - 16 - - - 7 - - - - - - - 18 - - - 7 - - - - - 38 - - - 13 - - - 7 - - - - - - - 2 - - - 8 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - 29 - - - 7 - - - - - - - 15 - - - 0 - - - 7 - - - - - 2 - - - 0 - - - 7 - - - - - 7 - - - - - 15 - - - 2 - - - 7 - - - - - 10 - - - 8 - - - 65 - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 7 - - - - - 27 - - - 2 - - - 7 - - - - - - - 15 - - - 0 - - - 7 - - - - - 15 - - - 7 - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 21 - - - 7 - - - - - 2 - - - 7 - - - - - - - 25 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 16 - - - - - 7 - - - - - 7 - - - 7 - - - - - - - 7 - - - - - 25 - - - 15 - - - - - 2 - - - 7 - - - - - 21 - - - 7 - - - - - - - 14 - - - 56 - - - 52 - - - 7 - - - - - 21 - - - 7 - - - - - - - 0 - - - 7 - - - - - 18 - - - 7 - - - - - 2 - - - 7 - - - - - - - 22 - - - 12 - - - 154 - - - 7 - - - - - 14 - - - 14 - - - 142 - - - 15 - - - 6 - - - 7 - - - - - - - 33 - - - 7 - - - - - - - 8 - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - 11 - - - - - - - 76 - - - 22 - - - - - 19 - - - 10 - - - 10 - - - - - 15 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 167 - - - 7 - - - - - - - 20 - - - 7 - - - - - 29 - - - 2 - - - - - 14 - - - 19 - - - 87 - - - 15 - - - 6 - - - 7 - - - - - - - 18 - - - - - 7 - - - - - 15 - - - 7 - - - - - - - 15 - - - 7 - - - - - - - 7 - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 35 - - - 2 - - - 2 - - - 7 - - - - - 19 - - - 7 - - - - - - - 8 - - - 2 - - - 7 - - - - - 7 - - - - - - - 44 - - - 21 - - - 9 - - - - - 73 - - - 20 - - - 72 - - - 79 - - - 37 - - - 71 - - - 247 - - - 7 - - - - - - - 63 - - - 60 - - - 7 - - - - - - - 15 - - - 15 - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - 57 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 28 - - - 2 - - - 2 - - - 19 - - - - - 13 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 9 - - - - - 15 - - - 9 - - - - - 15 - - - 9 - - - - - 448 - - - 7 - - - - - - - 20 - - - 7 - - - - - 19 - - - - - 19 - - - - - 19 - - - - - - - 38 - - - 7 - - - - - 16 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 14 - - - 7 - - - - - - - 12 - - - 20 - - - 7 - - - - - 21 - - - 7 - - - - - - - 70 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 7 - - - - - 22 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 22 - - - 7 - - - 11 - - - - - - - 16 - - - - - 40 - - - 2 - - - - - - - 7 - - - - - 95 - - - 628 - - - - - 450 - - - 595 - - - 137 - - - - - 54 - - - 53 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 39 - - - 7 - - - - - - - 15 - - - - - 2 - - - 7 - - - - - 89 - - - 7 - - - - - - - 37 - - - 2 - - - 7 - - - - - - - 13 - - - 7 - - - - - 2 - - - 7 - - - - - 21 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 7 - - - - - 7 - - - 1 - - - - - 74 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 15 - - - 7 - - - - - 2 - - - - - - - 23 - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 22 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 18 - - - 101 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - - - 25 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - - - 14 - - - 8 - - - 7 - - - 46 - - - - - - - 7 - - - - - 7 - - - - - 53 - - - 7 - - - - - - - 68 - - - 7 - - - - - - - 24 - - - 7 - - - - - - - 7 - - - 15 - - - 7 - - - - - 63 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 14 - - - 8 - - - - - 0 - - - 7 - - - - - 20 - - - 7 - - - - - 21 - - - 7 - - - - - - - 14 - - - 8 - - - - - 0 - - - 7 - - - - - 32 - - - 7 - - - - - 21 - - - 7 - - - - - - - 68 - - - 82 - - - - - - - 8 - - - - - 8 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 28 - - - 7 - - - - - - - 34 - - - 34 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 12 - - - 16 - - - 30 - - - 142 - - - 7 - - - - - 22 - - - 7 - - - - - 22 - - - 7 - - - - - - - 2 - - - 7 - - - - - 16 - - - 7 - - - - - - - 2 - - - 21 - - - - - - - 53 - - - 7 - - - - - - - 15 - - - - - 29 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 14 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 19 - - - 7 - - - - - - - 20 - - - 7 - - - - - 7 - - - - - 0 - - - 7 - - - - - 8 - - - 24 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 14 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 14 - - - 7 - - - - - - - 15 - - - 15 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 14 - - - 76 - - - 15 - - - 6 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 50 - - - 26 - - - 13 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 8 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 9 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 9 - - - 2 - - - 8 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 40 - - - 40 - - - 37 - - - 2 - - - 2 - - - 19 - - - - - 40 - - - 7 - - - - - 58 - - - 7 - - - - - - - 38 - - - 7 - - - - - 14 - - - 7 - - - - - - - 7 - - - - - 59 - - - 7 - - - - - - - 51 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - - - 22 - - - 7 - - - - - - - 35 - - - 14 - - - 7 - - - - - 7 - - - - - - - 104 - - - 7 - - - - - - - 25 - - - 25 - - - 18 - - - - - 7 - - - - - 7 - - - - - 65 - - - 7 - - - - - - - 15 - - - 13 - - - 7 - - - - - 19 - - - 7 - - - - - - - 23 - - - 7 - - - - - 78 - - - 7 - - - - - - - 14 - - - - - - - 128 - - - 2 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 57 - - - 67 - - - 60 - - - 38 - - - 82 - - - 72 - - - 123 - - - 7 - - - - - - - 15 - - - 9 - - - 8 - - - 15 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 13 - - - 7 - - - - - - - 14 - - - 26 - - - 7 - - - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - - - - - 12 - - - 2 - - - 2 - - - 7 - - - - - 10 - - - 7 - - - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 7 - - - 15 - - - 15 - - - 0 - - - 7 - - - - - - - 15 - - - 10 - - - 52 - - - 13 - - - 7 - - - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 16 - - - 7 - - - - - - - 2 - - - 8 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 7 - - - 7 - - - - - 2 - - - 10 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - - - 121 - - - 10 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 44 - - - 7 - - - - - - - 8 - - - 12 - - - - - 125 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 12 - - - 7 - - - - - - - 2 - - - 7 - - - 7 - - - 24 - - - 7 - - - - - - - 10 - - - 14 - - - 7 - - - - - 16 - - - 10 - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - - - 7 - - - 7 - - - - - 15 - - - 15 - - - - - 122 - - - 7 - - - - - - - 7 - - - - - 8 - - - - - 8 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 8 - - - - - 7 - - - - - 7 - - - - - 41 - - - 7 - - - - - - - 10 - - - 10 - - - 16 - - - 25 - - - 7 - - - - - - - 2 - - - 172 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 2 - - - 91 - - - 7 - - - - - - - 2 - - - 40 - - - 7 - - - - - - - 380 - - - 7 - - - - - 15 - - - 9 - - - 7 - - - - - - - 69 - - - 7 - - - - - - - 16 - - - 9 - - - - - 2 - - - 21 - - - 7 - - - - - - - 7 - - - - - 2 - - - 20 - - - 9 - - - 2 - - - 7 - - - - - - - 8 - - - 8 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 87 - - - 7 - - - - - - - 23 - - - 7 - - - - - 7 - - - - - 23 - - - 7 - - - - - 36 - - - 7 - - - - - - - 30 - - - 7 - - - - - 15 - - - 15 - - - - - - - 10 - - - 2 - - - 7 - - - - - 29 - - - 29 - - - 7 - - - - - 38 - - - 7 - - - - - - - 10 - - - 10 - - - 46 - - - 7 - - - - - - - 43 - - - - - 2 - - - 7 - - - - - - - 92 - - - 26 - - - - - - - 15 - - - 15 - - - 76 - - - 7 - - - - - - - 10 - - - 10 - - - - - 29 - - - 23 - - - 7 - - - - - - - 7 - - - 13 - - - - - 213 - - - 7 - - - - - - - 71 - - - 23 - - - 23 - - - 7 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 115 - - - 53 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 189 - - - 69 - - - 6 - - - 7 - - - - - 9 - - - - - - - 69 - - - 7 - - - - - - - 7 - - - 10 - - - 7 - - - 7 - - - 7 - - - 9 - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 9 - - - - - 279 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 21 - - - 21 - - - 7 - - - 7 - - - - - - - 8 - - - 8 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 84 - - - 7 - - - - - - - 22 - - - 9 - - - - - 227 - - - 7 - - - - - - - 190 - - - 7 - - - - - - - 7 - - - - - 20 - - - 23 - - - 7 - - - - - - - 261 - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 44 - - - 2 - - - 228 - - - 7 - - - - - - - 14 - - - 8 - - - 20 - - - - - 71 - - - 7 - - - - - - - 7 - - - - - 31 - - - 35 - - - 7 - - - - - - - 2 - - - 44 - - - 2 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 7 - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 10 - - - 25 - - - 7 - - - - - - - 55 - - - 9 - - - - - 54 - - - 9 - - - - - 20 - - - 15 - - - 15 - - - 20 - - - 168 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 43 - - - 2 - - - 15 - - - - - 16 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 32 - - - 7 - - - - - - - 23 - - - 7 - - - - - 25 - - - 94 - - - 7 - - - - - - - 168 - - - 7 - - - - - - - 19 - - - 7 - - - - - - - 2 - - - - - 16 - - - 7 - - - - - - - 2 - - - - - 42 - - - 42 - - - 7 - - - - - 9 - - - 9 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 9 - - - 47 - - - - - 2 - - - 7 - - - - - - - 25 - - - 28 - - - 9 - - - - - 117 - - - 7 - - - - - - - 110 - - - 7 - - - - - - - 7 - - - - - 21 - - - 32 - - - 22 - - - 40 - - - 46 - - - 48 - - - 9 - - - 39 - - - 44 - - - 22 - - - 8 - - - 2 - - - 7 - - - - - 29 - - - 8 - - - - - 7 - - - - - 55 - - - 10 - - - 10 - - - - - - - 10 - - - 7 - - - - - - - 10 - - - - - 8 - - - - - 18 - - - - - 132 - - - 14 - - - 14 - - - 18 - - - 7 - - - - - - - 261 - - - 7 - - - - - - - 10 - - - - - 103 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 50 - - - 23 - - - 7 - - - - - - - 7 - - - - - 25 - - - 7 - - - - - 39 - - - 7 - - - - - - - 7 - - - - - 20 - - - 7 - - - - - 141 - - - 7 - - - - - - - 7 - - - - - 10 - - - 7 - - - - - 189 - - - 7 - - - - - - - 64 - - - 50 - - - 7 - - - - - - - 7 - - - - - 10 - - - 10 - - - 51 - - - 7 - - - - - - - 58 - - - 190 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 31 - - - 15 - - - 59 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 17 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - 2 - - - 37 - - - 7 - - - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 17 - - - 7 - - - - - - - 28 - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 20 - - - 3 - - - 2 - - - 2 - - - 12 - - - 7 - - - - - - - 15 - - - 16 - - - 9 - - - - - 15 - - - 15 - - - - - 203 - - - 7 - - - - - - - 15 - - - 16 - - - 9 - - - - - 15 - - - - - 44 - - - 7 - - - - - - - 7 - - - - - 50 - - - 50 - - - 7 - - - - - - - 14 - - - 7 - - - - - - - 2 - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - - - 38 - - - 7 - - - - - - - 8 - - - 7 - - - - - 88 - - - 7 - - - - - - - 293 - - - 7 - - - - - - - 11 - - - 7 - - - - - - - 25 - - - 27 - - - 7 - - - - - - - 16 - - - - - 22 - - - - - 36 - - - - - - - 14 - - - 8 - - - 7 - - - - - 2 - - - 15 - - - - - - - 7 - - - - - 15 - - - 8 - - - 7 - - - - - - - 0 - - - 7 - - - - - 15 - - - 25 - - - 7 - - - - - 2 - - - 7 - - - - - - - 27 - - - 15 - - - 7 - - - - - - - 147 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 43 - - - 7 - - - - - 24 - - - - - - - 42 - - - 7 - - - - - - - 10 - - - 2 - - - 10 - - - 7 - - - - - 18 - - - - - 25 - - - 7 - - - - - 12 - - - 7 - - - - - - - 82 - - - 7 - - - - - - - 82 - - - 7 - - - - - - - 26 - - - 7 - - - - - - - 64 - - - 7 - - - - - 12 - - - 19 - - - - - - - 20 - - - 81 - - - 28 - - - 39 - - - 7 - - - - - - - 10 - - - 31 - - - 27 - - - 7 - - - - - - - 15 - - - 7 - - - - - 16 - - - 7 - - - - - - - 7 - - - - - 30 - - - - - 49 - - - 7 - - - - - - - 2 - - - 10 - - - 7 - - - - - 7 - - - - - - - 10 - - - 7 - - - - - 7 - - - - - 21 - - - 7 - - - - - - - 7 - - - - - 49 - - - 7 - - - - - 22 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 16 - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 15 - - - 7 - - - - - 20 - - - 7 - - - - - - - 97 - - - 7 - - - - - 43 - - - 7 - - - - - - - 9 - - - - - 18 - - - 7 - - - - - - - 41 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 16 - - - 7 - - - - - - - 18 - - - 58 - - - 7 - - - - - - - 89 - - - - - 14 - - - 7 - - - - - 7 - - - - - - - 15 - - - 15 - - - 10 - - - 56 - - - 7 - - - - - - - 8 - - - - - 21 - - - 7 - - - - - - - 14 - - - 7 - - - - - - - 17 - - - 19 - - - 7 - - - - - - - 2 - - - 10 - - - 12 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 16 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 7 - - - 7 - - - - - 10 - - - 7 - - - - - 8 - - - 16 - - - - - 8 - - - 7 - - - - - - - 18 - - - 23 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - 14 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 22 - - - 7 - - - - - - - 59 - - - 31 - - - 7 - - - - - - - 2 - - - 19 - - - - - 9 - - - 7 - - - - - - - 2 - - - 2 - - - 20 - - - 2 - - - 7 - - - - - 26 - - - 7 - - - - - - - 109 - - - 97 - - - 7 - - - - - 25 - - - 20 - - - 21 - - - 15 - - - 14 - - - 13 - - - 18 - - - - - - - 2 - - - 10 - - - 2 - - - 101 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 10 - - - 2 - - - 2 - - - 10 - - - 10 - - - 2 - - - 2 - - - 10 - - - 2 - - - 10 - - - 10 - - - 7 - - - - - 44 - - - 2 - - - 7 - - - 21 - - - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 16 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 2 - - - 7 - - - - - 14 - - - 7 - - - - - - - 25 - - - 25 - - - 2 - - - 18 - - - - - - - 10 - - - 10 - - - 7 - - - - - 21 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 25 - - - 7 - - - - - 7 - - - - - 81 - - - 7 - - - - - - - 7 - - - - - 19 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 13 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 15 - - - 7 - - - - - 10 - - - 7 - - - - - 22 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 15 - - - 7 - - - - - - - 24 - - - 16 - - - - - - - 21 - - - 22 - - - 118 - - - 7 - - - - - - - 101 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 7 - - - - - 16 - - - 7 - - - - - - - 7 - - - 31 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 53 - - - 7 - - - - - - - 8 - - - - - 7 - - - - - 7 - - - - - 41 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 11 - - - 11 - - - 10 - - - 24 - - - 16 - - - 91 - - - 7 - - - - - - - 10 - - - 7 - - - - - - - 39 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - - - 9 - - - 9 - - - - - 8 - - - - - - - 7 - - - - - 18 - - - 18 - - - 18 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 99 - - - 7 - - - - - - - 6 - - - 7 - - - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - 7 - - - - - 185 - - - 36 - - - 7 - - - - - - - 128 - - - 7 - - - - - 2 - - - 12 - - - 7 - - - - - - - 10 - - - 7 - - - - - 15 - - - 7 - - - - - 2 - - - 15 - - - 13 - - - 7 - - - - - - - 16 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - 24 - - - 7 - - - - - 7 - - - - - 7 - - - - - 134 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 26 - - - 2 - - - 7 - - - - - 42 - - - 42 - - - 7 - - - - - 7 - - - 7 - - - - - - - 7 - - - - - 2 - - - 13 - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 17 - - - 22 - - - 10 - - - 10 - - - 17 - - - 17 - - - 17 - - - 23 - - - 23 - - - 19 - - - 19 - - - 19 - - - 19 - - - 19 - - - - - 10 - - - 7 - - - - - - - 24 - - - 27 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - 17 - - - 12 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 9 - - - 7 - - - - - 17 - - - 7 - - - - - - - 31 - - - 15 - - - 20 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 15 - - - 7 - - - - - 16 - - - 28 - - - 7 - - - - - - - 7 - - - - - 15 - - - 7 - - - - - 16 - - - 7 - - - - - 28 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 10 - - - 2 - - - 38 - - - 7 - - - - - 20 - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - 8 - - - 7 - - - - - - - 7 - - - - - 15 - - - 7 - - - - - 15 - - - - - 23 - - - 7 - - - - - - - 2 - - - 21 - - - 7 - - - - - - - 7 - - - - - 10 - - - 10 - - - 52 - - - 7 - - - - - - - 7 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 108 - - - 7 - - - - - 14 - - - 16 - - - - - - - 7 - - - 23 - - - 2 - - - - - 23 - - - - - 7 - - - 7 - - - 10 - - - 7 - - - 14 - - - - - 210 - - - 7 - - - - - - - 14 - - - 8 - - - - - 12 - - - 47 - - - 15 - - - - - 98 - - - 7 - - - - - - - 964 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 22 - - - 7 - - - - - - - 0 - - - 7 - - - - - 10 - - - 7 - - - - - 35 - - - 7 - - - - - - - 7 - - - - - 15 - - - 13 - - - 15 - - - - - 8 - - - 20 - - - - - 39 - - - 7 - - - - - - - 0 - - - 18 - - - 7 - - - - - 18 - - - 15 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - 64 - - - 7 - - - - - - - 10 - - - 128 - - - - - - - 10 - - - 7 - - - - - 7 - - - - - 17 - - - 30 - - - 7 - - - - - - - 36 - - - 12 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 22 - - - 7 - - - - - - - 20 - - - - - 9 - - - - - 10 - - - 7 - - - 7 - - - 7 - - - - - - - 48 - - - - - 29 - - - - - 10 - - - 8 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 44 - - - 7 - - - - - - - 22 - - - 7 - - - - - - - 159 - - - 7 - - - - - 10 - - - 2 - - - 2 - - - 7 - - - - - 7 - - - - - - - 32 - - - 63 - - - - - - - 7 - - - - - 10 - - - 7 - - - - - 22 - - - 7 - - - - - - - 10 - - - 22 - - - 17 - - - 62 - - - 7 - - - - - - - 0 - - - 7 - - - - - 16 - - - 2 - - - 13 - - - 7 - - - - - - - 2 - - - - - 17 - - - 7 - - - - - - - 2 - - - - - 2 - - - - - - - 2 - - - 17 - - - 7 - - - - - - - 7 - - - - - 11 - - - 7 - - - - - 15 - - - 7 - - - - - 7 - - - - - 13 - - - 7 - - - - - 14 - - - 7 - - - - - 40 - - - - - - - 2 - - - 20 - - - 7 - - - - - 16 - - - 7 - - - - - - - 0 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 122 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - 2 - - - 15 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 7 - - - - - 15 - - - 15 - - - 7 - - - - - 26 - - - 7 - - - - - - - 12 - - - 7 - - - - - 61 - - - 7 - - - - - 31 - - - 7 - - - - - - - 111 - - - 7 - - - - - - - 71 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 15 - - - 122 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 11 - - - 18 - - - - - 82 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 11 - - - 18 - - - - - 139 - - - 7 - - - - - 7 - - - 7 - - - 7 - - - 7 - - - 123 - - - 132 - - - 258 - - - 36 - - - - - - - 10 - - - 357 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 15 - - - 40 - - - 6 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - - - 30 - - - 15 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - - - 82 - - - 7 - - - - - 15 - - - 40 - - - 6 - - - 7 - - - - - - - 16 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 48 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - - - 11 - - - 7 - - - - - 19 - - - 41 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - - - 26 - - - 15 - - - - - 26 - - - 15 - - - - - 57 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 36 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - - - 51 - - - 182 - - - 21 - - - 15 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 211 - - - 83 - - - 6 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 27 - - - 7 - - - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 120 - - - 16 - - - - - 14 - - - 8 - - - 7 - - - - - - - 13 - - - 7 - - - 13 - - - 7 - - - 142 - - - 7 - - - - - 13 - - - 7 - - - 13 - - - 7 - - - 12 - - - 7 - - - - - - - 14 - - - 8 - - - 301 - - - 7 - - - - - - - 14 - - - 8 - - - 0 - - - 0 - - - 12 - - - 7 - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 7 - - - - - - - 14 - - - 8 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 7 - - - - - 8 - - - 7 - - - - - - - 14 - - - 8 - - - 9 - - - - - 2 - - - 7 - - - - - - - 91 - - - 562 - - - 7 - - - - - 15 - - - 32 - - - 26 - - - - - - - 86 - - - 7 - - - - - - - 42 - - - 29 - - - 7 - - - - - - - 16 - - - 16 - - - 9 - - - - - 14 - - - 8 - - - 7 - - - 16 - - - 24 - - - 27 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 29 - - - 25 - - - 28 - - - 25 - - - 25 - - - 28 - - - 28 - - - 19 - - - 21 - - - 21 - - - 22 - - - 21 - - - 26 - - - 9 - - - - - 15 - - - 15 - - - - - 16 - - - 9 - - - - - 42 - - - 42 - - - 41 - - - 9 - - - 15 - - - 14 - - - 2 - - - 7 - - - 16 - - - - - 15 - - - 111 - - - 28 - - - 15 - - - - - 10 - - - 2 - - - 15 - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 57 - - - 10 - - - 91 - - - 228 - - - 100 - - - 118 - - - 130 - - - 191 - - - 134 - - - 159 - - - 143 - - - 247 - - - 143 - - - 102 - - - 120 - - - 132 - - - 129 - - - 174 - - - 175 - - - 175 - - - 141 - - - 162 - - - 162 - - - 93 - - - 382 - - - 238 - - - 198 - - - 97 - - - 166 - - - 109 - - - 146 - - - 116 - - - 200 - - - 244 - - - 109 - - - 123 - - - 127 - - - 100 - - - 92 - - - 127 - - - 108 - - - 196 - - - 110 - - - 100 - - - 71 - - - 125 - - - 228 - - - 89 - - - 121 - - - 172 - - - 171 - - - 302 - - - 180 - - - 184 - - - 108 - - - 60 - - - 63 - - - 55 - - - 45 - - - 60 - - - 68 - - - 63 - - - 73 - - - 73 - - - 73 - - - 60 - - - 60 - - - 73 - - - 63 - - - 83 - - - 84 - - - 94 - - - 103 - - - 110 - - - 239 - - - 123 - - - 119 - - - 98 - - - 164 - - - 102 - - - 142 - - - 87 - - - 89 - - - 133 - - - 82 - - - 83 - - - 86 - - - 96 - - - 105 - - - 100 - - - 185 - - - 130 - - - 192 - - - 135 - - - 197 - - - 186 - - - 119 - - - 169 - - - 126 - - - 209 - - - 175 - - - 120 - - - 168 - - - 117 - - - 147 - - - 170 - - - 133 - - - 128 - - - 125 - - - 102 - - - 160 - - - 114 - - - 313 - - - 213 - - - 116 - - - 184 - - - 130 - - - 192 - - - 198 - - - 162 - - - 198 - - - 164 - - - 100 - - - 155 - - - 126 - - - 209 - - - 209 - - - 103 - - - 147 - - - 170 - - - 100 - - - 170 - - - 131 - - - 209 - - - 209 - - - 103 - - - 147 - - - 170 - - - 91 - - - 139 - - - 90 - - - 156 - - - 163 - - - 169 - - - 262 - - - 111 - - - 156 - - - 100 - - - 155 - - - 126 - - - 209 - - - 209 - - - 103 - - - 147 - - - 170 - - - 100 - - - 170 - - - 126 - - - 209 - - - 209 - - - 103 - - - 147 - - - 170 - - - 405 - - - 293 - - - 133 - - - 64 - - - 114 - - - 92 - - - 40 - - - 105 - - - 110 - - - 64 - - - 92 - - - 303 - - - 251 - - - 125 - - - 67 - - - 119 - - - 101 - - - 185 - - - 130 - - - 192 - - - 134 - - - 201 - - - 111 - - - 132 - - - 185 - - - 134 - - - 195 - - - 138 - - - 203 - - - 111 - - - 199 - - - 123 - - - 195 - - - 136 - - - 124 - - - 127 - - - 73 - - - 93 - - - 131 - - - 98 - - - 142 - - - 122 - - - 133 - - - 98 - - - 88 - - - 92 - - - 140 - - - 100 - - - 89 - - - 93 - - - 65 - - - 137 - - - 121 - - - 159 - - - 104 - - - 124 - - - 124 - - - 86 - - - 83 - - - 94 - - - 62 - - - 99 - - - 253 - - - 376 - - - 183 - - - 54 - - - 71 - - - 114 - - - 72 - - - 106 - - - 74 - - - 105 - - - 115 - - - 135 - - - 131 - - - 150 - - - 149 - - - 119 - - - 167 - - - 126 - - - 209 - - - 175 - - - 120 - - - 168 - - - 117 - - - 147 - - - 170 - - - 133 - - - 142 - - - 130 - - - 162 - - - 383 - - - 187 - - - 177 - - - 198 - - - 98 - - - 168 - - - 74 - - - 76 - - - 74 - - - 101 - - - 86 - - - 100 - - - 153 - - - 160 - - - 169 - - - 259 - - - 153 - - - 146 - - - 101 - - - 119 - - - 131 - - - 192 - - - 135 - - - 161 - - - 114 - - - 147 - - - 143 - - - 162 - - - 158 - - - 128 - - - 188 - - - 133 - - - 124 - - - 81 - - - 145 - - - 86 - - - 114 - - - 104 - - - 104 - - - 86 - - - 81 - - - 75 - - - 112 - - - 68 - - - 48 - - - 98 - - - 142 - - - 141 - - - 10 - - - 48 - - - 11 - - - 10 - - - 9 - - - 80 - - - 187 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 25 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 199 - - - - - - - 2 - - - 122 - - - 173 - - - 7 - - - - - 7 - - - - - - - 164 - - - - - 14 - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - 7 - - - - - 394 - - - 7 - - - - - 7 - - - - - - - 57 - - - 48 - - - 358 - - - 7 - - - - - - - 53 - - - 10 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - 11 - - - 2 - - - 339 - - - 583 - - - 7 - - - - - - - 11 - - - 231 - - - 22 - - - 7 - - - - - 7 - - - - - - - 296 - - - 26 - - - 7 - - - - - 7 - - - - - - - 200 - - - 10 - - - 7 - - - - - 50 - - - 7 - - - - - 7 - - - - - - - 13 - - - 7 - - - - - 125 - - - 2 - - - 7 - - - - - 7 - - - - - - - 10 - - - 2 - - - 68 - - - - - 15 - - - 7 - - - - - - - 66 - - - 37 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 148 - - - 15 - - - 6 - - - 7 - - - - - 7 - - - - - - - 14 - - - 8 - - - 7 - - - - - 67 - - - 51 - - - 21 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 336 - - - 69 - - - 6 - - - 7 - - - - - 7 - - - - - - - 10 - - - 191 - - - - - - - 152 - - - 7 - - - - - 7 - - - - - - - 20 - - - 7 - - - 2 - - - - - - - 7 - - - - - 7 - - - - - 156 - - - 7 - - - - - - - 33 - - - 84 - - - 7 - - - - - - - 226 - - - - - 14 - - - 7 - - - - - 7 - - - - - - - 21 - - - 7 - - - - - 59 - - - - - 7 - - - - - - - 8 - - - - - 16 - - - 45 - - - - - - - 2 - - - - - 59 - - - 84 - - - 2 - - - 9 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 2 - - - 7 - - - - - 9 - - - 222 - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 40 - - - 7 - - - - - 7 - - - 7 - - - - - 15 - - - 7 - - - - - - - 14 - - - 8 - - - 27 - - - 9 - - - 14 - - - 8 - - - 1210 - - - 19 - - - - - - - 16 - - - - - 185 - - - 7 - - - - - - - 13 - - - 7 - - - - - 13 - - - 7 - - - - - - - 10 - - - 11 - - - - - 10 - - - 11 - - - - - 10 - - - - - 11 - - - 10 - - - - - 10 - - - 84 - - - - - - - 14 - - - - - 13 - - - 7 - - - - - - - 14 - - - - - 14 - - - - - 24 - - - 7 - - - - - - - 18 - - - 14 - - - - - 31 - - - 7 - - - - - - - 2 - - - 2 - - - - - 2 - - - 16 - - - 7 - - - - - - - 22 - - - 7 - - - - - - - 2 - - - - - 12 - - - 7 - - - - - - - 16 - - - - - 21 - - - - - 2 - - - 7 - - - - - - - 33 - - - 7 - - - - - 10 - - - - - - - 64 - - - 7 - - - - - 14 - - - 7 - - - - - 68 - - - - - - - 10 - - - 24 - - - - - - - 8 - - - 8 - - - 2 - - - 2 - - - - - - - 23 - - - 10 - - - 2 - - - - - - - 10 - - - 10 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 14 - - - 14 - - - 45 - - - 7 - - - - - - - 46 - - - - - - - 10 - - - 7 - - - - - 15 - - - - - 19 - - - 7 - - - - - - - 20 - - - 11 - - - - - 173 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 14 - - - 2 - - - 7 - - - - - 2 - - - - - - - 8 - - - 2 - - - 7 - - - - - 2 - - - - - - - 16 - - - 7 - - - - - - - 2 - - - 2 - - - - - - - 2 - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 10 - - - - - 36 - - - 7 - - - - - - - 14 - - - - - 18 - - - 15 - - - 7 - - - - - - - 7 - - - - - 10 - - - 10 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 58 - - - 10 - - - 10 - - - - - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 15 - - - 2 - - - 7 - - - - - - - 2 - - - - - 2 - - - - - 9 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 21 - - - 7 - - - - - 10 - - - 2 - - - - - - - 7 - - - - - 2 - - - - - 10 - - - 10 - - - 14 - - - 2 - - - 7 - - - - - - - 2 - - - 8 - - - - - - - 2 - - - 2 - - - - - - - 14 - - - 7 - - - - - 7 - - - - - 10 - - - 11 - - - - - 44 - - - 7 - - - - - - - 12 - - - - - 2 - - - 7 - - - - - 2 - - - 21 - - - 46 - - - 7 - - - - - - - 9 - - - 38 - - - - - 14 - - - - - 21 - - - 7 - - - - - - - 10 - - - - - 10 - - - - - 40 - - - 7 - - - - - - - 2 - - - - - 19 - - - 7 - - - - - - - 2 - - - 25 - - - 15 - - - - - 13 - - - 7 - - - - - - - 2 - - - 2 - - - - - 8 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - - - 18 - - - 2 - - - 7 - - - - - - - 23 - - - - - 368 - - - 14 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 102 - - - 94 - - - 2 - - - 7 - - - - - - - 15 - - - 7 - - - - - - - 42 - - - 17 - - - - - - - 23 - - - 52 - - - 88 - - - - - - - 14 - - - 2 - - - 7 - - - - - - - 198 - - - 7 - - - - - - - 151 - - - 7 - - - - - - - 13 - - - 7 - - - - - 10 - - - 2 - - - - - - - 21 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 2 - - - 12 - - - 7 - - - - - 14 - - - 7 - - - - - - - 21 - - - 7 - - - - - - - 313 - - - 7 - - - - - - - 14 - - - 7 - - - - - 63 - - - 7 - - - - - - - 2 - - - 45 - - - 2 - - - - - 22 - - - 7 - - - - - - - 15 - - - 9 - - - 18 - - - - - 85 - - - 7 - - - - - - - 1280 - - - 7 - - - - - 7 - - - - - 29 - - - - - 51 - - - - - 54 - - - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 2 - - - 23 - - - 53 - - - 7 - - - - - - - 43 - - - 7 - - - 34 - - - - - - - 271 - - - 7 - - - - - - - 57 - - - 39 - - - 7 - - - - - - - 14 - - - 8 - - - 21 - - - 7 - - - - - 50 - - - 7 - - - - - - - 7 - - - - - 14 - - - 8 - - - 7 - - - - - 7 - - - - - 71 - - - 71 - - - - - 21 - - - 7 - - - - - - - 66 - - - 7 - - - - - - - 14 - - - 8 - - - 7 - - - - - 51 - - - 104 - - - 7 - - - - - - - 14 - - - - - 43 - - - 7 - - - - - - - 2 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 17 - - - 7 - - - - - - - 2 - - - 7 - - - - - 21 - - - 22 - - - 8 - - - - - 14 - - - 19 - - - 143 - - - 15 - - - 6 - - - 7 - - - - - - - 15 - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 30 - - - 44 - - - 15 - - - 18 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 204 - - - 69 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 232 - - - 64 - - - 6 - - - 7 - - - - - - - 0 - - - 30 - - - 9 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 38 - - - 1 - - - 6 - - - 7 - - - - - - - 32 - - - 51 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 197 - - - 69 - - - 6 - - - 7 - - - - - - - 21 - - - - - 16 - - - 51 - - - - - 128 - - - 37 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 192 - - - 15 - - - 6 - - - 7 - - - - - - - 16 - - - 36 - - - 7 - - - - - 30 - - - 35 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 197 - - - 64 - - - 6 - - - 7 - - - - - - - 137 - - - 23 - - - 29 - - - 14 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 91 - - - 15 - - - 6 - - - 7 - - - - - - - 37 - - - 89 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 137 - - - 15 - - - 6 - - - 7 - - - - - - - 51 - - - 185 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 110 - - - 15 - - - 6 - - - 7 - - - - - - - 7 - - - - - 14 - - - 8 - - - 7 - - - - - 15 - - - 14 - - - 22 - - - 18 - - - - - 7 - - - - - 157 - - - 7 - - - - - 14 - - - 19 - - - 184 - - - 64 - - - 6 - - - 7 - - - - - - - 2 - - - 37 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 124 - - - 15 - - - 6 - - - 7 - - - - - - - 20 - - - 44 - - - 7 - - - - - 63 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 225 - - - 83 - - - 6 - - - 7 - - - - - - - 10 - - - 12 - - - 7 - - - - - 2 - - - 7 - - - - - 35 - - - 24 - - - - - 12 - - - 30 - - - 145 - - - 14 - - - 8 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 82 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 93 - - - 15 - - - 6 - - - 7 - - - - - - - 37 - - - 7 - - - - - 9 - - - - - 130 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 189 - - - 69 - - - 6 - - - 7 - - - - - - - 30 - - - 7 - - - - - 44 - - - 15 - - - 7 - - - - - 44 - - - 65 - - - 15 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 77 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 195 - - - 69 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 195 - - - 69 - - - 6 - - - 7 - - - - - - - 23 - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 37 - - - 1 - - - 6 - - - 7 - - - - - - - 23 - - - 57 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 78 - - - 15 - - - 6 - - - 7 - - - - - - - 51 - - - 34 - - - 64 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 203 - - - 69 - - - 6 - - - 7 - - - - - 14 - - - 7 - - - - - - - 72 - - - 23 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 77 - - - 15 - - - 6 - - - 7 - - - - - - - 23 - - - 72 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 29 - - - 150 - - - 57 - - - 6 - - - 7 - - - - - 12 - - - 7 - - - - - - - 12 - - - 7 - - - - - 23 - - - 78 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 74 - - - 1 - - - 6 - - - 7 - - - - - - - 23 - - - 23 - - - 180 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 271 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 200 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 328 - - - 12 - - - 11 - - - 9 - - - 14 - - - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 17 - - - 20 - - - 36 - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 16 - - - 62 - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 22 - - - 116 - - - 14 - - - 15 - - - 7 - - - - - - - 16 - - - 14 - - - 16 - - - 147 - - - 38 - - - 38 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 19 - - - 7 - - - - - 18 - - - 7 - - - - - - - 27 - - - 27 - - - 18 - - - 18 - - - 18 - - - 18 - - - 18 - - - 18 - - - 18 - - - 18 - - - 18 - - - 18 - - - 2 - - - 44 - - - 31 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 38 - - - 7 - - - - - 77 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 208 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 344 - - - 12 - - - 12 - - - 11 - - - 12 - - - 11 - - - 13 - - - 12 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 10 - - - 10 - - - 114 - - - 13 - - - 14 - - - 13 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 98 - - - 7 - - - - - 15 - - - 15 - - - 15 - - - 7 - - - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - - - 38 - - - 7 - - - - - 2 - - - 7 - - - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 43 - - - 78 - - - 7 - - - - - 10 - - - 7 - - - - - - - 2 - - - 36 - - - 6 - - - 7 - - - - - 13 - - - 20 - - - 43 - - - 77 - - - 14 - - - 9 - - - 7 - - - 7 - - - - - - - 2 - - - 15 - - - 9 - - - 7 - - - - - - - 40 - - - 139 - - - - - 128 - - - 14 - - - 7 - - - - - 22 - - - 7 - - - - - - - 35 - - - 2 - - - 7 - - - - - 8 - - - - - 58 - - - 7 - - - - - - - 76 - - - 12 - - - 9 - - - 7 - - - - - - - 34 - - - 2 - - - 2 - - - - - 21 - - - 7 - - - - - - - 37 - - - 2 - - - 2 - - - 7 - - - - - 28 - - - 7 - - - - - - - 7 - - - 38 - - - - - 10 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 13 - - - 20 - - - 43 - - - 108 - - - 14 - - - 9 - - - 7 - - - 7 - - - - - - - 7 - - - - - 137 - - - 15 - - - 10 - - - 56 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 60 - - - 14 - - - 7 - - - - - - - 22 - - - 90 - - - 20 - - - 7 - - - - - - - 14 - - - - - 10 - - - 21 - - - 43 - - - 7 - - - - - 24 - - - 47 - - - 13 - - - 7 - - - - - - - 12 - - - 15 - - - - - 60 - - - 13 - - - - - - - 36 - - - 2 - - - 2 - - - 7 - - - - - - - 72 - - - 10 - - - 10 - - - 14 - - - 14 - - - 7 - - - - - - - 7 - - - - - 10 - - - 53 - - - 9 - - - 7 - - - - - - - 7 - - - - - 104 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 2181 - - - 16 - - - 17 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 18 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 15 - - - 10 - - - 10 - - - 15 - - - 10 - - - 10 - - - 15 - - - 16 - - - 15 - - - 15 - - - 15 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 18 - - - 15 - - - 18 - - - 23 - - - 20 - - - 10 - - - 10 - - - 16 - - - 10 - - - 15 - - - 16 - - - 10 - - - 15 - - - 16 - - - 10 - - - 15 - - - 10 - - - 10 - - - 10 - - - 10 - - - 17 - - - 10 - - - 7 - - - - - 39 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 15 - - - 15 - - - 15 - - - 15 - - - 55 - - - 10 - - - 7 - - - - - - - 528 - - - 10 - - - 11 - - - 10 - - - 11 - - - 7 - - - - - - - 197 - - - 13 - - - 13 - - - 12 - - - 7 - - - - - - - 589 - - - 12 - - - 10 - - - 12 - - - 10 - - - 7 - - - - - - - 1354 - - - 10 - - - 10 - - - 10 - - - 12 - - - 10 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 19 - - - 15 - - - 15 - - - 19 - - - 15 - - - 15 - - - 10 - - - 7 - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 36 - - - 7 - - - - - - - 423 - - - 18 - - - 15 - - - 18 - - - 23 - - - 26 - - - 15 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 765 - - - 16 - - - 13 - - - 16 - - - 16 - - - 15 - - - 33 - - - 16 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 7 - - - 96 - - - 109 - - - 199 - - - 28 - - - - - 20 - - - 20 - - - 20 - - - 15 - - - 7 - - - - - - - 15 - - - 15 - - - - - 38 - - - - - 171 - - - 10 - - - 25 - - - 7 - - - - - - - 7 - - - - - 981 - - - 15 - - - 15 - - - 31 - - - 15 - - - 15 - - - 16 - - - 30 - - - 41 - - - 15 - - - 15 - - - 31 - - - 15 - - - 15 - - - 16 - - - 20 - - - 15 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 7 - - - - - 7 - - - - - 781 - - - 15 - - - 15 - - - 16 - - - 20 - - - 47 - - - 15 - - - 15 - - - 16 - - - 20 - - - 47 - - - 15 - - - 15 - - - 10 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 303 - - - 13 - - - 13 - - - 12 - - - 13 - - - 12 - - - 7 - - - - - - - 109 - - - 502 - - - 20 - - - 117 - - - 18 - - - 44 - - - 21 - - - 118 - - - 16 - - - 14 - - - 14 - - - 17 - - - 15 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 22 - - - 7 - - - - - 23 - - - 7 - - - - - - - 2 - - - 48 - - - 10 - - - 7 - - - - - 10 - - - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - 7 - - - - - - - 14 - - - 8 - - - 7 - - - - - 10 - - - 10 - - - - - 2 - - - 2 - - - 39 - - - 7 - - - - - 118 - - - 7 - - - - - - - 7 - - - - - 51 - - - - - 79 - - - 14 - - - 13 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 93 - - - 15 - - - 6 - - - 7 - - - - - - - 13 - - - 28 - - - 32 - - - 33 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 74 - - - 16 - - - 22 - - - 7 - - - - - 74 - - - 16 - - - 22 - - - 7 - - - - - - - 169 - - - 10 - - - 7 - - - - - - - 10 - - - 10 - - - 658 - - - 50 - - - 19 - - - 39 - - - 39 - - - 39 - - - 39 - - - 39 - - - 18 - - - 23 - - - 39 - - - 23 - - - 20 - - - 39 - - - 39 - - - 10 - - - 39 - - - 39 - - - 10 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 17 - - - 7 - - - - - 22 - - - 7 - - - - - 17 - - - 7 - - - - - 17 - - - 7 - - - - - 16 - - - 7 - - - - - 16 - - - 7 - - - - - 27 - - - 7 - - - - - 17 - - - 7 - - - - - 17 - - - 7 - - - - - 17 - - - 7 - - - - - 17 - - - 7 - - - - - - - 2 - - - 10 - - - 7 - - - 45 - - - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 51 - - - 43 - - - 89 - - - 15 - - - 22 - - - 11 - - - - - 15 - - - - - 139 - - - 15 - - - 16 - - - 15 - - - 24 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 98 - - - - - 15 - - - 48 - - - 7 - - - - - 49 - - - 7 - - - - - - - 59 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 31 - - - 36 - - - 7 - - - - - - - 14 - - - 8 - - - 14 - - - 8 - - - 14 - - - 8 - - - 7 - - - - - 362 - - - 15 - - - 15 - - - 15 - - - - - - - 7 - - - - - 23 - - - 57 - - - 20 - - - 14 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 44 - - - 8 - - - 162 - - - 15 - - - 16 - - - 75 - - - 26 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 14 - - - 8 - - - - - 7 - - - - - 10 - - - - - 80 - - - 15 - - - 14 - - - 7 - - - - - - - 152 - - - 9 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - 82 - - - 55 - - - 15 - - - 7 - - - - - 24 - - - 7 - - - - - - - 222 - - - 54 - - - 15 - - - 10 - - - 7 - - - - - 7 - - - 7 - - - 69 - - - 86 - - - 142 - - - 21 - - - - - - - 14 - - - 10 - - - 10 - - - 201 - - - 9 - - - - - 14 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - - - 10 - - - 22 - - - 15 - - - 100 - - - 7 - - - - - - - 31 - - - 2 - - - 2 - - - 336 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 378 - - - 7 - - - - - - - 29 - - - 19 - - - 35 - - - 16 - - - 160 - - - 7 - - - - - - - 10 - - - 289 - - - 7 - - - - - - - 2 - - - 7 - - - 2 - - - 25 - - - 2 - - - 10 - - - 5 - - - 147 - - - 7 - - - - - - - 12 - - - 59 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 51 - - - 7 - - - - - - - 2 - - - 16 - - - 7 - - - - - - - 49 - - - 15 - - - 8 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 161 - - - 7 - - - - - - - 9 - - - 7 - - - - - 8 - - - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 274 - - - 7 - - - - - - - 12 - - - 54 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 12 - - - 11 - - - 12 - - - 7 - - - - - 175 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 37 - - - 7 - - - - - - - 2 - - - 81 - - - 7 - - - - - - - 79 - - - 57 - - - 7 - - - - - - - 18 - - - - - 2 - - - 2 - - - 114 - - - 7 - - - - - - - 2 - - - 21 - - - 7 - - - - - - - 72 - - - 2 - - - 14 - - - 14 - - - 7 - - - - - - - 2 - - - 21 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 18 - - - 23 - - - 18 - - - 18 - - - 26 - - - 30 - - - 27 - - - 56 - - - 282 - - - 17 - - - 24 - - - 23 - - - 29 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 88 - - - 15 - - - 6 - - - 7 - - - - - 7 - - - 39 - - - 63 - - - 67 - - - 14 - - - - - 23 - - - 7 - - - - - - - 2 - - - 56 - - - 75 - - - 11 - - - 17 - - - 21 - - - - - - - 2 - - - 46 - - - 27 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 14 - - - 8 - - - 7 - - - - - 2 - - - 7 - - - - - - - 246 - - - 7 - - - - - - - 15 - - - 15 - - - - - 75 - - - 7 - - - - - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 42 - - - - - - - 49 - - - 49 - - - 58 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 64 - - - 2 - - - 7 - - - - - - - 2 - - - 18 - - - 7 - - - - - 2 - - - 9 - - - 7 - - - - - 10 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 38 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 14 - - - 9 - - - 2 - - - 61 - - - 7 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 14 - - - - - 10 - - - 58 - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - 7 - - - 10 - - - 7 - - - - - - - 25 - - - 7 - - - - - - - 13 - - - 7 - - - 7 - - - - - - - 20 - - - 7 - - - - - 110 - - - 7 - - - - - - - 8 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - - - 17 - - - 26 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 69 - - - 20 - - - 7 - - - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 71 - - - 16 - - - 14 - - - 7 - - - - - - - 14 - - - 8 - - - 43 - - - 15 - - - - - 44 - - - 22 - - - 7 - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 136 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 165 - - - 7 - - - - - - - 2 - - - 18 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 2 - - - 36 - - - 2 - - - 23 - - - 2 - - - 40 - - - 2 - - - 30 - - - 2 - - - 43 - - - 2 - - - 39 - - - 2 - - - 48 - - - 2 - - - 48 - - - 2 - - - 28 - - - 2 - - - 68 - - - 2 - - - 76 - - - 16 - - - 2 - - - 7 - - - - - 11 - - - 7 - - - - - - - 10 - - - 9 - - - 13 - - - 10 - - - 7 - - - - - - - 21 - - - - - 32 - - - - - 114 - - - 7 - - - - - - - 15 - - - - - 15 - - - - - 292 - - - 7 - - - - - - - 0 - - - 7 - - - - - 10 - - - 15 - - - 7 - - - - - 19 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 41 - - - 23 - - - 427 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 28 - - - 101 - - - 97 - - - 7 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 107 - - - 7 - - - - - - - 31 - - - 7 - - - - - - - 20 - - - 27 - - - 7 - - - - - - - 21 - - - 30 - - - 7 - - - - - - - 14 - - - 34 - - - 7 - - - - - - - 22 - - - 31 - - - 7 - - - - - - - 5 - - - 22 - - - 5 - - - 22 - - - 10 - - - 7 - - - - - - - 23 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 16 - - - 7 - - - - - 7 - - - - - 7 - - - - - 51 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 33 - - - 19 - - - - - - - 10 - - - 7 - - - - - - - 10 - - - 15 - - - 10 - - - 7 - - - - - 8 - - - - - 26 - - - 9 - - - - - 45 - - - 7 - - - - - - - 322 - - - 21 - - - 16 - - - 7 - - - - - - - 154 - - - 7 - - - - - - - 22 - - - 104 - - - 7 - - - - - - - 10 - - - 7 - - - 7 - - - - - 14 - - - 7 - - - - - - - 14 - - - 10 - - - 125 - - - 7 - - - - - - - 21 - - - 21 - - - 31 - - - 37 - - - 2 - - - 7 - - - - - - - 25 - - - 32 - - - 62 - - - 29 - - - 50 - - - 116 - - - 55 - - - 32 - - - 32 - - - - - 158 - - - 7 - - - - - - - 2 - - - 46 - - - 7 - - - - - - - 45 - - - 7 - - - - - - - 15 - - - - - 15 - - - - - 194 - - - 7 - - - - - 15 - - - 9 - - - 10 - - - 14 - - - 7 - - - - - - - 156 - - - 7 - - - - - - - 20 - - - 7 - - - - - 36 - - - 7 - - - - - - - 10 - - - 20 - - - - - - - 15 - - - - - 10 - - - 7 - - - - - - - 75 - - - 7 - - - - - - - 22 - - - 25 - - - 103 - - - 7 - - - - - - - 9 - - - 9 - - - 9 - - - 40 - - - 7 - - - - - 19 - - - 9 - - - 9 - - - 40 - - - 7 - - - - - 2 - - - 2 - - - 94 - - - 7 - - - - - - - 2 - - - 7 - - - - - 14 - - - 14 - - - 50 - - - 7 - - - - - - - 9 - - - 9 - - - 17 - - - 7 - - - - - 92 - - - 7 - - - - - - - 16 - - - 123 - - - 7 - - - - - - - 22 - - - 7 - - - - - - - 14 - - - 9 - - - 14 - - - 26 - - - 39 - - - - - - - 10 - - - 10 - - - 11 - - - 7 - - - - - 10 - - - 10 - - - 11 - - - 7 - - - - - 192 - - - 7 - - - - - - - 50 - - - 33 - - - 7 - - - 7 - - - - - - - 61 - - - 36 - - - 37 - - - 32 - - - 7 - - - - - - - 10 - - - 15 - - - - - 42 - - - 42 - - - 7 - - - - - - - 9 - - - 28 - - - 50 - - - - - - - 2 - - - 7 - - - - - - - 16 - - - 7 - - - 25 - - - - - - - 352 - - - 7 - - - - - - - 14 - - - 14 - - - 14 - - - 10 - - - 11 - - - 10 - - - 15 - - - 8 - - - - - 14 - - - 14 - - - 14 - - - 10 - - - 11 - - - 10 - - - 15 - - - 9 - - - - - 132 - - - 7 - - - - - 346 - - - 7 - - - - - - - 10 - - - 10 - - - 11 - - - 7 - - - - - 11 - - - 14 - - - 72 - - - 429 - - - 107 - - - 7 - - - - - 16 - - - 10 - - - 7 - - - - - 12 - - - 7 - - - - - 13 - - - 7 - - - - - 12 - - - 7 - - - - - 13 - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - 14 - - - 7 - - - - - 7 - - - - - 15 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 42 - - - 42 - - - 42 - - - 42 - - - 162 - - - 8 - - - 27 - - - 8 - - - 7 - - - 7 - - - - - 40 - - - 40 - - - 10 - - - 100 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 40 - - - 40 - - - 24 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - - - 73 - - - 7 - - - - - - - 10 - - - 18 - - - - - - - 2 - - - 7 - - - - - 14 - - - 10 - - - 7 - - - - - - - 112 - - - 7 - - - - - - - 2 - - - 9 - - - 94 - - - 7 - - - - - - - 10 - - - 7 - - - 41 - - - 22 - - - 41 - - - 81 - - - 18 - - - 75 - - - 44 - - - 38 - - - 29 - - - 61 - - - 24 - - - 36 - - - 78 - - - 41 - - - 66 - - - 68 - - - 34 - - - 41 - - - 15 - - - 34 - - - 31 - - - 44 - - - 85 - - - 48 - - - 23 - - - 22 - - - 24 - - - 26 - - - 41 - - - 95 - - - 15 - - - 12 - - - 26 - - - 36 - - - 46 - - - 31 - - - 10 - - - 27 - - - 7 - - - - - - - 52 - - - 7 - - - - - 30 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 21 - - - - - 233 - - - 7 - - - - - - - 15 - - - - - 109 - - - 7 - - - - - - - 2 - - - 7 - - - - - 14 - - - 10 - - - 7 - - - - - - - 20 - - - 20 - - - 20 - - - 20 - - - 7 - - - - - 134 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 70 - - - 10 - - - 7 - - - - - - - 15 - - - 10 - - - 19 - - - 19 - - - - - - - 28 - - - - - 9 - - - 14 - - - - - 22 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 22 - - - 33 - - - 22 - - - 10 - - - 10 - - - 9 - - - 29 - - - 51 - - - 27 - - - 83 - - - 10 - - - 7 - - - - - - - 10 - - - 10 - - - 42 - - - 7 - - - - - - - 10 - - - 27 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 20 - - - 47 - - - 8 - - - - - - - 34 - - - 90 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 15 - - - 84 - - - 7 - - - - - - - 41 - - - 62 - - - 7 - - - - - - - 14 - - - - - 29 - - - 7 - - - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 15 - - - 9 - - - 14 - - - - - 15 - - - 2 - - - 7 - - - - - 120 - - - 7 - - - - - - - 53 - - - 20 - - - 20 - - - 20 - - - 7 - - - - - - - 15 - - - 9 - - - 2 - - - 7 - - - - - 15 - - - 9 - - - 56 - - - 21 - - - 14 - - - - - - - 25 - - - 7 - - - - - - - 22 - - - 22 - - - 741 - - - 499 - - - 42 - - - 132 - - - 7 - - - 49 - - - - - - - 15 - - - 15 - - - - - 19 - - - 19 - - - - - 19 - - - 19 - - - - - 19 - - - 19 - - - - - 19 - - - 19 - - - - - 15 - - - 20 - - - 20 - - - - - 15 - - - 20 - - - 20 - - - - - 297 - - - 32 - - - 7 - - - - - - - 34 - - - 15 - - - - - 15 - - - 8 - - - - - 38 - - - - - 40 - - - 30 - - - - - 28 - - - 27 - - - - - 7 - - - - - - - 15 - - - 16 - - - 9 - - - - - 77 - - - 7 - - - - - - - 48 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 53 - - - 7 - - - - - - - 10 - - - 67 - - - 7 - - - - - - - 16 - - - 43 - - - 7 - - - - - 16 - - - 43 - - - 7 - - - - - 16 - - - 44 - - - 16 - - - 35 - - - 7 - - - - - 173 - - - - - - - 63 - - - 33 - - - 90 - - - 7 - - - - - - - 18 - - - 7 - - - - - - - 2 - - - 51 - - - 7 - - - - - - - 27 - - - - - 20 - - - - - 39 - - - 7 - - - - - - - 20 - - - 89 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 10 - - - 2 - - - - - 8 - - - - - 16 - - - 56 - - - - - - - 50 - - - 47 - - - 7 - - - - - - - 8 - - - - - 10 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 10 - - - 7 - - - - - 66 - - - 10 - - - 7 - - - - - - - 29 - - - 11 - - - 15 - - - - - 14 - - - 15 - - - - - 15 - - - 7 - - - - - 93 - - - 7 - - - - - - - 81 - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 28 - - - 7 - - - - - 10 - - - 28 - - - 7 - - - - - - - 25 - - - 19 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 12 - - - 12 - - - 45 - - - 26 - - - 337 - - - 12 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 14 - - - - - 9 - - - 7 - - - - - 9 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 4 - - - 7 - - - - - - - 94 - - - 15 - - - 7 - - - - - - - 56 - - - 23 - - - 7 - - - - - - - 44 - - - 7 - - - 7 - - - - - 8 - - - 9 - - - 19 - - - - - - - 16 - - - 16 - - - 28 - - - 7 - - - - - - - 0 - - - 7 - - - - - 7 - - - - - 12 - - - 7 - - - - - 24 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 20 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - - - 35 - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - - - 20 - - - 7 - - - - - - - 9 - - - 7 - - - - - 9 - - - 8 - - - 7 - - - - - 9 - - - 9 - - - 7 - - - - - 9 - - - 9 - - - 7 - - - - - 123 - - - 7 - - - - - - - 130 - - - 7 - - - - - - - 8 - - - - - 7 - - - - - 19 - - - - - 40 - - - 15 - - - 12 - - - - - - - 7 - - - - - 7 - - - - - 22 - - - 7 - - - - - - - 10 - - - 7 - - - - - 21 - - - 7 - - - - - - - 30 - - - 27 - - - 27 - - - 23 - - - 20 - - - 187 - - - 32 - - - 15 - - - - - - - 8 - - - - - 2 - - - 7 - - - - - - - 10 - - - 47 - - - 92 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 14 - - - 17 - - - 161 - - - 7 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 20 - - - 7 - - - - - - - 9 - - - - - 17 - - - 9 - - - 15 - - - 9 - - - 8 - - - 8 - - - 15 - - - 13 - - - 85 - - - 15 - - - - - - - 60 - - - 7 - - - - - 22 - - - 18 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 26 - - - 7 - - - - - - - 15 - - - 15 - - - - - 15 - - - 15 - - - - - 15 - - - 35 - - - 15 - - - - - - - 30 - - - 12 - - - 84 - - - 15 - - - - - - - 32 - - - 7 - - - - - 13 - - - 9 - - - - - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 16 - - - 7 - - - 7 - - - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 37 - - - 8 - - - 7 - - - - - - - 226 - - - 21 - - - 21 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - 27 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 15 - - - 15 - - - - - 79 - - - 7 - - - - - - - 15 - - - 26 - - - - - 81 - - - 7 - - - - - - - 164 - - - 7 - - - - - 15 - - - 15 - - - - - 20 - - - 15 - - - 8 - - - 13 - - - - - 36 - - - 20 - - - 13 - - - 54 - - - 20 - - - 13 - - - 32 - - - - - - - 10 - - - 2 - - - 7 - - - - - 10 - - - 72 - - - 7 - - - - - 0 - - - 0 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - 15 - - - 72 - - - 7 - - - - - 10 - - - 2 - - - 10 - - - 2 - - - 10 - - - 2 - - - 10 - - - 2 - - - 134 - - - 7 - - - - - 61 - - - 7 - - - - - - - 15 - - - 7 - - - - - 10 - - - 7 - - - - - - - 89 - - - 7 - - - - - - - 15 - - - 9 - - - 15 - - - 9 - - - 15 - - - 9 - - - 39 - - - - - 2 - - - 7 - - - - - - - 14 - - - - - 10 - - - 19 - - - 7 - - - - - - - 40 - - - 31 - - - 7 - - - - - - - 4 - - - 7 - - - - - - - 18 - - - 106 - - - 31 - - - - - 53 - - - 7 - - - - - - - 20 - - - 27 - - - 15 - - - 27 - - - - - 32 - - - 39 - - - 9 - - - 16 - - - - - 46 - - - 76 - - - 76 - - - 76 - - - 9 - - - - - - - 14 - - - 8 - - - 213 - - - 9 - - - 7 - - - - - 15 - - - 9 - - - 15 - - - - - 14 - - - 8 - - - 15 - - - 9 - - - 8 - - - - - - - 70 - - - 7 - - - - - - - 48 - - - 26 - - - 7 - - - 7 - - - - - - - 978 - - - 43 - - - 7 - - - - - - - 24 - - - 42 - - - 42 - - - 42 - - - 111 - - - 16 - - - 24 - - - 20 - - - 16 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 22 - - - 139 - - - 139 - - - 42 - - - 423 - - - 397 - - - 302 - - - 302 - - - 7 - - - - - 599 - - - 16 - - - 7 - - - - - - - 701 - - - 7 - - - - - - - 2 - - - 2 - - - 21 - - - 7 - - - - - - - 17 - - - 11 - - - 43 - - - 7 - - - - - - - 133 - - - 46 - - - 7 - - - 96 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 8 - - - 20 - - - 7 - - - - - - - 8 - - - 7 - - - - - 2 - - - 7 - - - - - 26 - - - 7 - - - - - - - 14 - - - 8 - - - 115 - - - 7 - - - - - - - 18 - - - 19 - - - 7 - - - 7 - - - - - - - 11 - - - 11 - - - 2 - - - 7 - - - - - 32 - - - 15 - - - - - - - 14 - - - - - 11 - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 9 - - - 7 - - - - - - - 164 - - - 37 - - - 37 - - - 7 - - - 13 - - - - - 29 - - - 29 - - - 16 - - - 19 - - - 26 - - - 9 - - - - - - - 20 - - - 2 - - - 7 - - - - - - - 12 - - - - - 41 - - - 7 - - - - - - - 19 - - - - - 73 - - - 7 - - - - - - - 18 - - - 33 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 264 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 2 - - - 69 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 80 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 2 - - - 2 - - - 7 - - - - - 42 - - - 42 - - - 42 - - - 42 - - - 7 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - 80 - - - 1169 - - - 7 - - - 7 - - - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - - - 9 - - - 27 - - - 7 - - - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 12 - - - 130 - - - 45 - - - 59 - - - 58 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 24 - - - 24 - - - 134 - - - 39 - - - 35 - - - - - - - 7 - - - - - 2 - - - 8 - - - 12 - - - 7 - - - - - - - 31 - - - 2 - - - 7 - - - - - - - 25 - - - 25 - - - 2 - - - 26 - - - 14 - - - - - - - 2 - - - 8 - - - - - 15 - - - - - - - 35 - - - 7 - - - - - - - 14 - - - 20 - - - 7 - - - - - - - 34 - - - 7 - - - - - 10 - - - 7 - - - - - - - 25 - - - - - 75 - - - 75 - - - 80 - - - 80 - - - 75 - - - 75 - - - 80 - - - 80 - - - 415 - - - 7 - - - - - - - 25 - - - 13 - - - 7 - - - - - 10 - - - 144 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 10 - - - 10 - - - 93 - - - 7 - - - - - - - 18 - - - 65 - - - 7 - - - - - 19 - - - - - - - 2 - - - 10 - - - 8 - - - 8 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 7 - - - - - 37 - - - 7 - - - - - - - 8 - - - - - 13 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 40 - - - 40 - - - 20 - - - 19 - - - - - 129 - - - 11 - - - 10 - - - 7 - - - - - - - 42 - - - 42 - - - 7 - - - - - 25 - - - 56 - - - 7 - - - - - - - 15 - - - 10 - - - 10 - - - 7 - - - - - - - 15 - - - 9 - - - - - 81 - - - 7 - - - - - - - 51 - - - 7 - - - - - - - 0 - - - 16 - - - 7 - - - - - 10 - - - 16 - - - 7 - - - - - 33 - - - 27 - - - 152 - - - 7 - - - - - - - 54 - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - - - 7 - - - 8 - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 47 - - - 7 - - - - - - - 15 - - - 21 - - - 29 - - - 9 - - - - - 83 - - - 86 - - - 7 - - - - - - - 10 - - - 7 - - - - - 21 - - - 21 - - - 10 - - - 70 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 13 - - - 7 - - - - - - - 11 - - - 7 - - - - - - - 62 - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 103 - - - 7 - - - - - - - 15 - - - 15 - - - 65 - - - 26 - - - - - - - 2 - - - 2 - - - 7 - - - 2 - - - 2 - - - 10 - - - 7 - - - - - - - 19 - - - 7 - - - - - 19 - - - 7 - - - - - 69 - - - 7 - - - - - - - 40 - - - 40 - - - 2 - - - 36 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 14 - - - 7 - - - - - - - 24 - - - 7 - - - 7 - - - - - - - 14 - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - - - 7 - - - - - 15 - - - 9 - - - 14 - - - 15 - - - - - 15 - - - 2 - - - 2 - - - 17 - - - - - 7 - - - - - 18 - - - 25 - - - - - 78 - - - 7 - - - - - - - 15 - - - 15 - - - - - 147 - - - 345 - - - 7 - - - - - - - 49 - - - 7 - - - - - - - 378 - - - 2 - - - 7 - - - - - 15 - - - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 7 - - - - - 67 - - - 7 - - - - - - - 14 - - - 7 - - - - - 10 - - - 7 - - - - - - - 15 - - - 13 - - - 12 - - - 12 - - - 12 - - - 12 - - - 268 - - - 7 - - - - - - - 9 - - - 9 - - - 7 - - - - - 220 - - - 7 - - - - - - - 8 - - - 7 - - - - - 7 - - - - - 515 - - - - - 7 - - - - - - - 8 - - - 7 - - - - - 231 - - - - - - - 8 - - - 7 - - - - - 7 - - - - - 23 - - - - - 7 - - - - - - - 8 - - - 7 - - - - - 12 - - - 7 - - - - - 34 - - - - - 2 - - - 7 - - - - - - - 8 - - - 7 - - - - - 7 - - - - - 515 - - - - - 7 - - - - - - - 8 - - - 7 - - - - - 231 - - - - - - - 8 - - - 7 - - - - - 7 - - - - - 23 - - - - - 7 - - - - - - - 8 - - - 7 - - - - - 12 - - - 7 - - - - - 34 - - - - - 2 - - - 7 - - - - - - - 35 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 9 - - - 7 - - - - - 9 - - - 7 - - - - - 51 - - - 7 - - - - - - - 14 - - - 10 - - - 7 - - - - - 31 - - - 7 - - - - - - - 14 - - - 8 - - - 10 - - - 2 - - - 2 - - - 2 - - - 213 - - - 39 - - - 11 - - - - - 7 - - - - - - - 48 - - - - - 30 - - - 38 - - - - - 85 - - - 37 - - - 65 - - - 34 - - - 88 - - - 82 - - - 53 - - - 7 - - - 7 - - - - - - - 2 - - - 167 - - - 7 - - - - - - - 75 - - - 29 - - - 29 - - - 11 - - - - - - - 10 - - - 10 - - - 7 - - - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - 10 - - - 2 - - - 8 - - - - - 72 - - - 21 - - - 40 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 20 - - - 20 - - - 41 - - - 29 - - - - - 2 - - - 2 - - - 7 - - - - - 5 - - - 9 - - - 18 - - - 13 - - - 2 - - - 7 - - - - - - - 352 - - - 7 - - - 148 - - - - - - - 60 - - - 7 - - - - - - - 13 - - - 8 - - - - - - - 2 - - - 31 - - - - - - - 15 - - - 15 - - - - - 52 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 12 - - - 7 - - - - - 10 - - - - - 7 - - - 11 - - - - - 23 - - - 7 - - - - - - - 8 - - - - - 10 - - - 8 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 68 - - - 14 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - 13 - - - - - - - 2 - - - 7 - - - 7 - - - - - - - 92 - - - 8 - - - 22 - - - - - - - 20 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 149 - - - 7 - - - - - - - 9 - - - 7 - - - - - - - 15 - - - 9 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 2 - - - 5 - - - 71 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 20 - - - 8 - - - 8 - - - - - - - 17 - - - 7 - - - - - - - 2 - - - 14 - - - 7 - - - 11 - - - - - 7 - - - - - 7 - - - 11 - - - - - - - 98 - - - 7 - - - 17 - - - - - - - 9 - - - - - 8 - - - 74 - - - 8 - - - 8 - - - 8 - - - 38 - - - 47 - - - 319 - - - 7 - - - - - - - 9 - - - 7 - - - - - 7 - - - - - 42 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 2 - - - 12 - - - 10 - - - 12 - - - 7 - - - - - 12 - - - 12 - - - 25 - - - 7 - - - - - - - 2 - - - 12 - - - 22 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 14 - - - 51 - - - 7 - - - - - 29 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 101 - - - 7 - - - - - 7 - - - - - 7 - - - - - 0 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - - - 7 - - - - - 14 - - - 7 - - - - - 7 - - - - - 20 - - - 13 - - - 7 - - - - - - - 8 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 7 - - - - - 40 - - - 40 - - - 40 - - - 40 - - - 7 - - - 1 - - - - - 7 - - - 7 - - - - - 63 - - - 7 - - - 19 - - - - - - - 18 - - - 23 - - - 310 - - - 7 - - - 19 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 243 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 8 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 28 - - - 26 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 57 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 43 - - - - - 311 - - - 7 - - - - - - - 16 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 22 - - - 16 - - - 7 - - - - - - - 8 - - - 11 - - - - - 15 - - - 9 - - - 18 - - - - - 2 - - - 7 - - - - - - - 52 - - - 41 - - - 55 - - - 75 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 7 - - - - - 15 - - - 7 - - - - - 15 - - - 7 - - - - - 34 - - - 7 - - - - - - - 2 - - - 2 - - - 19 - - - - - - - 28 - - - 7 - - - - - - - 28 - - - 7 - - - - - - - 26 - - - 7 - - - - - - - 22 - - - 10 - - - 10 - - - 10 - - - 48 - - - 7 - - - - - - - 10 - - - 108 - - - 96 - - - 20 - - - 7 - - - - - - - 126 - - - 72 - - - 7 - - - - - - - 2 - - - 11 - - - - - 9 - - - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 11 - - - 7 - - - - - 11 - - - 7 - - - - - 54 - - - 57 - - - 7 - - - - - - - 54 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 90 - - - 7 - - - - - - - 11 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 13 - - - 10 - - - 7 - - - - - - - 33 - - - 27 - - - 10 - - - 15 - - - 9 - - - 7 - - - - - 33 - - - 27 - - - 10 - - - 15 - - - 9 - - - 7 - - - - - 320 - - - 7 - - - - - - - 30 - - - 7 - - - - - - - 16 - - - 7 - - - - - - - 109 - - - 7 - - - 16 - - - - - - - 13 - - - 8 - - - 38 - - - - - - - 43 - - - 34 - - - 7 - - - 8 - - - - - - - 57 - - - 7 - - - - - - - 15 - - - 16 - - - 15 - - - - - - - 16 - - - 15 - - - 23 - - - 9 - - - - - - - 10 - - - 7 - - - - - 26 - - - 7 - - - - - 26 - - - 7 - - - - - 26 - - - 7 - - - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 26 - - - 7 - - - - - 26 - - - 7 - - - - - 26 - - - 7 - - - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 9 - - - 11 - - - 2 - - - 15 - - - 2 - - - 22 - - - - - 7 - - - - - 7 - - - - - 204 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 2 - - - 2 - - - 5 - - - 2 - - - 2 - - - 7 - - - - - - - 93 - - - 24 - - - - - 9 - - - - - - - 15 - - - 25 - - - 8 - - - - - 25 - - - 8 - - - - - 25 - - - - - 15 - - - 15 - - - 15 - - - 114 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 15 - - - 25 - - - 8 - - - - - 25 - - - 8 - - - - - 15 - - - 32 - - - - - 15 - - - 15 - - - 31 - - - 129 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 15 - - - 25 - - - 8 - - - - - 25 - - - 8 - - - - - 15 - - - 32 - - - - - 56 - - - 72 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 30 - - - 7 - - - - - - - 8 - - - - - 8 - - - - - 15 - - - 15 - - - - - 151 - - - 159 - - - 7 - - - - - 10 - - - 2 - - - 10 - - - 2 - - - 10 - - - 2 - - - 10 - - - 2 - - - 10 - - - 2 - - - 7 - - - - - - - 119 - - - 7 - - - - - 15 - - - 9 - - - 10 - - - 14 - - - 15 - - - - - 2 - - - 9 - - - 16 - - - 14 - - - 2 - - - 9 - - - - - - - 2 - - - 23 - - - 394 - - - 7 - - - - - - - 9 - - - 9 - - - 126 - - - 7 - - - - - - - 258 - - - 7 - - - - - - - 107 - - - 106 - - - 256 - - - 277 - - - 111 - - - 115 - - - 7 - - - 52 - - - - - - - 207 - - - 7 - - - - - - - 26 - - - 7 - - - - - - - 106 - - - 7 - - - - - - - 29 - - - 71 - - - 7 - - - - - - - 18 - - - 7 - - - - - 14 - - - 7 - - - - - - - 228 - - - 19 - - - 18 - - - 7 - - - - - - - 13 - - - 7 - - - - - - - 59 - - - 7 - - - - - - - 40 - - - - - - - 189 - - - 310 - - - 7 - - - - - - - 36 - - - 7 - - - - - - - 2 - - - 25 - - - - - 16 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - - - 14 - - - 34 - - - 8 - - - - - - - 21 - - - 7 - - - - - 12 - - - 7 - - - - - - - 42 - - - 42 - - - 47 - - - 14 - - - 7 - - - - - - - 172 - - - 13 - - - - - 15 - - - - - 7 - - - - - - - 8 - - - 7 - - - - - - - 22 - - - 16 - - - 15 - - - 9 - - - 7 - - - - - 10 - - - 2 - - - 24 - - - 7 - - - - - 26 - - - 26 - - - 32 - - - 32 - - - 18 - - - 18 - - - 29 - - - 90 - - - 265 - - - 214 - - - 7 - - - - - - - 8 - - - 7 - - - - - - - 13 - - - 7 - - - - - 7 - - - - - 19 - - - 7 - - - 7 - - - - - 44 - - - 7 - - - - - - - 2 - - - 10 - - - 7 - - - 17 - - - - - - - 2 - - - 13 - - - 11 - - - 7 - - - - - - - 49 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 7 - - - - - 19 - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 19 - - - 7 - - - - - - - 45 - - - 70 - - - 74 - - - 70 - - - 100 - - - 332 - - - 7 - - - - - - - 7 - - - - - 19 - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 19 - - - 7 - - - - - - - 7 - - - - - 19 - - - 7 - - - - - - - 7 - - - - - 17 - - - 7 - - - 11 - - - - - - - 7 - - - - - 17 - - - 7 - - - 11 - - - - - - - 10 - - - 8 - - - 7 - - - - - - - 10 - - - 8 - - - 7 - - - - - - - 7 - - - - - 72 - - - 7 - - - - - - - 35 - - - 7 - - - - - - - 16 - - - 19 - - - - - 46 - - - 7 - - - - - - - 94 - - - 50 - - - 154 - - - 7 - - - - - - - 18 - - - 10 - - - 27 - - - 7 - - - - - - - 26 - - - 7 - - - 8 - - - - - - - 73 - - - 7 - - - - - - - 2 - - - 32 - - - - - - - 2 - - - 7 - - - - - - - 15 - - - 15 - - - 17 - - - - - 112 - - - 7 - - - 45 - - - - - - - 9 - - - 2 - - - 7 - - - - - - - 8 - - - - - 7 - - - 7 - - - - - 2 - - - 7 - - - - - - - 28 - - - 7 - - - 17 - - - - - - - 2 - - - 20 - - - 26 - - - 8 - - - 7 - - - - - - - 882 - - - 7 - - - 97 - - - - - - - 10 - - - 15 - - - 71 - - - 15 - - - - - - - 23 - - - 7 - - - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 34 - - - 7 - - - - - - - 8 - - - - - 260 - - - 7 - - - - - - - 25 - - - - - 28 - - - 7 - - - - - - - 16 - - - - - 17 - - - 7 - - - - - - - 12 - - - 12 - - - 60 - - - 7 - - - - - - - 8 - - - 8 - - - 8 - - - 8 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 41 - - - 7 - - - - - - - 21 - - - 7 - - - - - 18 - - - 8 - - - - - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 15 - - - 1364 - - - 7 - - - - - - - 2 - - - 7 - - - 18 - - - - - - - 15 - - - 15 - - - 2 - - - - - 63 - - - 7 - - - - - - - 2 - - - 9 - - - 41 - - - 14 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 103 - - - 7 - - - - - - - 103 - - - 7 - - - - - - - 14 - - - 7 - - - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 42 - - - 7 - - - - - - - 0 - - - - - 13 - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - 58 - - - 86 - - - 7 - - - - - 24 - - - 24 - - - 7 - - - - - - - 32 - - - 32 - - - 511 - - - 7 - - - 13 - - - - - - - 24 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - - - 52 - - - 7 - - - - - - - 15 - - - 9 - - - 97 - - - 14 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 10 - - - 25 - - - 7 - - - - - 10 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - - - 8 - - - - - 19 - - - - - 2 - - - 7 - - - - - - - 14 - - - 58 - - - 58 - - - 73 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 39 - - - 7 - - - - - 39 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 40 - - - 40 - - - 18 - - - 41 - - - 7 - - - 24 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 8 - - - - - 7 - - - - - - - 10 - - - 10 - - - 2 - - - 7 - - - - - - - 70 - - - 2 - - - 7 - - - - - - - 2 - - - 8 - - - - - 290 - - - 21 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 50 - - - 5 - - - - - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 26 - - - 7 - - - - - 10 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 41 - - - 7 - - - - - - - 132 - - - 7 - - - - - - - 33 - - - 73 - - - 7 - - - - - - - 7 - - - - - 9 - - - - - 10 - - - 169 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 3469 - - - 92 - - - 137 - - - 53 - - - 34 - - - 35 - - - 59 - - - 90 - - - 78 - - - 25 - - - 56 - - - 34 - - - 106 - - - 24 - - - 73 - - - 94 - - - 34 - - - 98 - - - 72 - - - 37 - - - 91 - - - 9 - - - 1390 - - - 7 - - - - - - - 2 - - - 7 - - - 39 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 20 - - - - - 22 - - - - - 25 - - - - - 75 - - - 7 - - - - - - - 10 - - - 7 - - - - - 19 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 63 - - - 12 - - - 15 - - - 9 - - - 8 - - - 55 - - - - - - - 0 - - - 0 - - - - - 99 - - - - - - - 123 - - - 45 - - - 46 - - - 51 - - - 36 - - - 154 - - - 7 - - - - - - - 45 - - - 7 - - - - - - - 8 - - - - - 136 - - - 7 - - - - - - - 2 - - - 54 - - - 9 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 11 - - - 2 - - - 7 - - - - - 11 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - - - 34 - - - 7 - - - - - - - 10 - - - 46 - - - 7 - - - 7 - - - - - - - 20 - - - 37 - - - 7 - - - - - - - 0 - - - 0 - - - 7 - - - - - 10 - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - 8 - - - - - 101 - - - 7 - - - - - - - 15 - - - 16 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 7 - - - - - 2 - - - 7 - - - - - - - 15 - - - 9 - - - 14 - - - 26 - - - - - 15 - - - 9 - - - 181 - - - 27 - - - - - 21 - - - 7 - - - - - - - 37 - - - 29 - - - 7 - - - - - - - 22 - - - 7 - - - 7 - - - - - - - 22 - - - 7 - - - 7 - - - - - - - 322 - - - 7 - - - - - - - 37 - - - 56 - - - 7 - - - - - - - 41 - - - 7 - - - - - - - 41 - - - 7 - - - - - - - 19 - - - 7 - - - - - - - 23 - - - 7 - - - - - - - 25 - - - 21 - - - 7 - - - - - - - 36 - - - 20 - - - 14 - - - - - 14 - - - 548 - - - 7 - - - 36 - - - - - - - 15 - - - 15 - - - - - 29 - - - 7 - - - - - - - 2 - - - 15 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 7 - - - - - - - 17 - - - 35 - - - 35 - - - 12 - - - 2 - - - 2 - - - 7 - - - - - - - 114 - - - 7 - - - - - - - 37 - - - 37 - - - 61 - - - 42 - - - 7 - - - - - - - 2 - - - 9 - - - 9 - - - 9 - - - 9 - - - 7 - - - - - - - 56 - - - 62 - - - 11 - - - 19 - - - - - - - 2 - - - 7 - - - 25 - - - - - - - 9 - - - 7 - - - - - - - 9 - - - 7 - - - - - 288 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 2 - - - 47 - - - - - - - 11 - - - 14 - - - 62 - - - 7 - - - - - - - 77 - - - 20 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 40 - - - 40 - - - 32 - - - 19 - - - - - - - 14 - - - 7 - - - - - 7 - - - - - 7 - - - - - 22 - - - 7 - - - - - 7 - - - - - 19 - - - 7 - - - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 14 - - - 21 - - - 7 - - - - - - - 84 - - - 7 - - - - - - - 19 - - - 10 - - - 7 - - - - - - - 11 - - - 7 - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 2 - - - 109 - - - 7 - - - - - - - 34 - - - 2 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 21 - - - 15 - - - 15 - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - 7 - - - - - 10 - - - 41 - - - 10 - - - 41 - - - 10 - - - 41 - - - 259 - - - 7 - - - - - - - 34 - - - 7 - - - - - - - 2 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 38 - - - 7 - - - - - 15 - - - 16 - - - 9 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 10 - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 12 - - - 7 - - - - - 12 - - - 7 - - - - - 12 - - - 7 - - - - - 20 - - - 7 - - - - - - - 12 - - - 7 - - - - - - - 2 - - - - - - - 2 - - - 15 - - - 7 - - - - - - - 2 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - - - 169 - - - 7 - - - - - - - 361 - - - 7 - - - - - - - 2 - - - 2 - - - 48 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 22 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 42 - - - 42 - - - 2 - - - 7 - - - - - - - 15 - - - 9 - - - 0 - - - 0 - - - 15 - - - 9 - - - 7 - - - - - 15 - - - 9 - - - 15 - - - 9 - - - 7 - - - - - 15 - - - 9 - - - 15 - - - 9 - - - 7 - - - - - 279 - - - 7 - - - - - - - 82 - - - 7 - - - - - 15 - - - 16 - - - 9 - - - - - 15 - - - 16 - - - 9 - - - - - - - 2 - - - 0 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 58 - - - 7 - - - - - - - 74 - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - - - 20 - - - 8 - - - 13 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 166 - - - 7 - - - - - 42 - - - 42 - - - 10 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 25 - - - 25 - - - 42 - - - 9 - - - 7 - - - - - 60 - - - 35 - - - 35 - - - 35 - - - 74 - - - 18 - - - - - - - 7 - - - - - 38 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 18 - - - 10 - - - - - 18 - - - 17 - - - 2 - - - 7 - - - - - - - 26 - - - 7 - - - 11 - - - - - - - 25 - - - 7 - - - - - - - 28 - - - 7 - - - - - - - 25 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 20 - - - 35 - - - 35 - - - 8 - - - - - 19 - - - 19 - - - 8 - - - - - 70 - - - 10 - - - 7 - - - - - - - 49 - - - 7 - - - - - - - 37 - - - 7 - - - - - - - 44 - - - 59 - - - 19 - - - 90 - - - 179 - - - 84 - - - 184 - - - 141 - - - 346 - - - 7 - - - - - - - 12 - - - 41 - - - 174 - - - 7 - - - - - 10 - - - 41 - - - 72 - - - 7 - - - - - 30 - - - 7 - - - - - - - 2 - - - - - - - 27 - - - 7 - - - - - 7 - - - - - - - 10 - - - 2 - - - 28 - - - 10 - - - 26 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 53 - - - 7 - - - - - - - 112 - - - 7 - - - - - 15 - - - 29 - - - 9 - - - - - - - 32 - - - 7 - - - - - - - 2 - - - 7 - - - - - 15 - - - 14 - - - - - 13 - - - - - 8 - - - 7 - - - - - - - 2 - - - 7 - - - - - 15 - - - 2 - - - 14 - - - - - 13 - - - - - 8 - - - 7 - - - - - - - 294 - - - 136 - - - 75 - - - 7 - - - - - - - 36 - - - 14 - - - 15 - - - 9 - - - 15 - - - 9 - - - 363 - - - 18 - - - - - - - 20 - - - 7 - - - - - 2 - - - 7 - - - - - - - 69 - - - 46 - - - 36 - - - 7 - - - 2 - - - 7 - - - - - - - 8 - - - 2 - - - 7 - - - - - - - 112 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 26 - - - 24 - - - 7 - - - - - - - 18 - - - 7 - - - - - - - 7 - - - - - 10 - - - 37 - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - - - 15 - - - 2 - - - 36 - - - - - - - 28 - - - 28 - - - 15 - - - - - 93 - - - 7 - - - - - - - 45 - - - 7 - - - - - - - 2 - - - 8 - - - - - 22 - - - 7 - - - - - - - 124 - - - 7 - - - - - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 118 - - - 16 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - - - 65 - - - 7 - - - 8 - - - - - - - 102 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - - - 194 - - - 7 - - - - - 10 - - - 10 - - - 2 - - - 10 - - - 2 - - - 7 - - - - - - - 143 - - - 7 - - - - - - - 61 - - - 7 - - - - - - - 54 - - - 7 - - - - - - - 12 - - - 4 - - - 10 - - - 2 - - - 4 - - - 4 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - - - 5294 - - - 7 - - - - - 7 - - - 7 - - - - - 872 - - - 2 - - - 7 - - - - - - - 16 - - - 80 - - - 7 - - - - - - - 74 - - - 142 - - - 88 - - - 7 - - - - - - - 17 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 10 - - - 42 - - - 42 - - - 104 - - - 7 - - - - - - - 16 - - - 16 - - - 41 - - - 7 - - - - - - - 14 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - - - 8 - - - 8 - - - 35 - - - 7 - - - - - - - 130 - - - 7 - - - - - - - 2 - - - - - 8 - - - - - 9 - - - 10 - - - 24 - - - 7 - - - - - - - 0 - - - 7 - - - - - 17 - - - 14 - - - 7 - - - - - - - 10 - - - 4 - - - 7 - - - - - - - 10 - - - 7 - - - - - 2 - - - 14 - - - - - - - 2 - - - 44 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - 9 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 10 - - - - - - - 98 - - - 7 - - - - - - - 8 - - - - - 30 - - - 98 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 11 - - - 11 - - - 7 - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 11 - - - 11 - - - 7 - - - - - 10 - - - 10 - - - 11 - - - 11 - - - 7 - - - - - 10 - - - 11 - - - 11 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 16 - - - 7 - - - - - 387 - - - 7 - - - - - - - 20 - - - 80 - - - 89 - - - 14 - - - 14 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 22 - - - 22 - - - 20 - - - 68 - - - 12 - - - 168 - - - 7 - - - - - - - 22 - - - 14 - - - 64 - - - 63 - - - 74 - - - 36 - - - 31 - - - 7 - - - - - - - 14 - - - 8 - - - 8 - - - 20 - - - - - 7 - - - - - 124 - - - 7 - - - - - - - 111 - - - 7 - - - - - 29 - - - 7 - - - - - - - 21 - - - 35 - - - 68 - - - 7 - - - - - - - 7 - - - - - 8 - - - - - 17 - - - 7 - - - - - - - 128 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 15 - - - 73 - - - 8 - - - - - - - 48 - - - 7 - - - - - - - 137 - - - 11 - - - 27 - - - 29 - - - 36 - - - 7 - - - - - - - 10 - - - 60 - - - 32 - - - 32 - - - 21 - - - 98 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 31 - - - 7 - - - - - - - 15 - - - 15 - - - 145 - - - 7 - - - - - - - 29 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 14 - - - 8 - - - - - - - 610 - - - 7 - - - - - 15 - - - 15 - - - 16 - - - 14 - - - 9 - - - - - - - 8 - - - 29 - - - 24 - - - 132 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 21 - - - 2 - - - 7 - - - - - - - 14 - - - 35 - - - 7 - - - - - - - 43 - - - 33 - - - 40 - - - 54 - - - 7 - - - - - - - 16 - - - 48 - - - 7 - - - - - - - 15 - - - 9 - - - 76 - - - 7 - - - - - - - 27 - - - 7 - - - - - - - 2 - - - 7 - - - - - 12 - - - 15 - - - 7 - - - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - 7 - - - - - - - 38 - - - 2 - - - 9 - - - 7 - - - - - - - 7 - - - - - 19 - - - 42 - - - 60 - - - 55 - - - 84 - - - 62 - - - 82 - - - 63 - - - 87 - - - 108 - - - 7 - - - 53 - - - - - - - 15 - - - 16 - - - 9 - - - - - 31 - - - 7 - - - - - - - 2 - - - 16 - - - 10 - - - 7 - - - - - - - 1 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 19 - - - 7 - - - - - - - 160 - - - 72 - - - 7 - - - - - - - 22 - - - 10 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 4 - - - 7 - - - - - - - 15 - - - 7 - - - - - - - 27 - - - 10 - - - 7 - - - - - - - 11 - - - 11 - - - 2 - - - 7 - - - - - - - 2 - - - 103 - - - 7 - - - - - - - 64 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - - - 8 - - - - - 10 - - - 22 - - - 10 - - - 7 - - - - - - - 42 - - - 42 - - - 13 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 40 - - - 2 - - - 2 - - - 7 - - - - - - - 34 - - - 172 - - - - - - - 15 - - - - - 197 - - - 7 - - - - - - - 95 - - - 7 - - - - - - - 2 - - - 18 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 20 - - - - - - - 8 - - - 78 - - - 78 - - - 78 - - - 78 - - - 191 - - - 7 - - - - - - - 40 - - - 7 - - - - - - - 78 - - - 70 - - - 7 - - - - - - - 33 - - - 7 - - - - - - - 53 - - - 150 - - - 7 - - - - - - - 18 - - - 16 - - - 9 - - - - - 18 - - - 16 - - - 9 - - - - - 64 - - - 7 - - - - - - - 15 - - - 15 - - - 64 - - - 7 - - - - - - - 43 - - - 4 - - - - - - - 0 - - - 10 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 133 - - - 7 - - - 23 - - - - - - - 11 - - - 14 - - - 169 - - - 7 - - - - - - - 40 - - - 7 - - - - - - - 10 - - - 7 - - - - - - - 766 - - - 36 - - - 7 - - - 53 - - - - - - - 10 - - - 2 - - - - - 13 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 13 - - - 7 - - - - - - - 15 - - - 2 - - - 26 - - - - - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 478 - - - 39 - - - 30 - - - 31 - - - 39 - - - 32 - - - 32 - - - 32 - - - 31 - - - 28 - - - 34 - - - 34 - - - 28 - - - 31 - - - 25 - - - 26 - - - 15 - - - - - - - 10 - - - 10 - - - 7 - - - - - 17 - - - 17 - - - 7 - - - - - 98 - - - 7 - - - - - - - 8 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 2 - - - 7 - - - - - - - 10 - - - 9 - - - 16 - - - - - - - 0 - - - 0 - - - 20 - - - 26 - - - 8 - - - - - 42 - - - 42 - - - 26 - - - 22 - - - 50 - - - - - - - 52 - - - 10 - - - 7 - - - 9 - - - - - - - 18 - - - 7 - - - 7 - - - - - 14 - - - 10 - - - 10 - - - 2 - - - 12 - - - - - 88 - - - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 8 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 33 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 71 - - - 36 - - - 71 - - - 7 - - - - - - - 38 - - - 7 - - - - - 23 - - - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 2 - - - 15 - - - 15 - - - - - - - 23 - - - 7 - - - - - - - 12 - - - 7 - - - - - 14 - - - 7 - - - - - 43 - - - 8 - - - 7 - - - 11 - - - - - - - 2 - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - - - 8 - - - - - 16 - - - - - 7 - - - - - 7 - - - 8 - - - - - 12 - - - 7 - - - - - 230 - - - 7 - - - - - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 2 - - - 7 - - - - - 14 - - - - - 83 - - - 7 - - - - - - - 2 - - - 7 - - - - - 9 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - 9 - - - 7 - - - - - - - 19 - - - 7 - - - - - 0 - - - 0 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 24 - - - 7 - - - - - - - 68 - - - 7 - - - - - 2 - - - 7 - - - - - - - 9 - - - 19 - - - 61 - - - 9 - - - - - - - 10 - - - 7 - - - - - 34 - - - - - - - 43 - - - 118 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 216 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 7 - - - - - - - 126 - - - 7 - - - - - 33 - - - 65 - - - 7 - - - - - - - 38 - - - 7 - - - - - - - 146 - - - 7 - - - - - - - 0 - - - 7 - - - - - 10 - - - 7 - - - - - 35 - - - 7 - - - - - - - 2 - - - 10 - - - 30 - - - 36 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 42 - - - 7 - - - - - - - 10 - - - 10 - - - 35 - - - 7 - - - - - - - 103 - - - 7 - - - - - - - 23 - - - 72 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 42 - - - 42 - - - 19 - - - 7 - - - - - 42 - - - 42 - - - 22 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 19 - - - 2 - - - 7 - - - - - - - 15 - - - 9 - - - 9 - - - - - 85 - - - 7 - - - - - - - 2 - - - 19 - - - - - - - 20 - - - 2 - - - 105 - - - 7 - - - - - - - 198 - - - 7 - - - - - - - 361 - - - 7 - - - - - 31 - - - 29 - - - - - - - 19 - - - 2 - - - 7 - - - - - - - 28 - - - - - 7 - - - - - 54 - - - 7 - - - - - - - 12 - - - 31 - - - 7 - - - - - - - 8 - - - 7 - - - - - 2 - - - 7 - - - - - 0 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 2 - - - 0 - - - 7 - - - - - - - 29 - - - 7 - - - - - - - 9 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 2 - - - 7 - - - - - 14 - - - 7 - - - - - 7 - - - - - - - 15 - - - 7 - - - - - - - 16 - - - 7 - - - 7 - - - - - 7 - - - - - 7 - - - - - 47 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 14 - - - 2 - - - 11 - - - 2 - - - 14 - - - 2 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - 8 - - - - - 14 - - - 10 - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 13 - - - 7 - - - - - - - 35 - - - 28 - - - 7 - - - - - - - 2 - - - 7 - - - - - 14 - - - 7 - - - - - - - 13 - - - 7 - - - - - - - 60 - - - 165 - - - 7 - - - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 14 - - - 8 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 38 - - - 32 - - - 36 - - - 49 - - - 7 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 7 - - - 11 - - - - - 10 - - - 10 - - - 13 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 12 - - - - - - - 14 - - - 15 - - - 2 - - - 7 - - - - - 18 - - - 15 - - - - - - - 10 - - - 2 - - - 7 - - - - - 14 - - - 11 - - - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 2 - - - 2 - - - 132 - - - 7 - - - - - - - 258 - - - 7 - - - - - - - 14 - - - 7 - - - - - 42 - - - 42 - - - 7 - - - - - 42 - - - 42 - - - 7 - - - - - 12 - - - 7 - - - - - - - 14 - - - 8 - - - - - 14 - - - 8 - - - - - 14 - - - 8 - - - - - 78 - - - 7 - - - - - - - 15 - - - 7 - - - - - 18 - - - 8 - - - - - - - 11 - - - 8 - - - 7 - - - - - 0 - - - 7 - - - - - 11 - - - 7 - - - - - 86 - - - 7 - - - - - - - 10 - - - 2 - - - 10 - - - 2 - - - 2 - - - 7 - - - - - - - 35 - - - 25 - - - 35 - - - 25 - - - 7 - - - - - 19 - - - 178 - - - 2 - - - 7 - - - - - - - 14 - - - 2 - - - 7 - - - - - 14 - - - 2 - - - 7 - - - - - 16 - - - 2 - - - 7 - - - - - 44 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - - - 7 - - - 7 - - - - - 20 - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 15 - - - 7 - - - - - 35 - - - 7 - - - - - - - 33 - - - 27 - - - - - - - 32 - - - 31 - - - 44 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 20 - - - 21 - - - 20 - - - 21 - - - 7 - - - - - 20 - - - 20 - - - 7 - - - - - 26 - - - 26 - - - 26 - - - 26 - - - 7 - - - - - 64 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 7 - - - - - 14 - - - 42 - - - 14 - - - 2 - - - 7 - - - - - - - 19 - - - 7 - - - - - - - 2 - - - 10 - - - 10 - - - 116 - - - 7 - - - - - - - 7 - - - 9 - - - 15 - - - - - 15 - - - 7 - - - - - 16 - - - 10 - - - 64 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 7 - - - - - 10 - - - 10 - - - 2 - - - 2 - - - 7 - - - - - 0 - - - 10 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 26 - - - 10 - - - 7 - - - - - 26 - - - - - 22 - - - - - 22 - - - - - 7 - - - 7 - - - - - 438 - - - 7 - - - - - - - 2 - - - 10 - - - 10 - - - 7 - - - - - 2 - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - - - 44 - - - 7 - - - - - 14 - - - 7 - - - - - 7 - - - 7 - - - - - - - 77 - - - 7 - - - 7 - - - - - - - 48 - - - 7 - - - - - - - 2 - - - - - 21 - - - 29 - - - 10 - - - 39 - - - - - - - 20 - - - 81 - - - 7 - - - 7 - - - - - - - 36 - - - 20 - - - 2 - - - 7 - - - - - - - 60 - - - 7 - - - - - - - 12 - - - 66 - - - 2 - - - 7 - - - - - - - 120 - - - 25 - - - - - - - 20 - - - 12 - - - 7 - - - - - 8 - - - - - - - 2 - - - 7 - - - - - - - 6 - - - 7 - - - - - 12 - - - 7 - - - - - 37 - - - 7 - - - - - - - 21 - - - 7 - - - - - 7 - - - - - 8 - - - - - - - 173 - - - 7 - - - - - - - 12 - - - 7 - - - - - 47 - - - 7 - - - - - - - 6 - - - 7 - - - - - - - 11 - - - 10 - - - 199 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 40 - - - 7 - - - - - - - 10 - - - 7 - - - - - 14 - - - 7 - - - - - 11 - - - 10 - - - 8 - - - 7 - - - - - - - 49 - - - 7 - - - - - 10 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 15 - - - 17 - - - - - 7 - - - - - 7 - - - - - 104 - - - 7 - - - - - - - 7 - - - - - 69 - - - 7 - - - - - - - 70 - - - 7 - - - - - - - 65 - - - 7 - - - - - - - 45 - - - 89 - - - 7 - - - - - - - 12 - - - 2 - - - 7 - - - - - - - 69 - - - 68 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 14 - - - 14 - - - 223 - - - 7 - - - - - - - 10 - - - 8 - - - 7 - - - - - 38 - - - - - - - 7 - - - - - 71 - - - 23 - - - 7 - - - - - - - 18 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 27 - - - 8 - - - 8 - - - - - 8 - - - 9 - - - - - - - 2 - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - 7 - - - - - 10 - - - 7 - - - - - - - 18 - - - 14 - - - - - 25 - - - 7 - - - - - - - 30 - - - 7 - - - - - - - 35 - - - 7 - - - - - - - 2 - - - 7 - - - 7 - - - - - 21 - - - 7 - - - - - - - 2 - - - 2 - - - - - - - 20 - - - 7 - - - - - 20 - - - 7 - - - - - 20 - - - 7 - - - - - 120 - - - 7 - - - - - - - 9 - - - 7 - - - - - - - 7 - - - - - 16 - - - 7 - - - - - - - 70 - - - 26 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - - - 19 - - - 15 - - - - - 42 - - - 42 - - - 15 - - - 15 - - - - - 10 - - - 7 - - - - - - - 158 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - - - 54 - - - 22 - - - 15 - - - 20 - - - - - 15 - - - 13 - - - - - 7 - - - - - - - 93 - - - 7 - - - - - 15 - - - 9 - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 19 - - - 15 - - - - - 109 - - - 9 - - - - - - - 7 - - - - - 7 - - - - - 8 - - - 7 - - - - - - - 28 - - - 7 - - - - - - - 7 - - - - - 10 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 16 - - - 7 - - - - - - - 10 - - - 10 - - - 14 - - - 18 - - - - - 50 - - - 7 - - - - - - - 18 - - - 16 - - - - - 134 - - - 7 - - - - - - - 14 - - - 9 - - - 12 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 10 - - - 10 - - - 2 - - - 33 - - - 2 - - - 7 - - - - - - - 33 - - - 7 - - - - - - - 31 - - - 20 - - - 31 - - - 20 - - - 54 - - - 7 - - - - - - - 81 - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 6 - - - 7 - - - - - - - 20 - - - 71 - - - 7 - - - - - - - 15 - - - 117 - - - 9 - - - - - - - 138 - - - 7 - - - - - - - 10 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - 288 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 10 - - - 7 - - - - - - - 16 - - - 7 - - - - - 23 - - - 7 - - - - - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - 128 - - - 7 - - - - - - - 43 - - - 23 - - - - - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 10 - - - 7 - - - - - - - 24 - - - 7 - - - - - 10 - - - 7 - - - - - - - 126 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 29 - - - 7 - - - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 175 - - - 7 - - - - - 114 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 60 - - - 7 - - - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 60 - - - 7 - - - - - 35 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 227 - - - 13 - - - 7 - - - - - 7 - - - - - 77 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 135 - - - 7 - - - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 143 - - - 13 - - - 7 - - - - - 19 - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 43 - - - 7 - - - - - 14 - - - 7 - - - - - - - 77 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 50 - - - 7 - - - - - - - 101 - - - 79 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 87 - - - 7 - - - - - - - 2 - - - 27 - - - 7 - - - 35 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 65 - - - 15 - - - 7 - - - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 72 - - - 15 - - - 7 - - - - - 63 - - - 7 - - - - - 51 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 29 - - - 15 - - - 9 - - - 7 - - - - - - - 63 - - - 59 - - - 23 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 76 - - - 15 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 49 - - - 20 - - - 30 - - - 9 - - - - - 82 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 113 - - - 15 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 50 - - - 29 - - - 7 - - - - - 33 - - - 7 - - - - - - - 2 - - - 15 - - - 36 - - - 26 - - - - - 37 - - - 62 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 181 - - - 57 - - - 6 - - - 7 - - - 23 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 13 - - - 91 - - - 7 - - - - - 7 - - - - - 42 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 38 - - - 51 - - - 23 - - - 12 - - - 82 - - - 12 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 113 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 72 - - - 15 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 132 - - - 2 - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 51 - - - 110 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 52 - - - 125 - - - 15 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 48 - - - 7 - - - - - 22 - - - 7 - - - - - 25 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 47 - - - 7 - - - - - 19 - - - 7 - - - - - 19 - - - 7 - - - - - - - 21 - - - 2 - - - 15 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 2 - - - 37 - - - 2 - - - 10 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 43 - - - 7 - - - - - 17 - - - 7 - - - - - 58 - - - 7 - - - - - 66 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 8 - - - - - 2 - - - 2 - - - 47 - - - - - - - 2 - - - 76 - - - 10 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 18 - - - 18 - - - 20 - - - 101 - - - 10 - - - 24 - - - 14 - - - 14 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 32 - - - 7 - - - 114 - - - 7 - - - - - 120 - - - 120 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 283 - - - 96 - - - 20 - - - 7 - - - - - - - 21 - - - 2 - - - 6 - - - 7 - - - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 18 - - - 2 - - - 61 - - - 15 - - - 7 - - - - - 18 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 10 - - - 10 - - - 10 - - - 10 - - - 95 - - - 10 - - - 7 - - - - - - - 9 - - - 15 - - - 7 - - - - - 2 - - - 7 - - - - - 2 - - - 9 - - - 19 - - - 247 - - - 7 - - - 7 - - - 17 - - - 17 - - - 62 - - - 54 - - - 41 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 49 - - - 36 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - - - 46 - - - 34 - - - 46 - - - 34 - - - 34 - - - 34 - - - 34 - - - 54 - - - 46 - - - 34 - - - 28 - - - 34 - - - 34 - - - 42 - - - 645 - - - 7 - - - - - 66 - - - 7 - - - - - 24 - - - 7 - - - - - 64 - - - 7 - - - - - 38 - - - 7 - - - - - 69 - - - 7 - - - - - 41 - - - 7 - - - - - 62 - - - 7 - - - - - 15 - - - 7 - - - - - 44 - - - 7 - - - - - 67 - - - 7 - - - - - 39 - - - 7 - - - - - 58 - - - 7 - - - - - 35 - - - 7 - - - - - 45 - - - 7 - - - - - - - 8 - - - - - 28 - - - 16 - - - 7 - - - - - 20 - - - 7 - - - - - - - 21 - - - 21 - - - 2 - - - 20 - - - 20 - - - 7 - - - - - - - 16 - - - 0 - - - 7 - - - - - 7 - - - - - 71 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - 18 - - - 7 - - - - - - - 0 - - - 7 - - - - - 15 - - - 2 - - - 8 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 25 - - - 40 - - - 15 - - - 18 - - - 16 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 20 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 43 - - - 23 - - - 14 - - - 23 - - - 15 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 49 - - - 2 - - - 7 - - - - - 63 - - - 7 - - - - - 51 - - - 7 - - - - - - - 26 - - - 2 - - - - - 37 - - - 2 - - - 7 - - - - - - - 10 - - - 32 - - - 8 - - - 7 - - - - - 19 - - - 7 - - - - - - - 41 - - - 146 - - - - - 68 - - - 24 - - - 7 - - - - - 35 - - - 7 - - - - - - - 15 - - - 9 - - - 18 - - - - - 100 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 34 - - - 7 - - - - - - - 40 - - - 17 - - - 7 - - - - - 40 - - - 9 - - - 7 - - - - - 23 - - - 17 - - - 7 - - - - - 121 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 51 - - - 9 - - - 18 - - - 7 - - - - - 23 - - - 7 - - - - - - - 7 - - - - - 64 - - - 24 - - - 7 - - - - - 18 - - - 7 - - - - - - - 48 - - - 10 - - - 7 - - - - - 50 - - - 7 - - - - - 210 - - - 7 - - - - - 7 - - - - - - - 40 - - - 34 - - - 34 - - - 59 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 25 - - - 7 - - - - - 86 - - - 7 - - - - - 24 - - - 7 - - - - - - - 40 - - - 40 - - - 2 - - - 32 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 15 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 153 - - - 14 - - - 7 - - - - - 7 - - - - - 7 - - - - - 79 - - - 7 - - - - - - - 45 - - - 7 - - - 2 - - - 15 - - - 15 - - - - - - - 20 - - - 21 - - - 12 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 94 - - - 21 - - - 18 - - - 7 - - - - - - - 2 - - - 7 - - - - - 19 - - - 2 - - - 2 - - - 7 - - - - - - - 20 - - - 21 - - - 32 - - - 7 - - - - - 14 - - - 7 - - - - - - - 42 - - - 9 - - - 7 - - - - - 45 - - - 25 - - - 7 - - - - - - - 34 - - - - - 67 - - - 24 - - - 7 - - - - - 40 - - - 7 - - - - - 52 - - - 7 - - - - - 35 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - - - 7 - - - - - 2 - - - 8 - - - - - 39 - - - 21 - - - - - 30 - - - 7 - - - - - - - 2 - - - 79 - - - 7 - - - - - 7 - - - - - 26 - - - 21 - - - 7 - - - - - - - 44 - - - 21 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - - - - - 20 - - - 7 - - - - - 8 - - - 20 - - - 45 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 20 - - - 2 - - - 101 - - - 7 - - - - - 35 - - - 7 - - - - - - - 7 - - - - - 40 - - - 18 - - - - - 2 - - - 7 - - - - - 56 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 37 - - - 17 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 14 - - - 52 - - - 52 - - - 7 - - - - - 64 - - - 7 - - - - - 60 - - - 7 - - - - - 46 - - - 7 - - - - - - - 39 - - - 19 - - - 15 - - - - - 43 - - - 9 - - - - - 48 - - - 7 - - - - - - - 18 - - - 7 - - - - - 2 - - - 36 - - - 25 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 23 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 38 - - - 8 - - - 7 - - - - - 14 - - - 7 - - - - - - - 54 - - - 75 - - - 54 - - - 7 - - - - - 19 - - - 7 - - - - - 19 - - - 7 - - - - - - - 86 - - - 2 - - - 9 - - - 12 - - - 7 - - - - - 41 - - - 7 - - - 7 - - - - - 7 - - - - - 36 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 43 - - - 23 - - - 28 - - - 15 - - - - - - - 86 - - - 2 - - - 9 - - - 12 - - - 7 - - - - - 49 - - - 7 - - - 7 - - - - - 7 - - - - - 36 - - - 7 - - - - - - - 33 - - - 34 - - - 7 - - - - - 47 - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 41 - - - 25 - - - 7 - - - - - 75 - - - 7 - - - - - 7 - - - - - 52 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - 41 - - - 35 - - - 60 - - - 9 - - - 7 - - - 7 - - - - - 28 - - - 7 - - - - - 32 - - - 7 - - - - - 40 - - - 7 - - - - - 20 - - - 20 - - - 7 - - - - - - - 86 - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - 20 - - - 7 - - - - - 7 - - - - - 19 - - - 12 - - - 7 - - - - - - - 28 - - - 22 - - - 77 - - - 7 - - - - - 14 - - - 7 - - - - - - - 21 - - - 22 - - - 39 - - - 7 - - - - - 14 - - - 7 - - - - - - - 2 - - - 2 - - - 36 - - - 84 - - - 7 - - - - - - - 113 - - - 57 - - - 42 - - - 38 - - - 7 - - - - - 10 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 521 - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 42 - - - 42 - - - 13 - - - 7 - - - - - 74 - - - 18 - - - 7 - - - 7 - - - - - - - 10 - - - 42 - - - 42 - - - 20 - - - 33 - - - 33 - - - 40 - - - 40 - - - 7 - - - - - 14 - - - 7 - - - - - 14 - - - 7 - - - - - 25 - - - 7 - - - - - 25 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 87 - - - 7 - - - - - 18 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 248 - - - 13 - - - 7 - - - - - 7 - - - - - 94 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 34 - - - 36 - - - 7 - - - - - 53 - - - 7 - - - - - 53 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 81 - - - 45 - - - 7 - - - 7 - - - - - 49 - - - 7 - - - - - 82 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 34 - - - 36 - - - 7 - - - - - 53 - - - 7 - - - - - 53 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 81 - - - 35 - - - 7 - - - - - 39 - - - 7 - - - - - 25 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 30 - - - 36 - - - 7 - - - - - 29 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 56 - - - 36 - - - 7 - - - - - 17 - - - 7 - - - - - - - 44 - - - 8 - - - 12 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 151 - - - 60 - - - 7 - - - - - 39 - - - 7 - - - - - 51 - - - 7 - - - - - - - 42 - - - 42 - - - 7 - - - - - 59 - - - 7 - - - - - 34 - - - 7 - - - - - - - 28 - - - 19 - - - 217 - - - 8 - - - 8 - - - 108 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 7 - - - - - 40 - - - 40 - - - 39 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 16 - - - 7 - - - - - - - 36 - - - 2 - - - 26 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 38 - - - 8 - - - 7 - - - - - 26 - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - 171 - - - 7 - - - - - 13 - - - 7 - - - - - 13 - - - 7 - - - - - - - 97 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 38 - - - 7 - - - 7 - - - - - 20 - - - 7 - - - - - 24 - - - 7 - - - - - - - 108 - - - 16 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 34 - - - 7 - - - - - - - 37 - - - 2 - - - 8 - - - 8 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 12 - - - 12 - - - 7 - - - 35 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 68 - - - 15 - - - 7 - - - - - 72 - - - 7 - - - - - 35 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 66 - - - 15 - - - 7 - - - - - 38 - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 66 - - - 15 - - - 7 - - - - - 38 - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 66 - - - 15 - - - 7 - - - - - 63 - - - 7 - - - - - 36 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 52 - - - 14 - - - 45 - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 55 - - - 15 - - - 7 - - - - - 72 - - - 7 - - - - - 35 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 69 - - - 15 - - - 7 - - - - - 59 - - - 41 - - - 22 - - - 7 - - - - - 27 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - - - 14 - - - 8 - - - 7 - - - 46 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 51 - - - 7 - - - - - 15 - - - 7 - - - - - 20 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 142 - - - 7 - - - - - 15 - - - 7 - - - - - 7 - - - - - 7 - - - - - 51 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 190 - - - 7 - - - - - 15 - - - 7 - - - - - 7 - - - - - 7 - - - - - 79 - - - 7 - - - - - - - 68 - - - 15 - - - 7 - - - - - 14 - - - 14 - - - 207 - - - 83 - - - 6 - - - 7 - - - - - - - 37 - - - 7 - - - - - 252 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 135 - - - 15 - - - 6 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 12 - - - 12 - - - 7 - - - 35 - - - - - - - 29 - - - 40 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 14 - - - 14 - - - 242 - - - 15 - - - 6 - - - 7 - - - - - 28 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 40 - - - 34 - - - - - 16 - - - 7 - - - - - 13 - - - 7 - - - - - 13 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 46 - - - 20 - - - 30 - - - 9 - - - - - 23 - - - 7 - - - - - 26 - - - 7 - - - - - - - 8 - - - 12 - - - 20 - - - 8 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 14 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 51 - - - 12 - - - 7 - - - - - - - 293 - - - 53 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 90 - - - 7 - - - - - - - 390 - - - 54 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 7 - - - - - 163 - - - 7 - - - - - - - 574 - - - 54 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 225 - - - 7 - - - - - - - 632 - - - 54 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 348 - - - 7 - - - - - 125 - - - 7 - - - - - - - 374 - - - 67 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 173 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 15 - - - - - 57 - - - - - 2 - - - 7 - - - - - 13 - - - 7 - - - - - - - 29 - - - 40 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 14 - - - 14 - - - 281 - - - 15 - - - 6 - - - 7 - - - - - 7 - - - - - 57 - - - 7 - - - - - - - 42 - - - 42 - - - 42 - - - 42 - - - 10 - - - 106 - - - 2 - - - 2 - - - 7 - - - - - 31 - - - 7 - - - - - - - 14 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 17 - - - 33 - - - - - 13 - - - 7 - - - - - - - 42 - - - 42 - - - 34 - - - 2 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 13 - - - 7 - - - - - - - 2 - - - 8 - - - 33 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 70 - - - 2 - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 16 - - - 21 - - - 28 - - - 7 - - - - - 2 - - - 7 - - - - - - - 11 - - - 7 - - - - - 2 - - - 36 - - - 99 - - - 17 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 15 - - - 7 - - - - - 49 - - - 36 - - - 7 - - - - - - - 10 - - - 42 - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 55 - - - 7 - - - - - - - 2 - - - 13 - - - 2 - - - 20 - - - 46 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 32 - - - 37 - - - 16 - - - 32 - - - 7 - - - - - - - 9 - - - 36 - - - 42 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 2 - - - 2 - - - 152 - - - 10 - - - 7 - - - - - 7 - - - - - 67 - - - 22 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 9 - - - 15 - - - 25 - - - 83 - - - 38 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 36 - - - 11 - - - 2 - - - 7 - - - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - 2 - - - 63 - - - 19 - - - 7 - - - 8 - - - - - - - 42 - - - 42 - - - 31 - - - 2 - - - 2 - - - 2 - - - 8 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 190 - - - 7 - - - - - 38 - - - 21 - - - 15 - - - 9 - - - 2 - - - 16 - - - 18 - - - - - - - 33 - - - 35 - - - 15 - - - 8 - - - 53 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 45 - - - 7 - - - - - 19 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 88 - - - 32 - - - 58 - - - 32 - - - 28 - - - 8 - - - 28 - - - 2 - - - 32 - - - 29 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 26 - - - 14 - - - 7 - - - - - 10 - - - 7 - - - - - 54 - - - 10 - - - 7 - - - - - 13 - - - 7 - - - - - 15 - - - 9 - - - 7 - - - - - - - 42 - - - 42 - - - 14 - - - 2 - - - 2 - - - 42 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 27 - - - 12 - - - 43 - - - 43 - - - - - - - 37 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 9 - - - 7 - - - - - - - 2 - - - 16 - - - 51 - - - - - 10 - - - 8 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 25 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 26 - - - 52 - - - - - 2 - - - 19 - - - - - 24 - - - 7 - - - - - - - 20 - - - 102 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 9 - - - 7 - - - - - 70 - - - 9 - - - 4 - - - 7 - - - - - 21 - - - 7 - - - - - - - 20 - - - 10 - - - 2 - - - 2 - - - 74 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 113 - - - 32 - - - 7 - - - - - 19 - - - 53 - - - 7 - - - - - - - 20 - - - 28 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 69 - - - 7 - - - - - 7 - - - - - 33 - - - 7 - - - - - - - 28 - - - - - 20 - - - 2 - - - 67 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 116 - - - 7 - - - - - 24 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 34 - - - 29 - - - 7 - - - - - 76 - - - 7 - - - - - - - 56 - - - 56 - - - 15 - - - 51 - - - 13 - - - 7 - - - - - 24 - - - 7 - - - - - 24 - - - 7 - - - - - - - 75 - - - 7 - - - - - 20 - - - 7 - - - - - 21 - - - 7 - - - 7 - - - 7 - - - - - 21 - - - 8 - - - 9 - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 7 - - - - - 42 - - - 42 - - - 20 - - - 7 - - - - - 54 - - - 36 - - - 8 - - - 7 - - - - - 24 - - - 14 - - - 7 - - - - - - - 7 - - - - - 11 - - - 145 - - - 20 - - - 110 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 31 - - - 31 - - - 26 - - - 7 - - - - - - - 81 - - - 14 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - 7 - - - - - 24 - - - 70 - - - 7 - - - - - - - 40 - - - 8 - - - 7 - - - - - 22 - - - 7 - - - - - - - 38 - - - 20 - - - 63 - - - 7 - - - - - 7 - - - - - 72 - - - 7 - - - - - 25 - - - 7 - - - - - - - 131 - - - 27 - - - 48 - - - 62 - - - 7 - - - 23 - - - - - 212 - - - 13 - - - - - - - 41 - - - 41 - - - 31 - - - 41 - - - 31 - - - 316 - - - 29 - - - 27 - - - 19 - - - - - 162 - - - - - 167 - - - - - 169 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 14 - - - - - 10 - - - 10 - - - 33 - - - 33 - - - 33 - - - 88 - - - 7 - - - - - 233 - - - - - 161 - - - - - 153 - - - - - 2 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 41 - - - 141 - - - 31 - - - - - 187 - - - 13 - - - - - 39 - - - - - - - 14 - - - 7 - - - 49 - - - 15 - - - - - 49 - - - 13 - - - - - - - 482 - - - 41 - - - 7 - - - - - 35 - - - 35 - - - 49 - - - 49 - - - 7 - - - - - 217 - - - - - 217 - - - - - 242 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 34 - - - 34 - - - - - 242 - - - 13 - - - - - 52 - - - 7 - - - - - 52 - - - 7 - - - - - 44 - - - 13 - - - - - - - 358 - - - 41 - - - 7 - - - - - 49 - - - 41 - - - 35 - - - 7 - - - - - 229 - - - 13 - - - - - 34 - - - 46 - - - - - 182 - - - 13 - - - - - 182 - - - 13 - - - - - 52 - - - 7 - - - - - 43 - - - 13 - - - - - - - 146 - - - 48 - - - 10 - - - 10 - - - 33 - - - 33 - - - 33 - - - 33 - - - 9 - - - 7 - - - - - 196 - - - 9 - - - - - 197 - - - 9 - - - - - 157 - - - - - 38 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 10 - - - 10 - - - 57 - - - 33 - - - 7 - - - - - 38 - - - 13 - - - - - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 44 - - - 458 - - - 7 - - - - - 318 - - - 21 - - - 13 - - - - - 246 - - - 13 - - - - - 288 - - - 9 - - - - - 199 - - - 9 - - - - - 309 - - - 17 - - - 9 - - - - - 200 - - - 9 - - - - - 435 - - - 9 - - - 9 - - - 9 - - - - - 14 - - - 7 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 49 - - - 17 - - - 7 - - - - - 29 - - - 16 - - - 90 - - - 33 - - - 10 - - - 41 - - - 33 - - - 26 - - - 33 - - - 61 - - - 33 - - - 370 - - - 7 - - - - - 257 - - - 9 - - - - - 316 - - - 9 - - - - - 291 - - - 9 - - - - - 457 - - - 9 - - - - - 312 - - - 9 - - - - - 336 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 48 - - - 7 - - - - - - - 33 - - - 53 - - - 76 - - - 7 - - - - - 424 - - - 17 - - - 10 - - - 9 - - - 13 - - - - - - - 9 - - - 24 - - - 40 - - - 9 - - - - - 42 - - - 42 - - - 10 - - - 17 - - - 20 - - - 24 - - - 15 - - - 18 - - - 10 - - - 10 - - - 26 - - - 29 - - - 53 - - - 14 - - - 2 - - - 16 - - - 15 - - - 5 - - - 12 - - - 13 - - - 8 - - - 17 - - - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 41 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 41 - - - 41 - - - 33 - - - 33 - - - 41 - - - 33 - - - 41 - - - 33 - - - 33 - - - 33 - - - 41 - - - 33 - - - 33 - - - 33 - - - 41 - - - 33 - - - 41 - - - 41 - - - 41 - - - 41 - - - 41 - - - 41 - - - 41 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 41 - - - 41 - - - 41 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 247 - - - 187 - - - 45 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 335 - - - 9 - - - 9 - - - - - 740 - - - 9 - - - 9 - - - 9 - - - 17 - - - - - 1090 - - - 9 - - - 9 - - - 19 - - - 9 - - - 19 - - - - - 421 - - - 9 - - - 13 - - - - - 428 - - - 9 - - - - - 257 - - - 10 - - - - - 385 - - - 9 - - - - - 670 - - - 9 - - - 10 - - - - - 1209 - - - 9 - - - 9 - - - 10 - - - 9 - - - 10 - - - 9 - - - 25 - - - - - 223 - - - 9 - - - - - 273 - - - 17 - - - - - 364 - - - 9 - - - 9 - - - - - 435 - - - 17 - - - 10 - - - 10 - - - - - 507 - - - - - 1082 - - - 14 - - - 17 - - - 17 - - - 14 - - - 17 - - - 14 - - - - - 809 - - - 14 - - - 17 - - - 20 - - - 17 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 33 - - - - - 298 - - - 13 - - - - - 430 - - - 13 - - - 17 - - - 10 - - - 9 - - - - - 267 - - - 13 - - - 17 - - - - - 237 - - - 13 - - - 10 - - - - - 234 - - - 13 - - - 9 - - - - - 250 - - - 13 - - - - - 246 - - - 13 - - - 15 - - - - - 233 - - - 13 - - - - - 358 - - - 13 - - - 9 - - - 13 - - - - - 364 - - - 13 - - - 17 - - - 9 - - - - - 197 - - - 13 - - - 9 - - - - - 329 - - - 13 - - - 9 - - - 9 - - - - - 347 - - - 13 - - - 9 - - - 9 - - - - - 243 - - - 13 - - - 9 - - - - - 271 - - - 13 - - - 11 - - - 9 - - - - - 260 - - - 13 - - - - - 535 - - - 13 - - - 9 - - - 9 - - - - - 225 - - - 13 - - - 9 - - - - - 335 - - - 13 - - - 9 - - - 9 - - - - - 402 - - - 13 - - - 9 - - - - - 442 - - - 13 - - - 10 - - - - - 548 - - - 13 - - - 10 - - - - - 544 - - - 13 - - - 10 - - - 9 - - - 10 - - - - - 295 - - - 13 - - - - - 233 - - - 13 - - - 13 - - - - - 233 - - - 13 - - - 14 - - - - - 391 - - - 13 - - - 13 - - - 13 - - - - - 299 - - - 13 - - - 13 - - - - - 390 - - - 13 - - - 13 - - - 13 - - - - - 260 - - - 13 - - - 10 - - - - - 348 - - - 13 - - - 10 - - - 13 - - - - - 1026 - - - 13 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - 739 - - - 13 - - - 13 - - - 13 - - - 10 - - - 10 - - - - - 240 - - - 13 - - - 9 - - - - - 355 - - - 13 - - - 9 - - - 9 - - - - - 246 - - - 13 - - - 9 - - - - - 427 - - - 13 - - - 9 - - - 9 - - - - - 264 - - - 13 - - - 25 - - - - - 266 - - - 13 - - - 9 - - - - - 222 - - - 13 - - - 9 - - - - - 295 - - - 13 - - - 9 - - - - - 645 - - - 13 - - - 10 - - - 9 - - - 9 - - - - - 455 - - - 13 - - - 13 - - - 13 - - - 9 - - - - - 233 - - - 13 - - - 9 - - - - - 354 - - - 13 - - - - - 369 - - - 13 - - - 9 - - - - - 348 - - - 13 - - - 9 - - - 9 - - - - - 9 - - - - - 25 - - - 7 - - - - - 24 - - - 24 - - - 24 - - - 7 - - - - - 25 - - - 7 - - - - - 23 - - - 9 - - - 7 - - - - - 25 - - - 7 - - - - - 25 - - - 7 - - - - - 25 - - - 7 - - - - - 25 - - - 7 - - - - - 14 - - - 7 - - - - - - - 33 - - - 214 - - - 33 - - - 7 - - - - - 213 - - - 9 - - - - - 223 - - - 9 - - - - - 13 - - - - - 13 - - - - - - - 14 - - - 8 - - - 9 - - - 9 - - - - - 33 - - - 82 - - - 7 - - - - - 294 - - - 10 - - - 13 - - - - - - - 14 - - - 7 - - - - - 33 - - - 33 - - - 33 - - - 247 - - - 187 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 335 - - - 13 - - - 13 - - - - - 766 - - - 13 - - - 13 - - - 13 - - - 13 - - - 13 - - - - - 320 - - - 13 - - - 36 - - - - - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 33 - - - 223 - - - 187 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 198 - - - 7 - - - - - 190 - - - 7 - - - - - 197 - - - 33 - - - - - 229 - - - 9 - - - - - 278 - - - 7 - - - - - 232 - - - 7 - - - - - 194 - - - 7 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 33 - - - 33 - - - 33 - - - 203 - - - 7 - - - - - 268 - - - - - 321 - - - - - 268 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 14 - - - 7 - - - - - 7 - - - - - 26 - - - 7 - - - - - 14 - - - 7 - - - - - - - 35 - - - 96 - - - 29 - - - 7 - - - 12 - - - - - 218 - - - 13 - - - - - 29 - - - 7 - - - - - - - 7 - - - - - 33 - - - 33 - - - 33 - - - 33 - - - 183 - - - 187 - - - 20 - - - 15 - - - 15 - - - 12 - - - 7 - - - - - 492 - - - 9 - - - - - 1229 - - - 9 - - - - - 344 - - - 13 - - - - - 596 - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 14 - - - 7 - - - - - 8 - - - 10 - - - 10 - - - 33 - - - 58 - - - 7 - - - - - 604 - - - 13 - - - - - - - 33 - - - 33 - - - 10 - - - 7 - - - - - 7 - - - - - 8 - - - - - 10 - - - - - 8 - - - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 38 - - - - - 37 - - - - - 35 - - - - - 285 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 22 - - - 22 - - - 36 - - - 24 - - - - - 33 - - - 170 - - - 7 - - - - - 197 - - - 13 - - - 21 - - - - - 15 - - - - - - - 46 - - - 9 - - - - - 80 - - - 7 - - - - - 275 - - - 10 - - - 13 - - - - - - - 66 - - - 2 - - - 9 - - - 7 - - - - - 15 - - - 7 - - - - - - - 27 - - - 41 - - - 95 - - - 47 - - - 9 - - - 7 - - - - - 169 - - - 13 - - - - - - - 33 - - - 31 - - - 7 - - - - - 196 - - - 10 - - - 13 - - - - - - - 33 - - - 12 - - - 7 - - - - - 282 - - - 10 - - - 13 - - - - - - - 33 - - - 20 - - - 7 - - - - - 331 - - - 13 - - - - - - - 37 - - - 23 - - - 214 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 138 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 137 - - - 15 - - - 6 - - - 7 - - - - - 41 - - - 7 - - - - - 183 - - - 13 - - - - - 41 - - - 7 - - - - - 183 - - - 13 - - - - - - - 41 - - - 49 - - - 68 - - - 7 - - - - - 354 - - - 13 - - - - - 469 - - - 13 - - - - - 7 - - - - - 14 - - - 26 - - - 7 - - - - - 20 - - - 7 - - - - - - - 33 - - - 33 - - - 33 - - - 248 - - - 7 - - - - - 160 - - - 13 - - - - - 159 - - - 13 - - - - - 160 - - - 13 - - - - - 14 - - - 14 - - - 14 - - - 7 - - - - - - - 15 - - - 14 - - - 8 - - - 7 - - - - - 7 - - - 7 - - - 49 - - - 49 - - - 15 - - - 8 - - - 14 - - - 7 - - - - - 76 - - - 7 - - - - - 177 - - - 13 - - - - - 191 - - - 13 - - - - - - - 41 - - - 41 - - - 66 - - - 7 - - - - - 186 - - - 13 - - - - - 59 - - - 13 - - - - - - - 20 - - - 20 - - - 18 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 10 - - - 7 - - - - - 11 - - - 10 - - - 10 - - - 11 - - - 2 - - - 7 - - - - - 11 - - - 7 - - - - - 11 - - - 7 - - - - - 10 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - 10 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 2 - - - 2 - - - 8 - - - 8 - - - - - 18 - - - 7 - - - - - - - 10 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 10 - - - 7 - - - - - 7 - - - - - 15 - - - 15 - - - 2 - - - 10 - - - 2 - - - 2 - - - 8 - - - 8 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - 7 - - - - - 7 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 8 - - - 8 - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 0 - - - 7 - - - - - 0 - - - 7 - - - - - 0 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 14 - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 8 - - - 8 - - - - - 8 - - - - - 8 - - - - - 8 - - - - - 2 - - - 7 - - - - - - - 8 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - - - 8 - - - - - 15 - - - - - 16 - - - - - 16 - - - - - 9 - - - 8 - - - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - - - 7 - - - 8 - - - - - 9 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 23 - - - - - 24 - - - - - 2 - - - 7 - - - - - - - 6 - - - 12 - - - 19 - - - 7 - - - - - - - 2 - - - 17 - - - 19 - - - 26 - - - 12 - - - 22 - - - 7 - - - - - - - 7 - - - 10 - - - 12 - - - 7 - - - - - - - 1 - - - 1 - - - 2 - - - 2 - - - 7 - - - - - - - 2 - - - 7 - - - 42 - - - 42 - - - - - - - 8 - - - 10 - - - 2 - - - 13 - - - 7 - - - 7 - - - - - - - 2 - - - - - 2 - - - 27 - - - 50 - - - 18 - - - 7 - - - 31 - - - 58 - - - 53 - - - 31 - - - 30 - - - 62 - - - 58 - - - 208 - - - 60 - - - 10 - - - 24 - - - 10 - - - 19 - - - - - 24 - - - - - 33 - - - 15 - - - 31 - - - 56 - - - 61 - - - 38 - - - 78 - - - - - - - 2 - - - 7 - - - - - - - 2 - - - 23 - - - 23 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 72 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 26 - - - 1 - - - 6 - - - 7 - - - - - - - 2 - - - 32 - - - 32 - - - 32 - - - 28 - - - 6 - - - 7 - - - 7 - - - 7 - - - - - 14 - - - 7 - - - - - - - 29 - - - 8 - - - 7 - - - - - - - 2 - - - 34 - - - 28 - - - 7 - - - - - - - 2 - - - 76 - - - 51 - - - 7 - - - - - - - 42 - - - 42 - - - 2 - - - 17 - - - 169 - - - 91 - - - 130 - - - 485 - - - 10 - - - 7 - - - - - 0 - - - 0 - - - - - - - 2 - - - 27 - - - 48 - - - 33 - - - 48 - - - 33 - - - 2 - - - 9 - - - 7 - - - - - 156 - - - - - 163 - - - - - 1229 - - - 9 - - - - - 13 - - - - - 13 - - - - - 13 - - - - - - - 2 - - - - - 2 - - - 7 - - - - - - - 23 - - - 2 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 26 - - - 13 - - - 150 - - - 57 - - - 6 - - - 7 - - - - - - - 10 - - - 7 - - - - - 30 - - - 7 - - - 2 - - - 14 - - - 7 - - - - - 14 - - - 19 - - - 14 - - - 40 - - - 82 - - - 15 - - - 6 - - - 7 - - - - - - - 92 - - - 7 - - - - - - - 92 - - - 7 - - - - - - - 92 - - - 7 - - - - - - - 92 - - - 7 - - - - - - - 22 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 7 - - - - - 28 - - - 7 - - - - - - - 82 - - - 7 - - - - - - - 16 - - - 7 - - - - - - - 15 - - - 23 - - - 199 - - - 7 - - - - - 14 - - - 14 - - - 149 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 149 - - - 15 - - - 6 - - - 7 - - - - - - - 15 - - - 103 - - - 7 - - - - - 14 - - - 14 - - - 196 - - - 15 - - - 6 - - - 7 - - - - - - - 37 - - - 37 - - - 275 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 159 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 246 - - - 15 - - - 6 - - - 7 - - - - - - - 51 - - - 104 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 130 - - - 15 - - - 6 - - - 7 - - - - - - - 23 - - - 119 - - - 7 - - - - - 20 - - - 27 - - - 15 - - - 27 - - - - - 32 - - - 39 - - - 9 - - - 16 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 191 - - - 15 - - - 6 - - - 7 - - - - - - - 49 - - - 37 - - - - - 37 - - - 37 - - - 449 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 198 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 159 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 154 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 159 - - - 15 - - - 6 - - - 7 - - - - - - - 37 - - - 7 - - - - - 464 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 264 - - - 107 - - - 6 - - - 7 - - - 13 - - - 13 - - - 13 - - - - - - - 9 - - - 15 - - - - - 51 - - - 210 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 377 - - - 93 - - - 6 - - - 7 - - - 23 - - - - - - - 22 - - - 154 - - - - - 282 - - - 7 - - - - - 14 - - - 14 - - - 693 - - - 103 - - - 6 - - - 7 - - - - - - - 15 - - - 2 - - - 37 - - - 2 - - - 211 - - - 7 - - - - - 14 - - - 14 - - - 149 - - - 15 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 168 - - - 15 - - - 6 - - - 7 - - - - - - - 42 - - - 42 - - - 22 - - - 12 - - - 40 - - - 7 - - - - - 14 - - - 14 - - - 131 - - - 15 - - - 6 - - - 7 - - - - - - - 30 - - - 2 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 190 - - - 57 - - - 6 - - - 7 - - - 20 - - - - - - - 2 - - - 23 - - - 7 - - - 11 - - - - - 10 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 27 - - - 1 - - - 6 - - - 7 - - - - - - - 42 - - - 23 - - - 69 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 98 - - - 15 - - - 6 - - - 7 - - - - - - - 22 - - - 12 - - - 180 - - - 7 - - - - - 14 - - - 14 - - - 142 - - - 15 - - - 6 - - - 7 - - - - - - - 23 - - - 78 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 38 - - - 1 - - - 6 - - - 7 - - - - - - - 23 - - - 62 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 168 - - - 15 - - - 6 - - - 7 - - - - - - - 37 - - - 7 - - - - - 127 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 214 - - - 15 - - - 6 - - - 7 - - - - - - - 68 - - - 15 - - - 7 - - - - - 14 - - - 14 - - - 84 - - - 15 - - - 6 - - - 7 - - - - - - - 22 - - - 70 - - - - - 8 - - - 7 - - - - - 14 - - - 14 - - - 93 - - - 15 - - - 6 - - - 7 - - - - - - - 37 - - - 138 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 14 - - - 14 - - - 14 - - - 40 - - - 242 - - - 15 - - - 6 - - - 7 - - - - - 28 - - - 7 - - - - - - - 68 - - - 15 - - - 7 - - - - - 14 - - - 14 - - - 207 - - - 83 - - - 6 - - - 7 - - - - - - - 23 - - - 28 - - - 141 - - - 7 - - - 12 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 117 - - - 15 - - - 6 - - - 7 - - - - - 29 - - - 7 - - - - - - - 2 - - - 8 - - - - - 8 - - - 23 - - - 68 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 75 - - - 1 - - - 6 - - - 7 - - - - - 44 - - - 7 - - - - - - - 51 - - - 10 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 52 - - - 101 - - - 15 - - - 6 - - - 7 - - - - - - - 9 - - - 14 - - - 8 - - - - - 12 - - - 13 - - - - - 8 - - - - - 2 - - - 61 - - - 7 - - - - - - - 30 - - - 36 - - - 7 - - - - - 16 - - - - - 10 - - - 34 - - - 38 - - - 334 - - - 7 - - - - - - - 11 - - - 31 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 41 - - - 23 - - - 9 - - - 311 - - - 7 - - - - - - - 10 - - - 10 - - - 7 - - - - - 10 - - - 10 - - - 7 - - - - - 131 - - - 7 - - - - - - - 38 - - - 10 - - - 10 - - - 10 - - - 7 - - - - - - - 97 - - - 34 - - - 7 - - - - - - - 7 - - - 7 - - - - - 7 - - - 8 - - - - - 14 - - - 14 - - - 7 - - - - - 47 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 21 - - - 16 - - - 19 - - - - - 10 - - - 10 - - - 7 - - - - - 60 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 14 - - - 7 - - - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 7 - - - - - 80 - - - 7 - - - - - - - 15 - - - 7 - - - - - 67 - - - 7 - - - - - - - 15 - - - 7 - - - - - 15 - - - - - 22 - - - 7 - - - - - - - 7 - - - 15 - - - - - 15 - - - - - 96 - - - 7 - - - - - - - 14 - - - - - 93 - - - 74 - - - 7 - - - - - - - 23 - - - 7 - - - - - 112 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 76 - - - 15 - - - 6 - - - 7 - - - - - - - 10 - - - 10 - - - 2 - - - 7 - - - - - - - 7 - - - - - 7 - - - - - 4 - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - 23 - - - 23 - - - 23 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 37 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 37 - - - 1 - - - 6 - - - 7 - - - - - 14 - - - 14 - - - 14 - - - 26 - - - 37 - - - 1 - - - 6 - - - 7 - - - - - - - 23 - - - 11 - - - - - 10 - - - 10 - - - 2 - - - 7 - - - - - - - 58 - - - 2 - - - 7 - - - - - - - 2 - - - 18 - - - - - - - 8 - - - - - 10 - - - - - - - 7 - - - 7 - - - - - 7 - - - 7 - - - - - 56 - - - 7 - - - - - - - 43 - - - 7 - - - 7 - - - - - 13 - - - 42 - - - 42 - - - 7 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 2 - - - 7 - - - - - - - 10 - - - 7 - - - - - - - 16 - - - 16 - - - 15 - - - 70 - - - 7 - - - - - - - 2 - - - 2 - - - 7 - - - - - - - 15 - - - 16 - - - 7 - - - - - - - 2 - - - 7 - - - - - 2 - - - 7 - - - - - 116 - - - 7 - - - - - - - 10 - - - 7 - - - - - - - 7 - - - - - 2 - - - 7 - - - - - - - 2 - - - - - 2 - - - - - - - 70 - - - 7 - - - - - - - 10 - - - 15 - - - - - 164 - - - 7 - - - - - 10 - - - 15 - - - - - - - 201 - - - 7 - - - - - - - 13 - - - 15 - - - - - 72 - - - 7 - - - - - - - 68 - - - 7 - - - - - - - 2 - - - 51 - - - 7 - - - - - 7 - - - - - - - 2 - - - 11 - - - - - - - 20 - - - 7 - - - - - - - 2 - - - 8 - - - 7 - - - + + + + + + + 8 + + + 14 + + + 2 + + + 2 + + + 15 + + + 10 + + + 8 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1216 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + + + 130 + + + 70 + + + 61 + + + 104 + + + 61 + + + 104 + + + 104 + + + 110 + + + 70 + + + 61 + + + 14 + + + 14 + + + 14 + + + 14 + + + 22 + + + + + 30 + + + 2 + + + 2 + + + 10 + + + 2 + + + 8 + + + 8 + + + + + 99 + + + 257 + + + 172 + + + 124 + + + 134 + + + 124 + + + 128 + + + 124 + + + 72 + + + 125 + + + 127 + + + 124 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 117 + + + 118 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 125 + + + 111 + + + 116 + + + 111 + + + 111 + + + 230 + + + 122 + + + 140 + + + 123 + + + 116 + + + 140 + + + 114 + + + 144 + + + 149 + + + 155 + + + 125 + + + 132 + + + 137 + + + 136 + + + 133 + + + 106 + + + 143 + + + 138 + + + 141 + + + 137 + + + 151 + + + 140 + + + 134 + + + 373 + + + 114 + + + 114 + + + 114 + + + 114 + + + 117 + + + 119 + + + 117 + + + 119 + + + 159 + + + 159 + + + 246 + + + 130 + + + 247 + + + 249 + + + 123 + + + 187 + + + 73 + + + 68 + + + 73 + + + 73 + + + 73 + + + 73 + + + 74 + + + 74 + + + 73 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 74 + + + 58 + + + 58 + + + 58 + + + 58 + + + 67 + + + 93 + + + 112 + + + 75 + + + 102 + + + 74 + + + 128 + + + 92 + + + 94 + + + 93 + + + 111 + + + 112 + + + 111 + + + 91 + + + 112 + + + 125 + + + 140 + + + 102 + + + 69 + + + 77 + + + 55 + + + 55 + + + 55 + + + 55 + + + 55 + + + 59 + + + 55 + + + 59 + + + 60 + + + 69 + + + 60 + + + 69 + + + 60 + + + 68 + + + 60 + + + 60 + + + 69 + + + 60 + + + 74 + + + 20 + + + 15 + + + 15 + + + 12 + + + 8 + + + 8 + + + 34 + + + + + 7 + + + + + 98 + + + 7 + + + + + 93 + + + 7 + + + + + 110 + + + 7 + + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + 120 + + + 7 + + + + + 0 + + + 0 + + + + + 120 + + + 7 + + + + + 80 + + + 7 + + + + + + + 7 + + + + + 15 + + + 19 + + + 121 + + + 7 + + + + + + + 35 + + + 35 + + + 7 + + + + + 260 + + + 7 + + + + + + + 16 + + + 16 + + + 9 + + + + + 14 + + + 8 + + + 7 + + + 22 + + + 19 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 25 + + + 28 + + + 25 + + + 25 + + + 28 + + + 28 + + + 19 + + + 17 + + + 23 + + + 23 + + + 21 + + + 21 + + + 22 + + + 19 + + + 26 + + + 9 + + + + + 15 + + + 15 + + + + + 16 + + + 22 + + + 9 + + + + + 42 + + + 42 + + + 80 + + + 41 + + + 34 + + + 1371 + + + 2279 + + + 875 + + + 348 + + + 1145 + + + 1155 + + + 14 + + + 444 + + + 322 + + + 877 + + + 4 + + + 1537 + + + 671 + + + 1809 + + + 912 + + + 684 + + + 1253 + + + 928 + + + 2307 + + + 4 + + + 1144 + + + 4 + + + 1266 + + + 83 + + + 23 + + + 503 + + + 90 + + + 168 + + + 1942 + + + 3034 + + + 1048 + + + 631 + + + 19 + + + 1547 + + + 1817 + + + 693 + + + 894 + + + 686 + + + 1984 + + + 2407 + + + 1048 + + + 1984 + + + 2407 + + + 1048 + + + 1367 + + + 1138 + + + 650 + + + 444 + + + 1984 + + + 2421 + + + 1048 + + + 1984 + + + 2407 + + + 1048 + + + 924 + + + 2295 + + + 1138 + + + 1168 + + + 2295 + + + 346 + + + 1328 + + + 320 + + + 1312 + + + 1118 + + + 54 + + + 405 + + + 1946 + + + 3034 + + + 1048 + + + 631 + + + 819 + + + 419 + + + 1547 + + + 675 + + + 1593 + + + 912 + + + 686 + + + 1258 + + + 1153 + + + 1137 + + + 650 + + + 443 + + + 1133 + + + 2290 + + + 897 + + + 349 + + + 1155 + + + 455 + + + 322 + + + 34 + + + 992 + + + 298 + + + 993 + + + 295 + + + 429 + + + 1115 + + + 1120 + + + 80 + + + 187 + + + 12 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 103 + + + 103 + + + 7 + + + + + 234 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 154 + + + 15 + + + 6 + + + 7 + + + + + 81 + + + 81 + + + 7 + + + + + 104 + + + 104 + + + 7 + + + + + 234 + + + 7 + + + + + 88 + + + 7 + + + + + 104 + + + 104 + + + 7 + + + + + 234 + + + 7 + + + + + 224 + + + 7 + + + + + 220 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 17 + + + 9 + + + 15 + + + 9 + + + 2 + + + 14 + + + 10 + + + 12 + + + 12 + + + 2 + + + 16 + + + 2 + + + 45 + + + 53 + + + 16 + + + + + 42 + + + 42 + + + 20 + + + 7 + + + + + 80 + + + 34 + + + 42 + + + 42 + + + 916 + + + 37 + + + 459 + + + 907 + + + 41 + + + 232 + + + 2674 + + + 811 + + + 37 + + + 2965 + + + 37 + + + 2901 + + + 37 + + + 80 + + + 187 + + + 9 + + + 112 + + + 2 + + + 9 + + + 10 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 92 + + + 7 + + + + + 0 + + + 0 + + + + + 86 + + + 7 + + + + + 96 + + + 7 + + + + + 102 + + + 7 + + + + + + + 14 + + + 2 + + + 7 + + + + + 419 + + + 312 + + + 235 + + + 619 + + + 99 + + + 7 + + + + + + + 2 + + + 131 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + 761 + + + 7 + + + + + + + 18 + + + 7 + + + 18 + + + 10 + + + 10 + + + 197 + + + 39 + + + 7 + + + + + + + 7 + + + + + 77 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 16 + + + 260 + + + 16 + + + 54 + + + 7 + + + + + + + 67 + + + 7 + + + + + + + 5 + + + 7 + + + + + 9 + + + 7 + + + + + 2 + + + 2 + + + 10 + + + 13 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 5 + + + 5 + + + 14 + + + 198 + + + 996 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 175 + + + 10 + + + 7 + + + + + + + 14 + + + 8 + + + 7 + + + + + 374 + + + 18 + + + + + + + 2 + + + 2 + + + 2 + + + 5 + + + 28 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 14 + + + 7 + + + + + 7 + + + + + 90 + + + 7 + + + + + 25 + + + 7 + + + + + + + 7 + + + + + 70 + + + 15 + + + 7 + + + + + 38 + + + 7 + + + + + + + 2 + + + 16 + + + 7 + + + + + + + 48 + + + 7 + + + + + + + 542 + + + 9 + + + 15 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 9 + + + + + 105 + + + 368 + + + 7 + + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + + + 375 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 382 + + + 7 + + + + + + + 9 + + + 6 + + + 7 + + + + + 2 + + + 255 + + + 7 + + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + + + 431 + + + 168 + + + 115 + + + 7 + + + + + + + 7 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 577 + + + 7 + + + + + + + 33 + + + 7 + + + + + 15 + + + 104 + + + 7 + + + + + 0 + + + 0 + + + + + + + 15 + + + + + 10 + + + 153 + + + 7 + + + + + 0 + + + 0 + + + + + + + 10 + + + 2 + + + 10 + + + 2 + + + 3609 + + + 39 + + + + + + + 17 + + + 7 + + + + + 482 + + + 7 + + + + + 0 + + + 0 + + + + + + + 15 + + + 2 + + + 24 + + + 2 + + + 10 + + + 2 + + + 20 + + + 75 + + + 1142 + + + 18 + + + + + + + 42 + + + 42 + + + 332 + + + 11 + + + 7 + + + + + + + 1207 + + + 7 + + + + + + + 2 + + + 379 + + + 7 + + + + + + + 10 + + + 10 + + + 16 + + + 2 + + + 10 + + + 15 + + + 2 + + + 7 + + + + + 15 + + + 45 + + + 2 + + + 35 + + + 2 + + + 7 + + + + + 224 + + + 545 + + + 7 + + + + + + + 18 + + + 7 + + + + + 38 + + + 7 + + + + + 406 + + + 7 + + + + + + + 18 + + + 7 + + + + + 16 + + + 7 + + + + + 90 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 2 + + + 14 + + + 7 + + + + + 90 + + + 12 + + + 7 + + + + + + + 347 + + + 7 + + + + + + + 10 + + + 10 + + + 868 + + + 7 + + + + + + + 249 + + + 7 + + + + + + + 1101 + + + 11 + + + 11 + + + 14 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + + + 42 + + + 42 + + + 171 + + + 12 + + + 42 + + + + + 30 + + + 7 + + + + + + + 10 + + + 23 + + + 342 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 91 + + + 7 + + + + + + + 7 + + + 10 + + + 7 + + + + + 12 + + + 10 + + + 1195 + + + 7 + + + + + + + 15 + + + 11 + + + 491 + + + 14 + + + + + + + 192 + + + 2 + + + 7 + + + + + + + 8 + + + + + 21 + + + 7 + + + + + + + 21 + + + 34 + + + 21 + + + 34 + + + 2 + + + 9 + + + 72 + + + 103 + + + 105 + + + 7 + + + + + 46 + + + 7 + + + + + 114 + + + 7 + + + + + 118 + + + 7 + + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + + + 0 + + + 7 + + + + + 2 + + + 71 + + + 7 + + + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 253 + + + 35 + + + 7 + + + + + 10 + + + + + + + 101 + + + 2 + + + 14 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 488 + + + 7 + + + + + 15 + + + 18 + + + + + + + 11 + + + 7 + + + + + 41 + + + 41 + + + 42 + + + 48 + + + 72 + + + 85 + + + 187 + + + 86 + + + 92 + + + 106 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 110 + + + 7 + + + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + 143 + + + 7 + + + + + + + 7 + + + + + 106 + + + 7 + + + + + + + 7 + + + + + 153 + + + 7 + + + + + + + 2 + + + 2 + + + 383 + + + 7 + + + + + + + 191 + + + 7 + + + + + + + 91 + + + 7 + + + + + + + 2 + + + 112 + + + 7 + + + + + + + 23 + + + 23 + + + 2 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 5 + + + 130 + + + 7 + + + + + 0 + + + 0 + + + + + + + 39 + + + 39 + + + 44 + + + 52 + + + 227 + + + 7 + + + + + + + 15 + + + 15 + + + 7 + + + + + 10 + + + 2 + + + 10 + + + 882 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 31 + + + 37 + + + 18 + + + 24 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 22 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 12 + + + 7 + + + + + 28 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 26 + + + 2 + + + 7 + + + + + + + 14 + + + 2 + + + 7 + + + + + + + 2 + + + 8 + + + + + 38 + + + 7 + + + + + + + 4 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 13 + + + 14 + + + 7 + + + + + + + 2 + + + 8 + + + + + 13 + + + 14 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + + + 14 + + + 2 + + + 7 + + + + + + + 24 + + + 59 + + + + + 46 + + + 7 + + + + + 25 + + + 9 + + + + + 40 + + + 39 + + + 7 + + + + + + + 2 + + + 8 + + + 7 + + + + + 15 + + + 7 + + + + + 14 + + + 7 + + + + + + + 2 + + + 8 + + + 7 + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 13 + + + 8 + + + + + 9 + + + 14 + + + 7 + + + + + + + 14 + + + 13 + + + 8 + + + + + 13 + + + 14 + + + 7 + + + + + + + 8 + + + + + 16 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 37 + + + 2 + + + 7 + + + + + + + 20 + + + 15 + + + + + 15 + + + 21 + + + 7 + + + + + + + 15 + + + 20 + + + + + 20 + + + 7 + + + + + + + 2 + + + 8 + + + + + 2 + + + 8 + + + + + 25 + + + 14 + + + 7 + + + + + + + 25 + + + 2 + + + 7 + + + + + + + 25 + + + 2 + + + 7 + + + + + + + 36 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 9 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 9 + + + 7 + + + + + 9 + + + 7 + + + + + 9 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 15 + + + 13 + + + 75 + + + 39 + + + + + 22 + + + + + 17 + + + 7 + + + + + + + 15 + + + 16 + + + 15 + + + + + 52 + + + 22 + + + + + 32 + + + 7 + + + + + + + 15 + + + 15 + + + 15 + + + 67 + + + 27 + + + + + 2 + + + 15 + + + + + 20 + + + 15 + + + + + 15 + + + 15 + + + + + 20 + + + 20 + + + 15 + + + + + 7 + + + + + 10 + + + 7 + + + + + 7 + + + + + 49 + + + 7 + + + + + + + 2 + + + 7 + + + + + 37 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 14 + + + 7 + + + + + 145 + + + 177 + + + 7 + + + + + + + 22 + + + 15 + + + + + 38 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 87 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 25 + + + 7 + + + + + 13 + + + 37 + + + 7 + + + + + + + 8 + + + 7 + + + + + + + 15 + + + 21 + + + + + 23 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 7 + + + 41 + + + 7 + + + + + + + 44 + + + 7 + + + + + 12 + + + 7 + + + + + 7 + + + + + 19 + + + 7 + + + + + + + 44 + + + 7 + + + + + 12 + + + 19 + + + 8 + + + + + + + 16 + + + + + 26 + + + 16 + + + + + 16 + + + 26 + + + + + 16 + + + 26 + + + 16 + + + + + 16 + + + 7 + + + + + 26 + + + 16 + + + 7 + + + + + 16 + + + 26 + + + 7 + + + + + 16 + + + 26 + + + 16 + + + 7 + + + + + 51 + + + 7 + + + + + 98 + + + 7 + + + + + + + 7 + + + + + 2 + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 37 + + + 9 + + + 72 + + + 22 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 20 + + + 7 + + + + + + + 14 + + + 33 + + + 15 + + + 55 + + + 69 + + + 78 + + + 39 + + + 7 + + + + + 7 + + + + + 207 + + + 7 + + + + + + + 18 + + + 14 + + + 7 + + + + + 49 + + + 7 + + + + + + + 2 + + + 7 + + + + + 14 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 13 + + + 7 + + + + + 14 + + + 7 + + + + + 23 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 21 + + + 15 + + + + + 84 + + + 25 + + + 7 + + + + + + + 51 + + + 95 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 116 + + + 15 + + + 6 + + + 7 + + + + + + + 23 + + + 10 + + + 10 + + + 7 + + + + + 85 + + + 7 + + + + + + + 15 + + + 15 + + + 7 + + + + + 15 + + + + + 2 + + + 7 + + + + + + + 76 + + + 81 + + + 72 + + + 16 + + + + + 18 + + + 218 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 62 + + + 7 + + + + + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 12 + + + 27 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 8 + + + 13 + + + + + 2 + + + 7 + + + + + + + 20 + + + 7 + + + + + 22 + + + 7 + + + + + 7 + + + + + + + 14 + + + 33 + + + 15 + + + 55 + + + 69 + + + 78 + + + 39 + + + 7 + + + + + 7 + + + + + 212 + + + 186 + + + 7 + + + + + 16 + + + + + + + 15 + + + 15 + + + 7 + + + + + 9 + + + + + 57 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 16 + + + + + 22 + + + + + 113 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 9 + + + + + 15 + + + 7 + + + + + 54 + + + 7 + + + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + 7 + + + + + 238 + + + 36 + + + 7 + + + + + + + 19 + + + 2 + + + 7 + + + + + 19 + + + 2 + + + 7 + + + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 9 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 19 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 15 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 16 + + + 7 + + + + + 22 + + + 7 + + + + + + + 10 + + + 10 + + + 16 + + + 7 + + + + + 2 + + + 7 + + + + + + + 13 + + + 7 + + + + + 8 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + + + 10 + + + 7 + + + + + + + 5 + + + 11 + + + 7 + + + + + 2 + + + 7 + + + + + + + 20 + + + 7 + + + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 15 + + + 2 + + + 15 + + + + + 60 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 9 + + + 9 + + + 15 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 28 + + + 9 + + + 23 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 10 + + + 7 + + + + + 9 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 2 + + + 2 + + + 21 + + + 7 + + + + + 2 + + + 7 + + + + + + + 21 + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 2 + + + + + 10 + + + 7 + + + + + 26 + + + 15 + + + + + 34 + + + 7 + + + + + 8 + + + + + 10 + + + 7 + + + + + 26 + + + 15 + + + + + 33 + + + 7 + + + + + 12 + + + 7 + + + + + + + 2 + + + + + 10 + + + 7 + + + + + 26 + + + 22 + + + + + 33 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + 15 + + + + + 25 + + + 27 + + + 14 + + + 7 + + + + + + + 22 + + + 15 + + + + + 58 + + + 7 + + + + + 14 + + + 19 + + + 82 + + + 15 + + + 6 + + + 7 + + + + + + + 13 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 76 + + + 7 + + + + + + + 16 + + + 24 + + + + + 14 + + + 15 + + + + + 86 + + + 7 + + + + + + + 2 + + + 7 + + + + + 9 + + + + + 9 + + + 7 + + + + + 16 + + + 7 + + + + + 27 + + + 27 + + + + + 28 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + 43 + + + 21 + + + 7 + + + + + + + 23 + + + 7 + + + + + 29 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + 15 + + + 21 + + + 15 + + + 133 + + + 15 + + + 266 + + + 114 + + + 169 + + + 77 + + + 15 + + + 135 + + + 78 + + + 15 + + + 31 + + + 46 + + + + + 15 + + + 29 + + + + + 20 + + + 32 + + + 81 + + + 7 + + + 31 + + + 27 + + + + + 140 + + + 7 + + + + + 93 + + + 7 + + + + + 26 + + + 26 + + + 15 + + + 15 + + + + + 472 + + + 25 + + + 7 + + + + + + + 9 + + + 7 + + + + + 202 + + + 7 + + + + + + + 23 + + + 33 + + + 33 + + + 7 + + + + + 20 + + + 7 + + + + + 18 + + + 23 + + + 46 + + + 16 + + + 23 + + + 213 + + + 7 + + + + + + + 315 + + + 34 + + + 86 + + + 235 + + + 114 + + + 20 + + + 15 + + + + + 28 + + + 28 + + + 29 + + + 9 + + + + + 149 + + + 7 + + + + + + + 62 + + + 7 + + + + + + + 53 + + + 7 + + + + + 10 + + + 7 + + + + + 23 + + + 7 + + + + + + + 10 + + + 17 + + + 7 + + + + + 7 + + + + + 19 + + + 7 + + + + + + + 27 + + + 23 + + + 7 + + + + + 19 + + + 22 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + + + 18 + + + 2 + + + 7 + + + + + 22 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + + + 18 + + + 7 + + + + + 14 + + + 7 + + + + + 46 + + + 46 + + + 7 + + + + + + + 42 + + + 42 + + + 21 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 26 + + + 12 + + + 7 + + + + + + + 12 + + + 7 + + + + + 125 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 938 + + + 7 + + + + + + + 1332 + + + 7 + + + + + + + 68 + + + 64 + + + 7 + + + + + + + 15 + + + 9 + + + 9 + + + + + 202 + + + 7 + + + + + + + 114 + + + 7 + + + + + 53 + + + 15 + + + + + + + 117 + + + 7 + + + + + + + 22 + + + 9 + + + + + 22 + + + 9 + + + + + 149 + + + 7 + + + + + + + 158 + + + 7 + + + + + + + 62 + + + 7 + + + + + + + 10 + + + 10 + + + 11 + + + 10 + + + + + 78 + + + 7 + + + + + + + 134 + + + 7 + + + + + + + 92 + + + 7 + + + + + + + 14 + + + 26 + + + 19 + + + 19 + + + 25 + + + 25 + + + 37 + + + 37 + + + 7 + + + + + 2253 + + + 7 + + + + + + + 34 + + + 15 + + + 9 + + + 1157 + + + 38 + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 15 + + + + + 15 + + + 7 + + + + + + + 7 + + + + + 15 + + + + + 9 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + + + 7 + + + + + 2 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + + + 7 + + + + + 2 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 36 + + + 16 + + + + + 13 + + + 12 + + + + + + + 16 + + + + + 16 + + + 7 + + + + + + + 15 + + + 0 + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 57 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 21 + + + 38 + + + 10 + + + 10 + + + 7 + + + + + 14 + + + 7 + + + + + + + 57 + + + + + 2 + + + 7 + + + + + + + 12 + + + 19 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 102 + + + 7 + + + + + + + 7 + + + + + 14 + + + 18 + + + 7 + + + + + 2 + + + 7 + + + + + + + 57 + + + 16 + + + 22 + + + 7 + + + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 41 + + + 7 + + + + + + + 29 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 80 + + + 1 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 22 + + + 22 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 98 + + + 15 + + + 6 + + + 7 + + + + + + + 40 + + + 7 + + + + + + + 8 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 109 + + + 7 + + + + + + + 7 + + + + + 10 + + + 19 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 44 + + + 7 + + + + + 22 + + + 7 + + + + + + + 8 + + + 7 + + + + + 2 + + + 8 + + + 7 + + + + + + + 7 + + + + + 12 + + + 7 + + + + + 25 + + + 7 + + + + + + + 8 + + + 7 + + + + + + + 28 + + + 7 + + + + + 7 + + + + + 7 + + + + + 28 + + + 7 + + + + + + + 7 + + + 11 + + + + + 14 + + + 7 + + + + + + + 7 + + + + + 18 + + + 46 + + + 7 + + + + + + + 7 + + + + + 0 + + + 7 + + + + + 16 + + + 7 + + + + + 17 + + + 10 + + + 25 + + + 13 + + + 7 + + + + + + + 119 + + + 7 + + + 25 + + + + + 15 + + + 16 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 10 + + + 2 + + + 24 + + + 7 + + + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 7 + + + + + 289 + + + 7 + + + + + + + 15 + + + 2 + + + 37 + + + 2 + + + 211 + + + 7 + + + + + 14 + + + 14 + + + 149 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 168 + + + 15 + + + 6 + + + 7 + + + + + + + 11 + + + 7 + + + + + 16 + + + 12 + + + 7 + + + + + + + 37 + + + 7 + + + + + 75 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 91 + + + 15 + + + 6 + + + 7 + + + + + + + 69 + + + 20 + + + 7 + + + + + + + 48 + + + 7 + + + + + 155 + + + 7 + + + + + + + 22 + + + + + 121 + + + 7 + + + + + 18 + + + 26 + + + + + + + 15 + + + 7 + + + + + 7 + + + + + 15 + + + 7 + + + + + + + 22 + + + 42 + + + 42 + + + 12 + + + 205 + + + + + 7 + + + + + 47 + + + 7 + + + + + + + 7 + + + + + 26 + + + 15 + + + + + 19 + + + 7 + + + + + + + 14 + + + 15 + + + 7 + + + + + 7 + + + + + 7 + + + + + 22 + + + 7 + + + + + + + 23 + + + + + 23 + + + 7 + + + + + 23 + + + 7 + + + + + 23 + + + 7 + + + + + 37 + + + 7 + + + + + 37 + + + 7 + + + + + 37 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 77 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 89 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 89 + + + 15 + + + 6 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 36 + + + 7 + + + + + 23 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 49 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 23 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 36 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 49 + + + 1 + + + 6 + + + 7 + + + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 123 + + + 7 + + + + + + + 0 + + + 0 + + + 14 + + + 96 + + + 7 + + + + + 22 + + + 54 + + + 7 + + + + + 22 + + + 49 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 14 + + + 18 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 63 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 22 + + + 15 + + + + + 92 + + + 7 + + + + + 14 + + + 19 + + + 82 + + + 15 + + + 6 + + + 7 + + + + + + + 22 + + + 16 + + + 20 + + + + + 52 + + + 14 + + + + + + + 15 + + + 70 + + + 7 + + + + + 8 + + + 7 + + + + + 14 + + + 7 + + + + + + + 10 + + + 23 + + + 7 + + + + + 21 + + + 18 + + + + + 20 + + + 7 + + + + + + + 7 + + + + + 13 + + + 7 + + + + + 32 + + + 145 + + + 7 + + + + + + + 10 + + + 7 + + + + + 15 + + + 10 + + + 7 + + + + + + + 8 + + + 51 + + + 7 + + + + + + + 7 + + + + + 20 + + + 7 + + + + + 20 + + + 7 + + + + + + + 7 + + + + + 24 + + + 7 + + + + + + + 15 + + + 7 + + + + + 7 + + + + + 15 + + + 7 + + + + + + + 60 + + + 448 + + + 7 + + + + + + + 10 + + + + + 16 + + + 16 + + + 7 + + + + + + + 15 + + + 9 + + + + + 79 + + + 16 + + + 7 + + + + + + + 104 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 2 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 99 + + + 51 + + + 51 + + + 22 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 215 + + + 69 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 125 + + + 15 + + + 6 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 93 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 171 + + + 7 + + + + + + + 7 + + + + + 0 + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + + + 7 + + + + + 10 + + + 74 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 12 + + + 7 + + + + + + + 39 + + + 8 + + + + + 2 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 2 + + + + + 16 + + + 7 + + + + + + + 9 + + + + + 25 + + + + + 103 + + + 7 + + + + + + + 27 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 34 + + + 7 + + + + + + + 34 + + + 7 + + + + + + + 76 + + + 7 + + + + + + + 26 + + + 2 + + + 7 + + + + + + + 15 + + + 10 + + + 15 + + + 7 + + + + + + + 14 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 82 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 83 + + + 7 + + + + + + + 57 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 297 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + + + 14 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 186 + + + 16 + + + 7 + + + + + + + 18 + + + 7 + + + + + 38 + + + 13 + + + 7 + + + + + + + 2 + + + 8 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 29 + + + 7 + + + + + + + 15 + + + 0 + + + 7 + + + + + 2 + + + 0 + + + 7 + + + + + 7 + + + + + 15 + + + 2 + + + 7 + + + + + 10 + + + 8 + + + 65 + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 7 + + + + + 27 + + + 2 + + + 7 + + + + + + + 15 + + + 0 + + + 7 + + + + + 15 + + + 7 + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 21 + + + 7 + + + + + 2 + + + 7 + + + + + + + 25 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 16 + + + + + 7 + + + + + 7 + + + 7 + + + + + + + 7 + + + + + 25 + + + 15 + + + + + 2 + + + 7 + + + + + 21 + + + 7 + + + + + + + 14 + + + 56 + + + 52 + + + 7 + + + + + 21 + + + 7 + + + + + + + 0 + + + 7 + + + + + 18 + + + 7 + + + + + 2 + + + 7 + + + + + + + 22 + + + 12 + + + 154 + + + 7 + + + + + 14 + + + 14 + + + 142 + + + 15 + + + 6 + + + 7 + + + + + + + 33 + + + 7 + + + + + + + 8 + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + 11 + + + + + + + 76 + + + 22 + + + + + 19 + + + 10 + + + 10 + + + + + 15 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 167 + + + 7 + + + + + + + 20 + + + 7 + + + + + 29 + + + 2 + + + + + 14 + + + 19 + + + 87 + + + 15 + + + 6 + + + 7 + + + + + + + 18 + + + + + 7 + + + + + 15 + + + 7 + + + + + + + 15 + + + 7 + + + + + + + 7 + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 35 + + + 2 + + + 2 + + + 7 + + + + + 19 + + + 7 + + + + + + + 8 + + + 2 + + + 7 + + + + + 7 + + + + + + + 44 + + + 21 + + + 9 + + + + + 73 + + + 20 + + + 72 + + + 79 + + + 37 + + + 71 + + + 247 + + + 7 + + + + + + + 63 + + + 60 + + + 7 + + + + + + + 15 + + + 15 + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + 57 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 28 + + + 2 + + + 2 + + + 19 + + + + + 13 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 9 + + + + + 15 + + + 9 + + + + + 15 + + + 9 + + + + + 448 + + + 7 + + + + + + + 20 + + + 7 + + + + + 19 + + + + + 19 + + + + + 19 + + + + + + + 38 + + + 7 + + + + + 16 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 14 + + + 7 + + + + + + + 12 + + + 20 + + + 7 + + + + + 21 + + + 7 + + + + + + + 70 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 7 + + + + + 22 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 22 + + + 7 + + + 11 + + + + + + + 16 + + + + + 40 + + + 2 + + + + + + + 7 + + + + + 95 + + + 628 + + + + + 450 + + + 595 + + + 137 + + + + + 54 + + + 53 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 39 + + + 7 + + + + + + + 15 + + + + + 2 + + + 7 + + + + + 89 + + + 7 + + + + + + + 37 + + + 2 + + + 7 + + + + + + + 13 + + + 7 + + + + + 2 + + + 7 + + + + + 21 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 7 + + + + + 7 + + + 1 + + + + + 74 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 15 + + + 7 + + + + + 2 + + + + + + + 23 + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 22 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 18 + + + 101 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + + + 25 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + + + 14 + + + 8 + + + 7 + + + 46 + + + + + + + 7 + + + + + 7 + + + + + 53 + + + 7 + + + + + + + 68 + + + 7 + + + + + + + 24 + + + 7 + + + + + + + 7 + + + 15 + + + 7 + + + + + 63 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 14 + + + 8 + + + + + 0 + + + 7 + + + + + 20 + + + 7 + + + + + 21 + + + 7 + + + + + + + 14 + + + 8 + + + + + 0 + + + 7 + + + + + 32 + + + 7 + + + + + 21 + + + 7 + + + + + + + 68 + + + 82 + + + + + + + 8 + + + + + 8 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 28 + + + 7 + + + + + + + 34 + + + 34 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 12 + + + 16 + + + 30 + + + 142 + + + 7 + + + + + 22 + + + 7 + + + + + 22 + + + 7 + + + + + + + 2 + + + 7 + + + + + 16 + + + 7 + + + + + + + 2 + + + 21 + + + + + + + 53 + + + 7 + + + + + + + 15 + + + + + 29 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 14 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 19 + + + 7 + + + + + + + 20 + + + 7 + + + + + 7 + + + + + 0 + + + 7 + + + + + 8 + + + 24 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 14 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 14 + + + 7 + + + + + + + 15 + + + 15 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 14 + + + 76 + + + 15 + + + 6 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 50 + + + 26 + + + 13 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 8 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 9 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 9 + + + 2 + + + 8 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 40 + + + 40 + + + 37 + + + 2 + + + 2 + + + 19 + + + + + 40 + + + 7 + + + + + 58 + + + 7 + + + + + + + 38 + + + 7 + + + + + 14 + + + 7 + + + + + + + 7 + + + + + 59 + + + 7 + + + + + + + 51 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + + + 22 + + + 7 + + + + + + + 35 + + + 14 + + + 7 + + + + + 7 + + + + + + + 104 + + + 7 + + + + + + + 25 + + + 25 + + + 18 + + + + + 7 + + + + + 7 + + + + + 65 + + + 7 + + + + + + + 15 + + + 13 + + + 7 + + + + + 19 + + + 7 + + + + + + + 23 + + + 7 + + + + + 78 + + + 7 + + + + + + + 14 + + + + + + + 128 + + + 2 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 57 + + + 67 + + + 60 + + + 38 + + + 82 + + + 72 + + + 123 + + + 7 + + + + + + + 15 + + + 9 + + + 8 + + + 15 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 13 + + + 7 + + + + + + + 14 + + + 26 + + + 7 + + + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + + + + + 12 + + + 2 + + + 2 + + + 7 + + + + + 10 + + + 7 + + + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 7 + + + 15 + + + 15 + + + 0 + + + 7 + + + + + + + 15 + + + 10 + + + 52 + + + 13 + + + 7 + + + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 16 + + + 7 + + + + + + + 2 + + + 8 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 7 + + + 7 + + + + + 2 + + + 10 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + 7 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + + + 121 + + + 10 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 44 + + + 7 + + + + + + + 8 + + + 12 + + + + + 125 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 12 + + + 7 + + + + + + + 2 + + + 7 + + + 7 + + + 24 + + + 7 + + + + + + + 10 + + + 14 + + + 7 + + + + + 16 + + + 10 + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + + + 7 + + + 7 + + + + + 15 + + + 15 + + + + + 122 + + + 7 + + + + + + + 7 + + + + + 8 + + + + + 8 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 8 + + + + + 7 + + + + + 7 + + + + + 41 + + + 7 + + + + + + + 10 + + + 10 + + + 16 + + + 25 + + + 7 + + + + + + + 2 + + + 172 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 2 + + + 91 + + + 7 + + + + + + + 2 + + + 40 + + + 7 + + + + + + + 380 + + + 7 + + + + + 15 + + + 9 + + + 7 + + + + + + + 69 + + + 7 + + + + + + + 16 + + + 9 + + + + + 2 + + + 21 + + + 7 + + + + + + + 7 + + + + + 2 + + + 20 + + + 9 + + + 2 + + + 7 + + + + + + + 8 + + + 8 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 87 + + + 7 + + + + + + + 23 + + + 7 + + + + + 7 + + + + + 23 + + + 7 + + + + + 36 + + + 7 + + + + + + + 30 + + + 7 + + + + + 15 + + + 15 + + + + + + + 10 + + + 2 + + + 7 + + + + + 29 + + + 29 + + + 7 + + + + + 38 + + + 7 + + + + + + + 10 + + + 10 + + + 46 + + + 7 + + + + + + + 43 + + + + + 2 + + + 7 + + + + + + + 92 + + + 26 + + + + + + + 15 + + + 15 + + + 76 + + + 7 + + + + + + + 10 + + + 10 + + + + + 29 + + + 23 + + + 7 + + + + + + + 7 + + + 13 + + + + + 213 + + + 7 + + + + + + + 71 + + + 23 + + + 23 + + + 7 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 115 + + + 53 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 189 + + + 69 + + + 6 + + + 7 + + + + + 9 + + + + + + + 69 + + + 7 + + + + + + + 7 + + + 10 + + + 7 + + + 7 + + + 7 + + + 9 + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 9 + + + + + 279 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 21 + + + 21 + + + 7 + + + 7 + + + + + + + 8 + + + 8 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 84 + + + 7 + + + + + + + 22 + + + 9 + + + + + 227 + + + 7 + + + + + + + 190 + + + 7 + + + + + + + 7 + + + + + 20 + + + 23 + + + 7 + + + + + + + 261 + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 44 + + + 2 + + + 228 + + + 7 + + + + + + + 14 + + + 8 + + + 20 + + + + + 71 + + + 7 + + + + + + + 7 + + + + + 31 + + + 35 + + + 7 + + + + + + + 2 + + + 44 + + + 2 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 7 + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 10 + + + 25 + + + 7 + + + + + + + 55 + + + 9 + + + + + 54 + + + 9 + + + + + 20 + + + 15 + + + 15 + + + 20 + + + 168 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 43 + + + 2 + + + 15 + + + + + 16 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 32 + + + 7 + + + + + + + 23 + + + 7 + + + + + 25 + + + 94 + + + 7 + + + + + + + 168 + + + 7 + + + + + + + 19 + + + 7 + + + + + + + 2 + + + + + 16 + + + 7 + + + + + + + 2 + + + + + 42 + + + 42 + + + 7 + + + + + 9 + + + 9 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 9 + + + 47 + + + + + 2 + + + 7 + + + + + + + 25 + + + 28 + + + 9 + + + + + 117 + + + 7 + + + + + + + 110 + + + 7 + + + + + + + 7 + + + + + 21 + + + 32 + + + 22 + + + 40 + + + 46 + + + 48 + + + 9 + + + 39 + + + 44 + + + 22 + + + 8 + + + 2 + + + 7 + + + + + 29 + + + 8 + + + + + 7 + + + + + 55 + + + 10 + + + 10 + + + + + + + 10 + + + 7 + + + + + + + 10 + + + + + 8 + + + + + 18 + + + + + 132 + + + 14 + + + 14 + + + 18 + + + 7 + + + + + + + 261 + + + 7 + + + + + + + 10 + + + + + 103 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 50 + + + 23 + + + 7 + + + + + + + 7 + + + + + 25 + + + 7 + + + + + 39 + + + 7 + + + + + + + 7 + + + + + 20 + + + 7 + + + + + 141 + + + 7 + + + + + + + 7 + + + + + 10 + + + 7 + + + + + 189 + + + 7 + + + + + + + 64 + + + 50 + + + 7 + + + + + + + 7 + + + + + 10 + + + 10 + + + 51 + + + 7 + + + + + + + 58 + + + 190 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 31 + + + 15 + + + 59 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 17 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + 2 + + + 37 + + + 7 + + + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 17 + + + 7 + + + + + + + 28 + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 20 + + + 3 + + + 2 + + + 2 + + + 12 + + + 7 + + + + + + + 15 + + + 16 + + + 9 + + + + + 15 + + + 15 + + + + + 203 + + + 7 + + + + + + + 15 + + + 16 + + + 9 + + + + + 15 + + + + + 44 + + + 7 + + + + + + + 7 + + + + + 50 + + + 50 + + + 7 + + + + + + + 14 + + + 7 + + + + + + + 2 + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + + + 38 + + + 7 + + + + + + + 8 + + + 7 + + + + + 88 + + + 7 + + + + + + + 293 + + + 7 + + + + + + + 11 + + + 7 + + + + + + + 25 + + + 27 + + + 7 + + + + + + + 16 + + + + + 22 + + + + + 36 + + + + + + + 14 + + + 8 + + + 7 + + + + + 2 + + + 15 + + + + + + + 7 + + + + + 15 + + + 8 + + + 7 + + + + + + + 0 + + + 7 + + + + + 15 + + + 25 + + + 7 + + + + + 2 + + + 7 + + + + + + + 27 + + + 15 + + + 7 + + + + + + + 147 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 43 + + + 7 + + + + + 24 + + + + + + + 42 + + + 7 + + + + + + + 10 + + + 2 + + + 10 + + + 7 + + + + + 18 + + + + + 25 + + + 7 + + + + + 12 + + + 7 + + + + + + + 82 + + + 7 + + + + + + + 82 + + + 7 + + + + + + + 26 + + + 7 + + + + + + + 64 + + + 7 + + + + + 12 + + + 19 + + + + + + + 20 + + + 81 + + + 28 + + + 39 + + + 7 + + + + + + + 10 + + + 31 + + + 27 + + + 7 + + + + + + + 15 + + + 7 + + + + + 16 + + + 7 + + + + + + + 7 + + + + + 30 + + + + + 49 + + + 7 + + + + + + + 2 + + + 10 + + + 7 + + + + + 7 + + + + + + + 10 + + + 7 + + + + + 7 + + + + + 21 + + + 7 + + + + + + + 7 + + + + + 49 + + + 7 + + + + + 22 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 16 + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 15 + + + 7 + + + + + 20 + + + 7 + + + + + + + 97 + + + 7 + + + + + 43 + + + 7 + + + + + + + 9 + + + + + 18 + + + 7 + + + + + + + 41 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 16 + + + 7 + + + + + + + 18 + + + 58 + + + 7 + + + + + + + 89 + + + + + 14 + + + 7 + + + + + 7 + + + + + + + 15 + + + 15 + + + 10 + + + 56 + + + 7 + + + + + + + 8 + + + + + 21 + + + 7 + + + + + + + 14 + + + 7 + + + + + + + 17 + + + 19 + + + 7 + + + + + + + 2 + + + 10 + + + 12 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 16 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 7 + + + 7 + + + + + 10 + + + 7 + + + + + 8 + + + 16 + + + + + 8 + + + 7 + + + + + + + 18 + + + 23 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + 14 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 22 + + + 7 + + + + + + + 59 + + + 31 + + + 7 + + + + + + + 2 + + + 19 + + + + + 9 + + + 7 + + + + + + + 2 + + + 2 + + + 20 + + + 2 + + + 7 + + + + + 26 + + + 7 + + + + + + + 109 + + + 97 + + + 7 + + + + + 25 + + + 20 + + + 21 + + + 15 + + + 14 + + + 13 + + + 18 + + + + + + + 2 + + + 10 + + + 2 + + + 101 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 10 + + + 2 + + + 2 + + + 10 + + + 10 + + + 2 + + + 2 + + + 10 + + + 2 + + + 10 + + + 10 + + + 7 + + + + + 44 + + + 2 + + + 7 + + + 21 + + + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 16 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 2 + + + 7 + + + + + 14 + + + 7 + + + + + + + 25 + + + 25 + + + 2 + + + 18 + + + + + + + 10 + + + 10 + + + 7 + + + + + 21 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 25 + + + 7 + + + + + 7 + + + + + 81 + + + 7 + + + + + + + 7 + + + + + 19 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 13 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 15 + + + 7 + + + + + 10 + + + 7 + + + + + 22 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 15 + + + 7 + + + + + + + 24 + + + 16 + + + + + + + 21 + + + 22 + + + 118 + + + 7 + + + + + + + 101 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 7 + + + + + 16 + + + 7 + + + + + + + 7 + + + 31 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 53 + + + 7 + + + + + + + 8 + + + + + 7 + + + + + 7 + + + + + 41 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 11 + + + 11 + + + 10 + + + 24 + + + 16 + + + 91 + + + 7 + + + + + + + 10 + + + 7 + + + + + + + 39 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + + + 9 + + + 9 + + + + + 8 + + + + + + + 7 + + + + + 18 + + + 18 + + + 18 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 99 + + + 7 + + + + + + + 6 + + + 7 + + + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + 7 + + + + + 185 + + + 36 + + + 7 + + + + + + + 128 + + + 7 + + + + + 2 + + + 12 + + + 7 + + + + + + + 10 + + + 7 + + + + + 15 + + + 7 + + + + + 2 + + + 15 + + + 13 + + + 7 + + + + + + + 16 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + 24 + + + 7 + + + + + 7 + + + + + 7 + + + + + 134 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 26 + + + 2 + + + 7 + + + + + 42 + + + 42 + + + 7 + + + + + 7 + + + 7 + + + + + + + 7 + + + + + 2 + + + 13 + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 17 + + + 22 + + + 10 + + + 10 + + + 17 + + + 17 + + + 17 + + + 23 + + + 23 + + + 19 + + + 19 + + + 19 + + + 19 + + + 19 + + + + + 10 + + + 7 + + + + + + + 24 + + + 27 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 17 + + + 12 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 9 + + + 7 + + + + + 17 + + + 7 + + + + + + + 31 + + + 15 + + + 20 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 15 + + + 7 + + + + + 16 + + + 28 + + + 7 + + + + + + + 7 + + + + + 15 + + + 7 + + + + + 16 + + + 7 + + + + + 28 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 10 + + + 2 + + + 38 + + + 7 + + + + + 20 + + + 7 + + + + + + + 7 + + + 7 + + + 7 + + + 8 + + + 7 + + + + + + + 7 + + + + + 15 + + + 7 + + + + + 15 + + + + + 23 + + + 7 + + + + + + + 2 + + + 21 + + + 7 + + + + + + + 7 + + + + + 10 + + + 10 + + + 52 + + + 7 + + + + + + + 7 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 108 + + + 7 + + + + + 14 + + + 16 + + + + + + + 7 + + + 23 + + + 2 + + + + + 23 + + + + + 7 + + + 7 + + + 10 + + + 7 + + + 14 + + + + + 210 + + + 7 + + + + + + + 14 + + + 8 + + + + + 12 + + + 47 + + + 15 + + + + + 98 + + + 7 + + + + + + + 964 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 22 + + + 7 + + + + + + + 0 + + + 7 + + + + + 10 + + + 7 + + + + + 35 + + + 7 + + + + + + + 7 + + + + + 15 + + + 13 + + + 15 + + + + + 8 + + + 20 + + + + + 39 + + + 7 + + + + + + + 0 + + + 18 + + + 7 + + + + + 18 + + + 15 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + 64 + + + 7 + + + + + + + 10 + + + 128 + + + + + + + 10 + + + 7 + + + + + 7 + + + + + 17 + + + 30 + + + 7 + + + + + + + 36 + + + 12 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 22 + + + 7 + + + + + + + 20 + + + + + 9 + + + + + 10 + + + 7 + + + 7 + + + 7 + + + + + + + 48 + + + + + 29 + + + + + 10 + + + 8 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 44 + + + 7 + + + + + + + 22 + + + 7 + + + + + + + 159 + + + 7 + + + + + 10 + + + 2 + + + 2 + + + 7 + + + + + 7 + + + + + + + 32 + + + 63 + + + + + + + 7 + + + + + 10 + + + 7 + + + + + 22 + + + 7 + + + + + + + 10 + + + 22 + + + 17 + + + 62 + + + 7 + + + + + + + 0 + + + 7 + + + + + 16 + + + 2 + + + 13 + + + 7 + + + + + + + 2 + + + + + 17 + + + 7 + + + + + + + 2 + + + + + 2 + + + + + + + 2 + + + 17 + + + 7 + + + + + + + 7 + + + + + 11 + + + 7 + + + + + 15 + + + 7 + + + + + 7 + + + + + 13 + + + 7 + + + + + 14 + + + 7 + + + + + 40 + + + + + + + 2 + + + 20 + + + 7 + + + + + 16 + + + 7 + + + + + + + 0 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 122 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + 2 + + + 15 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 7 + + + + + 15 + + + 15 + + + 7 + + + + + 26 + + + 7 + + + + + + + 12 + + + 7 + + + + + 61 + + + 7 + + + + + 31 + + + 7 + + + + + + + 111 + + + 7 + + + + + + + 71 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 15 + + + 122 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 11 + + + 18 + + + + + 82 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 11 + + + 18 + + + + + 139 + + + 7 + + + + + 7 + + + 7 + + + 7 + + + 7 + + + 123 + + + 132 + + + 258 + + + 36 + + + + + + + 10 + + + 357 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 15 + + + 40 + + + 6 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + + + 30 + + + 15 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + + + 82 + + + 7 + + + + + 15 + + + 40 + + + 6 + + + 7 + + + + + + + 16 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 48 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + + + 11 + + + 7 + + + + + 19 + + + 41 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + + + 26 + + + 15 + + + + + 26 + + + 15 + + + + + 57 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 36 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + + + 51 + + + 182 + + + 21 + + + 15 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 211 + + + 83 + + + 6 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 27 + + + 7 + + + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 120 + + + 16 + + + + + 14 + + + 8 + + + 7 + + + + + + + 13 + + + 7 + + + 13 + + + 7 + + + 142 + + + 7 + + + + + 13 + + + 7 + + + 13 + + + 7 + + + 12 + + + 7 + + + + + + + 14 + + + 8 + + + 301 + + + 7 + + + + + + + 14 + + + 8 + + + 0 + + + 0 + + + 12 + + + 7 + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 7 + + + + + + + 14 + + + 8 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 7 + + + + + 8 + + + 7 + + + + + + + 14 + + + 8 + + + 9 + + + + + 2 + + + 7 + + + + + + + 91 + + + 562 + + + 7 + + + + + 15 + + + 32 + + + 26 + + + + + + + 86 + + + 7 + + + + + + + 42 + + + 29 + + + 7 + + + + + + + 16 + + + 16 + + + 9 + + + + + 14 + + + 8 + + + 7 + + + 16 + + + 24 + + + 27 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 29 + + + 25 + + + 28 + + + 25 + + + 25 + + + 28 + + + 28 + + + 19 + + + 21 + + + 21 + + + 22 + + + 21 + + + 26 + + + 9 + + + + + 15 + + + 15 + + + + + 16 + + + 9 + + + + + 42 + + + 42 + + + 41 + + + 9 + + + 15 + + + 14 + + + 2 + + + 7 + + + 16 + + + + + 15 + + + 111 + + + 28 + + + 15 + + + + + 10 + + + 2 + + + 15 + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 57 + + + 10 + + + 91 + + + 228 + + + 100 + + + 118 + + + 130 + + + 191 + + + 134 + + + 159 + + + 143 + + + 247 + + + 143 + + + 102 + + + 120 + + + 132 + + + 129 + + + 174 + + + 175 + + + 175 + + + 141 + + + 162 + + + 162 + + + 93 + + + 382 + + + 238 + + + 198 + + + 97 + + + 166 + + + 109 + + + 146 + + + 116 + + + 200 + + + 244 + + + 109 + + + 123 + + + 127 + + + 100 + + + 92 + + + 127 + + + 108 + + + 196 + + + 110 + + + 100 + + + 71 + + + 125 + + + 228 + + + 89 + + + 121 + + + 172 + + + 171 + + + 302 + + + 180 + + + 184 + + + 108 + + + 60 + + + 63 + + + 55 + + + 45 + + + 60 + + + 68 + + + 63 + + + 73 + + + 73 + + + 73 + + + 60 + + + 60 + + + 73 + + + 63 + + + 83 + + + 84 + + + 94 + + + 103 + + + 110 + + + 239 + + + 123 + + + 119 + + + 98 + + + 164 + + + 102 + + + 142 + + + 87 + + + 89 + + + 133 + + + 82 + + + 83 + + + 86 + + + 96 + + + 105 + + + 100 + + + 185 + + + 130 + + + 192 + + + 135 + + + 197 + + + 186 + + + 119 + + + 169 + + + 126 + + + 209 + + + 175 + + + 120 + + + 168 + + + 117 + + + 147 + + + 170 + + + 133 + + + 128 + + + 125 + + + 102 + + + 160 + + + 114 + + + 313 + + + 213 + + + 116 + + + 184 + + + 130 + + + 192 + + + 198 + + + 162 + + + 198 + + + 164 + + + 100 + + + 155 + + + 126 + + + 209 + + + 209 + + + 103 + + + 147 + + + 170 + + + 100 + + + 170 + + + 131 + + + 209 + + + 209 + + + 103 + + + 147 + + + 170 + + + 91 + + + 139 + + + 90 + + + 156 + + + 163 + + + 169 + + + 262 + + + 111 + + + 156 + + + 100 + + + 155 + + + 126 + + + 209 + + + 209 + + + 103 + + + 147 + + + 170 + + + 100 + + + 170 + + + 126 + + + 209 + + + 209 + + + 103 + + + 147 + + + 170 + + + 405 + + + 293 + + + 133 + + + 64 + + + 114 + + + 92 + + + 40 + + + 105 + + + 110 + + + 64 + + + 92 + + + 303 + + + 251 + + + 125 + + + 67 + + + 119 + + + 101 + + + 185 + + + 130 + + + 192 + + + 134 + + + 201 + + + 111 + + + 132 + + + 185 + + + 134 + + + 195 + + + 138 + + + 203 + + + 111 + + + 199 + + + 123 + + + 195 + + + 136 + + + 124 + + + 127 + + + 73 + + + 93 + + + 131 + + + 98 + + + 142 + + + 122 + + + 133 + + + 98 + + + 88 + + + 92 + + + 140 + + + 100 + + + 89 + + + 93 + + + 65 + + + 137 + + + 121 + + + 159 + + + 104 + + + 124 + + + 124 + + + 86 + + + 83 + + + 94 + + + 62 + + + 99 + + + 253 + + + 376 + + + 183 + + + 54 + + + 71 + + + 114 + + + 72 + + + 106 + + + 74 + + + 105 + + + 115 + + + 135 + + + 131 + + + 150 + + + 149 + + + 119 + + + 167 + + + 126 + + + 209 + + + 175 + + + 120 + + + 168 + + + 117 + + + 147 + + + 170 + + + 133 + + + 142 + + + 130 + + + 162 + + + 383 + + + 187 + + + 177 + + + 198 + + + 98 + + + 168 + + + 74 + + + 76 + + + 74 + + + 101 + + + 86 + + + 100 + + + 153 + + + 160 + + + 169 + + + 259 + + + 153 + + + 146 + + + 101 + + + 119 + + + 131 + + + 192 + + + 135 + + + 161 + + + 114 + + + 147 + + + 143 + + + 162 + + + 158 + + + 128 + + + 188 + + + 133 + + + 124 + + + 81 + + + 145 + + + 86 + + + 114 + + + 104 + + + 104 + + + 86 + + + 81 + + + 75 + + + 112 + + + 68 + + + 48 + + + 98 + + + 142 + + + 141 + + + 10 + + + 48 + + + 11 + + + 10 + + + 9 + + + 80 + + + 187 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 25 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 199 + + + + + + + 2 + + + 122 + + + 173 + + + 7 + + + + + 7 + + + + + + + 164 + + + + + 14 + + + 7 + + + + + + + 7 + + + 7 + + + 7 + + + 7 + + + + + 394 + + + 7 + + + + + 7 + + + + + + + 57 + + + 48 + + + 358 + + + 7 + + + + + + + 53 + + + 10 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + 11 + + + 2 + + + 339 + + + 583 + + + 7 + + + + + + + 11 + + + 231 + + + 22 + + + 7 + + + + + 7 + + + + + + + 296 + + + 26 + + + 7 + + + + + 7 + + + + + + + 200 + + + 10 + + + 7 + + + + + 50 + + + 7 + + + + + 7 + + + + + + + 13 + + + 7 + + + + + 125 + + + 2 + + + 7 + + + + + 7 + + + + + + + 10 + + + 2 + + + 68 + + + + + 15 + + + 7 + + + + + + + 66 + + + 37 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 148 + + + 15 + + + 6 + + + 7 + + + + + 7 + + + + + + + 14 + + + 8 + + + 7 + + + + + 67 + + + 51 + + + 21 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 336 + + + 69 + + + 6 + + + 7 + + + + + 7 + + + + + + + 10 + + + 191 + + + + + + + 152 + + + 7 + + + + + 7 + + + + + + + 20 + + + 7 + + + 2 + + + + + + + 7 + + + + + 7 + + + + + 156 + + + 7 + + + + + + + 33 + + + 84 + + + 7 + + + + + + + 226 + + + + + 14 + + + 7 + + + + + 7 + + + + + + + 21 + + + 7 + + + + + 59 + + + + + 7 + + + + + + + 8 + + + + + 16 + + + 45 + + + + + + + 2 + + + + + 59 + + + 84 + + + 2 + + + 9 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 2 + + + 7 + + + + + 9 + + + 222 + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 40 + + + 7 + + + + + 7 + + + 7 + + + + + 15 + + + 7 + + + + + + + 14 + + + 8 + + + 27 + + + 9 + + + 14 + + + 8 + + + 1210 + + + 19 + + + + + + + 16 + + + + + 185 + + + 7 + + + + + + + 13 + + + 7 + + + + + 13 + + + 7 + + + + + + + 10 + + + 11 + + + + + 10 + + + 11 + + + + + 10 + + + + + 11 + + + 10 + + + + + 10 + + + 84 + + + + + + + 14 + + + + + 13 + + + 7 + + + + + + + 14 + + + + + 14 + + + + + 24 + + + 7 + + + + + + + 18 + + + 14 + + + + + 31 + + + 7 + + + + + + + 2 + + + 2 + + + + + 2 + + + 16 + + + 7 + + + + + + + 22 + + + 7 + + + + + + + 2 + + + + + 12 + + + 7 + + + + + + + 16 + + + + + 21 + + + + + 2 + + + 7 + + + + + + + 33 + + + 7 + + + + + 10 + + + + + + + 64 + + + 7 + + + + + 14 + + + 7 + + + + + 68 + + + + + + + 10 + + + 24 + + + + + + + 8 + + + 8 + + + 2 + + + 2 + + + + + + + 23 + + + 10 + + + 2 + + + + + + + 10 + + + 10 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 14 + + + 14 + + + 45 + + + 7 + + + + + + + 46 + + + + + + + 10 + + + 7 + + + + + 15 + + + + + 19 + + + 7 + + + + + + + 20 + + + 11 + + + + + 173 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 14 + + + 2 + + + 7 + + + + + 2 + + + + + + + 8 + + + 2 + + + 7 + + + + + 2 + + + + + + + 16 + + + 7 + + + + + + + 2 + + + 2 + + + + + + + 2 + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 10 + + + + + 36 + + + 7 + + + + + + + 14 + + + + + 18 + + + 15 + + + 7 + + + + + + + 7 + + + + + 10 + + + 10 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 58 + + + 10 + + + 10 + + + + + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 15 + + + 2 + + + 7 + + + + + + + 2 + + + + + 2 + + + + + 9 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 21 + + + 7 + + + + + 10 + + + 2 + + + + + + + 7 + + + + + 2 + + + + + 10 + + + 10 + + + 14 + + + 2 + + + 7 + + + + + + + 2 + + + 8 + + + + + + + 2 + + + 2 + + + + + + + 14 + + + 7 + + + + + 7 + + + + + 10 + + + 11 + + + + + 44 + + + 7 + + + + + + + 12 + + + + + 2 + + + 7 + + + + + 2 + + + 21 + + + 46 + + + 7 + + + + + + + 9 + + + 38 + + + + + 14 + + + + + 21 + + + 7 + + + + + + + 10 + + + + + 10 + + + + + 40 + + + 7 + + + + + + + 2 + + + + + 19 + + + 7 + + + + + + + 2 + + + 25 + + + 15 + + + + + 13 + + + 7 + + + + + + + 2 + + + 2 + + + + + 8 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + + + 18 + + + 2 + + + 7 + + + + + + + 23 + + + + + 368 + + + 14 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 102 + + + 94 + + + 2 + + + 7 + + + + + + + 15 + + + 7 + + + + + + + 42 + + + 17 + + + + + + + 23 + + + 52 + + + 88 + + + + + + + 14 + + + 2 + + + 7 + + + + + + + 198 + + + 7 + + + + + + + 151 + + + 7 + + + + + + + 13 + + + 7 + + + + + 10 + + + 2 + + + + + + + 21 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 2 + + + 12 + + + 7 + + + + + 14 + + + 7 + + + + + + + 21 + + + 7 + + + + + + + 313 + + + 7 + + + + + + + 14 + + + 7 + + + + + 63 + + + 7 + + + + + + + 2 + + + 45 + + + 2 + + + + + 22 + + + 7 + + + + + + + 15 + + + 9 + + + 18 + + + + + 85 + + + 7 + + + + + + + 1280 + + + 7 + + + + + 7 + + + + + 29 + + + + + 51 + + + + + 54 + + + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 2 + + + 23 + + + 53 + + + 7 + + + + + + + 43 + + + 7 + + + 34 + + + + + + + 271 + + + 7 + + + + + + + 57 + + + 39 + + + 7 + + + + + + + 14 + + + 8 + + + 21 + + + 7 + + + + + 50 + + + 7 + + + + + + + 7 + + + + + 14 + + + 8 + + + 7 + + + + + 7 + + + + + 71 + + + 71 + + + + + 21 + + + 7 + + + + + + + 66 + + + 7 + + + + + + + 14 + + + 8 + + + 7 + + + + + 51 + + + 104 + + + 7 + + + + + + + 14 + + + + + 43 + + + 7 + + + + + + + 2 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 17 + + + 7 + + + + + + + 2 + + + 7 + + + + + 21 + + + 22 + + + 8 + + + + + 14 + + + 19 + + + 143 + + + 15 + + + 6 + + + 7 + + + + + + + 15 + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 30 + + + 44 + + + 15 + + + 18 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 204 + + + 69 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 232 + + + 64 + + + 6 + + + 7 + + + + + + + 0 + + + 30 + + + 9 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 38 + + + 1 + + + 6 + + + 7 + + + + + + + 32 + + + 51 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 197 + + + 69 + + + 6 + + + 7 + + + + + + + 21 + + + + + 16 + + + 51 + + + + + 128 + + + 37 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 192 + + + 15 + + + 6 + + + 7 + + + + + + + 16 + + + 36 + + + 7 + + + + + 30 + + + 35 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 197 + + + 64 + + + 6 + + + 7 + + + + + + + 137 + + + 23 + + + 29 + + + 14 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 91 + + + 15 + + + 6 + + + 7 + + + + + + + 37 + + + 89 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 137 + + + 15 + + + 6 + + + 7 + + + + + + + 51 + + + 185 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 110 + + + 15 + + + 6 + + + 7 + + + + + + + 7 + + + + + 14 + + + 8 + + + 7 + + + + + 15 + + + 14 + + + 22 + + + 18 + + + + + 7 + + + + + 157 + + + 7 + + + + + 14 + + + 19 + + + 184 + + + 64 + + + 6 + + + 7 + + + + + + + 2 + + + 37 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 124 + + + 15 + + + 6 + + + 7 + + + + + + + 20 + + + 44 + + + 7 + + + + + 63 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 225 + + + 83 + + + 6 + + + 7 + + + + + + + 10 + + + 12 + + + 7 + + + + + 2 + + + 7 + + + + + 35 + + + 24 + + + + + 12 + + + 30 + + + 145 + + + 14 + + + 8 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 82 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 93 + + + 15 + + + 6 + + + 7 + + + + + + + 37 + + + 7 + + + + + 9 + + + + + 130 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 189 + + + 69 + + + 6 + + + 7 + + + + + + + 30 + + + 7 + + + + + 44 + + + 15 + + + 7 + + + + + 44 + + + 65 + + + 15 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 77 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 195 + + + 69 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 195 + + + 69 + + + 6 + + + 7 + + + + + + + 23 + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 37 + + + 1 + + + 6 + + + 7 + + + + + + + 23 + + + 57 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 78 + + + 15 + + + 6 + + + 7 + + + + + + + 51 + + + 34 + + + 64 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 203 + + + 69 + + + 6 + + + 7 + + + + + 14 + + + 7 + + + + + + + 72 + + + 23 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 77 + + + 15 + + + 6 + + + 7 + + + + + + + 23 + + + 72 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 29 + + + 150 + + + 57 + + + 6 + + + 7 + + + + + 12 + + + 7 + + + + + + + 12 + + + 7 + + + + + 23 + + + 78 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 74 + + + 1 + + + 6 + + + 7 + + + + + + + 23 + + + 23 + + + 180 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 271 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 200 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 23 + + + 71 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 170 + + + 53 + + + 6 + + + 33 + + + 7 + + + + + 12 + + + 7 + + + + + + + 61 + + + 23 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 143 + + + 53 + + + 6 + + + 20 + + + 7 + + + + + + + 75 + + + 23 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 72 + + + 15 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 328 + + + 12 + + + 11 + + + 9 + + + 14 + + + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 17 + + + 20 + + + 36 + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 16 + + + 62 + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 22 + + + 116 + + + 14 + + + 15 + + + 7 + + + + + + + 16 + + + 14 + + + 16 + + + 147 + + + 38 + + + 38 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 19 + + + 7 + + + + + 18 + + + 7 + + + + + + + 27 + + + 27 + + + 18 + + + 18 + + + 18 + + + 18 + + + 18 + + + 18 + + + 18 + + + 18 + + + 18 + + + 18 + + + 2 + + + 44 + + + 31 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 38 + + + 7 + + + + + 77 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 208 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 344 + + + 12 + + + 12 + + + 11 + + + 12 + + + 11 + + + 13 + + + 12 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 10 + + + 10 + + + 114 + + + 13 + + + 14 + + + 13 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 98 + + + 7 + + + + + 15 + + + 15 + + + 15 + + + 7 + + + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + + + 38 + + + 7 + + + + + 2 + + + 7 + + + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 43 + + + 78 + + + 7 + + + + + 10 + + + 7 + + + + + + + 2 + + + 36 + + + 6 + + + 7 + + + + + 13 + + + 20 + + + 43 + + + 77 + + + 14 + + + 9 + + + 7 + + + 7 + + + + + + + 2 + + + 15 + + + 9 + + + 7 + + + + + + + 40 + + + 139 + + + + + 128 + + + 14 + + + 7 + + + + + 22 + + + 7 + + + + + + + 35 + + + 2 + + + 7 + + + + + 8 + + + + + 58 + + + 7 + + + + + + + 76 + + + 12 + + + 9 + + + 7 + + + + + + + 34 + + + 2 + + + 2 + + + + + 21 + + + 7 + + + + + + + 37 + + + 2 + + + 2 + + + 7 + + + + + 28 + + + 7 + + + + + + + 7 + + + 38 + + + + + 10 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 13 + + + 20 + + + 43 + + + 108 + + + 14 + + + 9 + + + 7 + + + 7 + + + + + + + 7 + + + + + 137 + + + 15 + + + 10 + + + 56 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 60 + + + 14 + + + 7 + + + + + + + 22 + + + 90 + + + 20 + + + 7 + + + + + + + 14 + + + + + 10 + + + 21 + + + 43 + + + 7 + + + + + 24 + + + 47 + + + 13 + + + 7 + + + + + + + 12 + + + 15 + + + + + 60 + + + 13 + + + + + + + 36 + + + 2 + + + 2 + + + 7 + + + + + + + 72 + + + 10 + + + 10 + + + 14 + + + 14 + + + 7 + + + + + + + 7 + + + + + 10 + + + 53 + + + 9 + + + 7 + + + + + + + 7 + + + + + 104 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 2181 + + + 16 + + + 17 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 18 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 15 + + + 10 + + + 10 + + + 15 + + + 10 + + + 10 + + + 15 + + + 16 + + + 15 + + + 15 + + + 15 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 18 + + + 15 + + + 18 + + + 23 + + + 20 + + + 10 + + + 10 + + + 16 + + + 10 + + + 15 + + + 16 + + + 10 + + + 15 + + + 16 + + + 10 + + + 15 + + + 10 + + + 10 + + + 10 + + + 10 + + + 17 + + + 10 + + + 7 + + + + + 39 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 15 + + + 15 + + + 15 + + + 15 + + + 55 + + + 10 + + + 7 + + + + + + + 528 + + + 10 + + + 11 + + + 10 + + + 11 + + + 7 + + + + + + + 197 + + + 13 + + + 13 + + + 12 + + + 7 + + + + + + + 589 + + + 12 + + + 10 + + + 12 + + + 10 + + + 7 + + + + + + + 1354 + + + 10 + + + 10 + + + 10 + + + 12 + + + 10 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 19 + + + 15 + + + 15 + + + 19 + + + 15 + + + 15 + + + 10 + + + 7 + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 36 + + + 7 + + + + + + + 423 + + + 18 + + + 15 + + + 18 + + + 23 + + + 26 + + + 15 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 765 + + + 16 + + + 13 + + + 16 + + + 16 + + + 15 + + + 33 + + + 16 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 7 + + + 96 + + + 109 + + + 199 + + + 28 + + + + + 20 + + + 20 + + + 20 + + + 15 + + + 7 + + + + + + + 15 + + + 15 + + + + + 38 + + + + + 171 + + + 10 + + + 25 + + + 7 + + + + + + + 7 + + + + + 981 + + + 15 + + + 15 + + + 31 + + + 15 + + + 15 + + + 16 + + + 30 + + + 41 + + + 15 + + + 15 + + + 31 + + + 15 + + + 15 + + + 16 + + + 20 + + + 15 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 7 + + + + + 7 + + + + + 781 + + + 15 + + + 15 + + + 16 + + + 20 + + + 47 + + + 15 + + + 15 + + + 16 + + + 20 + + + 47 + + + 15 + + + 15 + + + 10 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 303 + + + 13 + + + 13 + + + 12 + + + 13 + + + 12 + + + 7 + + + + + + + 109 + + + 502 + + + 20 + + + 117 + + + 18 + + + 44 + + + 21 + + + 118 + + + 16 + + + 14 + + + 14 + + + 17 + + + 15 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 22 + + + 7 + + + + + 23 + + + 7 + + + + + + + 2 + + + 48 + + + 10 + + + 7 + + + + + 10 + + + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + 7 + + + + + + + 14 + + + 8 + + + 7 + + + + + 10 + + + 10 + + + + + 2 + + + 2 + + + 39 + + + 7 + + + + + 118 + + + 7 + + + + + + + 7 + + + + + 51 + + + + + 79 + + + 14 + + + 13 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 93 + + + 15 + + + 6 + + + 7 + + + + + + + 13 + + + 28 + + + 32 + + + 33 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 74 + + + 16 + + + 22 + + + 7 + + + + + 74 + + + 16 + + + 22 + + + 7 + + + + + + + 169 + + + 10 + + + 7 + + + + + + + 10 + + + 10 + + + 658 + + + 50 + + + 19 + + + 39 + + + 39 + + + 39 + + + 39 + + + 39 + + + 18 + + + 23 + + + 39 + + + 23 + + + 20 + + + 39 + + + 39 + + + 10 + + + 39 + + + 39 + + + 10 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 17 + + + 7 + + + + + 22 + + + 7 + + + + + 17 + + + 7 + + + + + 17 + + + 7 + + + + + 16 + + + 7 + + + + + 16 + + + 7 + + + + + 27 + + + 7 + + + + + 17 + + + 7 + + + + + 17 + + + 7 + + + + + 17 + + + 7 + + + + + 17 + + + 7 + + + + + + + 2 + + + 10 + + + 7 + + + 45 + + + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 51 + + + 43 + + + 89 + + + 15 + + + 22 + + + 11 + + + + + 15 + + + + + 139 + + + 15 + + + 16 + + + 15 + + + 24 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 98 + + + + + 15 + + + 48 + + + 7 + + + + + 49 + + + 7 + + + + + + + 59 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 31 + + + 36 + + + 7 + + + + + + + 14 + + + 8 + + + 14 + + + 8 + + + 14 + + + 8 + + + 7 + + + + + 362 + + + 15 + + + 15 + + + 15 + + + + + + + 7 + + + + + 23 + + + 57 + + + 20 + + + 14 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 44 + + + 8 + + + 162 + + + 15 + + + 16 + + + 75 + + + 26 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 14 + + + 8 + + + + + 7 + + + + + 10 + + + + + 80 + + + 15 + + + 14 + + + 7 + + + + + + + 152 + + + 9 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + 82 + + + 55 + + + 15 + + + 7 + + + + + 24 + + + 7 + + + + + + + 222 + + + 54 + + + 15 + + + 10 + + + 7 + + + + + 7 + + + 7 + + + 69 + + + 86 + + + 142 + + + 21 + + + + + + + 14 + + + 10 + + + 10 + + + 201 + + + 9 + + + + + 14 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + + + 10 + + + 22 + + + 15 + + + 100 + + + 7 + + + + + + + 31 + + + 2 + + + 2 + + + 336 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 378 + + + 7 + + + + + + + 29 + + + 19 + + + 35 + + + 16 + + + 160 + + + 7 + + + + + + + 10 + + + 289 + + + 7 + + + + + + + 2 + + + 7 + + + 2 + + + 25 + + + 2 + + + 10 + + + 5 + + + 147 + + + 7 + + + + + + + 12 + + + 59 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 51 + + + 7 + + + + + + + 2 + + + 16 + + + 7 + + + + + + + 49 + + + 15 + + + 8 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 161 + + + 7 + + + + + + + 9 + + + 7 + + + + + 8 + + + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 274 + + + 7 + + + + + + + 12 + + + 54 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 12 + + + 11 + + + 12 + + + 7 + + + + + 175 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 37 + + + 7 + + + + + + + 2 + + + 81 + + + 7 + + + + + + + 79 + + + 57 + + + 7 + + + + + + + 18 + + + + + 2 + + + 2 + + + 114 + + + 7 + + + + + + + 2 + + + 21 + + + 7 + + + + + + + 72 + + + 2 + + + 14 + + + 14 + + + 7 + + + + + + + 2 + + + 21 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 18 + + + 23 + + + 18 + + + 18 + + + 26 + + + 30 + + + 27 + + + 56 + + + 282 + + + 17 + + + 24 + + + 23 + + + 29 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 88 + + + 15 + + + 6 + + + 7 + + + + + 7 + + + 39 + + + 63 + + + 67 + + + 14 + + + + + 23 + + + 7 + + + + + + + 2 + + + 56 + + + 75 + + + 11 + + + 17 + + + 21 + + + + + + + 2 + + + 46 + + + 27 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 14 + + + 8 + + + 7 + + + + + 2 + + + 7 + + + + + + + 246 + + + 7 + + + + + + + 15 + + + 15 + + + + + 75 + + + 7 + + + + + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 42 + + + + + + + 49 + + + 49 + + + 58 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 64 + + + 2 + + + 7 + + + + + + + 2 + + + 18 + + + 7 + + + + + 2 + + + 9 + + + 7 + + + + + 10 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 38 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 14 + + + 9 + + + 2 + + + 61 + + + 7 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 14 + + + + + 10 + + + 58 + + + 7 + + + + + + + 7 + + + 7 + + + 7 + + + 7 + + + 10 + + + 7 + + + + + + + 25 + + + 7 + + + + + + + 13 + + + 7 + + + 7 + + + + + + + 20 + + + 7 + + + + + 110 + + + 7 + + + + + + + 8 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + + + 17 + + + 26 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 69 + + + 20 + + + 7 + + + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 71 + + + 16 + + + 14 + + + 7 + + + + + + + 14 + + + 8 + + + 43 + + + 15 + + + + + 44 + + + 22 + + + 7 + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 136 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 165 + + + 7 + + + + + + + 2 + + + 18 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 2 + + + 36 + + + 2 + + + 23 + + + 2 + + + 40 + + + 2 + + + 30 + + + 2 + + + 43 + + + 2 + + + 39 + + + 2 + + + 48 + + + 2 + + + 48 + + + 2 + + + 28 + + + 2 + + + 68 + + + 2 + + + 76 + + + 16 + + + 2 + + + 7 + + + + + 11 + + + 7 + + + + + + + 10 + + + 9 + + + 13 + + + 10 + + + 7 + + + + + + + 21 + + + + + 32 + + + + + 114 + + + 7 + + + + + + + 15 + + + + + 15 + + + + + 292 + + + 7 + + + + + + + 0 + + + 7 + + + + + 10 + + + 15 + + + 7 + + + + + 19 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 41 + + + 23 + + + 427 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 28 + + + 101 + + + 97 + + + 7 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 107 + + + 7 + + + + + + + 31 + + + 7 + + + + + + + 20 + + + 27 + + + 7 + + + + + + + 21 + + + 30 + + + 7 + + + + + + + 14 + + + 34 + + + 7 + + + + + + + 22 + + + 31 + + + 7 + + + + + + + 5 + + + 22 + + + 5 + + + 22 + + + 10 + + + 7 + + + + + + + 23 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 16 + + + 7 + + + + + 7 + + + + + 7 + + + + + 51 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 33 + + + 19 + + + + + + + 10 + + + 7 + + + + + + + 10 + + + 15 + + + 10 + + + 7 + + + + + 8 + + + + + 26 + + + 9 + + + + + 45 + + + 7 + + + + + + + 322 + + + 21 + + + 16 + + + 7 + + + + + + + 154 + + + 7 + + + + + + + 22 + + + 104 + + + 7 + + + + + + + 10 + + + 7 + + + 7 + + + + + 14 + + + 7 + + + + + + + 14 + + + 10 + + + 125 + + + 7 + + + + + + + 21 + + + 21 + + + 31 + + + 37 + + + 2 + + + 7 + + + + + + + 25 + + + 32 + + + 62 + + + 29 + + + 50 + + + 116 + + + 55 + + + 32 + + + 32 + + + + + 158 + + + 7 + + + + + + + 2 + + + 46 + + + 7 + + + + + + + 45 + + + 7 + + + + + + + 15 + + + + + 15 + + + + + 194 + + + 7 + + + + + 15 + + + 9 + + + 10 + + + 14 + + + 7 + + + + + + + 156 + + + 7 + + + + + + + 20 + + + 7 + + + + + 36 + + + 7 + + + + + + + 10 + + + 20 + + + + + + + 15 + + + + + 10 + + + 7 + + + + + + + 75 + + + 7 + + + + + + + 22 + + + 25 + + + 103 + + + 7 + + + + + + + 9 + + + 9 + + + 9 + + + 40 + + + 7 + + + + + 19 + + + 9 + + + 9 + + + 40 + + + 7 + + + + + 2 + + + 2 + + + 94 + + + 7 + + + + + + + 2 + + + 7 + + + + + 14 + + + 14 + + + 50 + + + 7 + + + + + + + 9 + + + 9 + + + 17 + + + 7 + + + + + 92 + + + 7 + + + + + + + 16 + + + 123 + + + 7 + + + + + + + 22 + + + 7 + + + + + + + 14 + + + 9 + + + 14 + + + 26 + + + 39 + + + + + + + 10 + + + 10 + + + 11 + + + 7 + + + + + 10 + + + 10 + + + 11 + + + 7 + + + + + 192 + + + 7 + + + + + + + 50 + + + 33 + + + 7 + + + 7 + + + + + + + 61 + + + 36 + + + 37 + + + 32 + + + 7 + + + + + + + 10 + + + 15 + + + + + 42 + + + 42 + + + 7 + + + + + + + 9 + + + 28 + + + 50 + + + + + + + 2 + + + 7 + + + + + + + 16 + + + 7 + + + 25 + + + + + + + 352 + + + 7 + + + + + + + 14 + + + 14 + + + 14 + + + 10 + + + 11 + + + 10 + + + 15 + + + 8 + + + + + 14 + + + 14 + + + 14 + + + 10 + + + 11 + + + 10 + + + 15 + + + 9 + + + + + 132 + + + 7 + + + + + 346 + + + 7 + + + + + + + 10 + + + 10 + + + 11 + + + 7 + + + + + 11 + + + 14 + + + 72 + + + 429 + + + 107 + + + 7 + + + + + 16 + + + 10 + + + 7 + + + + + 12 + + + 7 + + + + + 13 + + + 7 + + + + + 12 + + + 7 + + + + + 13 + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + 14 + + + 7 + + + + + 7 + + + + + 15 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 42 + + + 42 + + + 42 + + + 42 + + + 162 + + + 8 + + + 27 + + + 8 + + + 7 + + + 7 + + + + + 40 + + + 40 + + + 10 + + + 100 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 40 + + + 40 + + + 24 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + + + 73 + + + 7 + + + + + + + 10 + + + 18 + + + + + + + 2 + + + 7 + + + + + 14 + + + 10 + + + 7 + + + + + + + 112 + + + 7 + + + + + + + 2 + + + 9 + + + 94 + + + 7 + + + + + + + 10 + + + 7 + + + 41 + + + 22 + + + 41 + + + 81 + + + 18 + + + 75 + + + 44 + + + 38 + + + 29 + + + 61 + + + 24 + + + 36 + + + 78 + + + 41 + + + 66 + + + 68 + + + 34 + + + 41 + + + 15 + + + 34 + + + 31 + + + 44 + + + 85 + + + 48 + + + 23 + + + 22 + + + 24 + + + 26 + + + 41 + + + 95 + + + 15 + + + 12 + + + 26 + + + 36 + + + 46 + + + 31 + + + 10 + + + 27 + + + 7 + + + + + + + 52 + + + 7 + + + + + 30 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 21 + + + + + 233 + + + 7 + + + + + + + 15 + + + + + 109 + + + 7 + + + + + + + 2 + + + 7 + + + + + 14 + + + 10 + + + 7 + + + + + + + 20 + + + 20 + + + 20 + + + 20 + + + 7 + + + + + 134 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 70 + + + 10 + + + 7 + + + + + + + 15 + + + 10 + + + 19 + + + 19 + + + + + + + 28 + + + + + 9 + + + 14 + + + + + 22 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 22 + + + 33 + + + 22 + + + 10 + + + 10 + + + 9 + + + 29 + + + 51 + + + 27 + + + 83 + + + 10 + + + 7 + + + + + + + 10 + + + 10 + + + 42 + + + 7 + + + + + + + 10 + + + 27 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 20 + + + 47 + + + 8 + + + + + + + 34 + + + 90 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 15 + + + 84 + + + 7 + + + + + + + 41 + + + 62 + + + 7 + + + + + + + 14 + + + + + 29 + + + 7 + + + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 15 + + + 9 + + + 14 + + + + + 15 + + + 2 + + + 7 + + + + + 120 + + + 7 + + + + + + + 53 + + + 20 + + + 20 + + + 20 + + + 7 + + + + + + + 15 + + + 9 + + + 2 + + + 7 + + + + + 15 + + + 9 + + + 56 + + + 21 + + + 14 + + + + + + + 25 + + + 7 + + + + + + + 22 + + + 22 + + + 741 + + + 499 + + + 42 + + + 132 + + + 7 + + + 49 + + + + + + + 15 + + + 15 + + + + + 19 + + + 19 + + + + + 19 + + + 19 + + + + + 19 + + + 19 + + + + + 19 + + + 19 + + + + + 15 + + + 20 + + + 20 + + + + + 15 + + + 20 + + + 20 + + + + + 297 + + + 32 + + + 7 + + + + + + + 34 + + + 15 + + + + + 15 + + + 8 + + + + + 38 + + + + + 40 + + + 30 + + + + + 28 + + + 27 + + + + + 7 + + + + + + + 15 + + + 16 + + + 9 + + + + + 77 + + + 7 + + + + + + + 48 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 53 + + + 7 + + + + + + + 10 + + + 67 + + + 7 + + + + + + + 16 + + + 43 + + + 7 + + + + + 16 + + + 43 + + + 7 + + + + + 16 + + + 44 + + + 16 + + + 35 + + + 7 + + + + + 173 + + + + + + + 63 + + + 33 + + + 90 + + + 7 + + + + + + + 18 + + + 7 + + + + + + + 2 + + + 51 + + + 7 + + + + + + + 27 + + + + + 20 + + + + + 39 + + + 7 + + + + + + + 20 + + + 89 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 10 + + + 2 + + + + + 8 + + + + + 16 + + + 56 + + + + + + + 50 + + + 47 + + + 7 + + + + + + + 8 + + + + + 10 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 10 + + + 7 + + + + + 66 + + + 10 + + + 7 + + + + + + + 29 + + + 11 + + + 15 + + + + + 14 + + + 15 + + + + + 15 + + + 7 + + + + + 93 + + + 7 + + + + + + + 81 + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 28 + + + 7 + + + + + 10 + + + 28 + + + 7 + + + + + + + 25 + + + 19 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 12 + + + 12 + + + 45 + + + 26 + + + 337 + + + 12 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 14 + + + + + 9 + + + 7 + + + + + 9 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 4 + + + 7 + + + + + + + 94 + + + 15 + + + 7 + + + + + + + 56 + + + 23 + + + 7 + + + + + + + 44 + + + 7 + + + 7 + + + + + 8 + + + 9 + + + 19 + + + + + + + 16 + + + 16 + + + 28 + + + 7 + + + + + + + 0 + + + 7 + + + + + 7 + + + + + 12 + + + 7 + + + + + 24 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 20 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + + + 35 + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + + + 20 + + + 7 + + + + + + + 9 + + + 7 + + + + + 9 + + + 8 + + + 7 + + + + + 9 + + + 9 + + + 7 + + + + + 9 + + + 9 + + + 7 + + + + + 123 + + + 7 + + + + + + + 130 + + + 7 + + + + + + + 8 + + + + + 7 + + + + + 19 + + + + + 40 + + + 15 + + + 12 + + + + + + + 7 + + + + + 7 + + + + + 22 + + + 7 + + + + + + + 10 + + + 7 + + + + + 21 + + + 7 + + + + + + + 30 + + + 27 + + + 27 + + + 23 + + + 20 + + + 187 + + + 32 + + + 15 + + + + + + + 8 + + + + + 2 + + + 7 + + + + + + + 10 + + + 47 + + + 92 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 14 + + + 17 + + + 161 + + + 7 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 20 + + + 7 + + + + + + + 9 + + + + + 17 + + + 9 + + + 15 + + + 9 + + + 8 + + + 8 + + + 15 + + + 13 + + + 85 + + + 15 + + + + + + + 60 + + + 7 + + + + + 22 + + + 18 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 26 + + + 7 + + + + + + + 15 + + + 15 + + + + + 15 + + + 15 + + + + + 15 + + + 35 + + + 15 + + + + + + + 30 + + + 12 + + + 84 + + + 15 + + + + + + + 32 + + + 7 + + + + + 13 + + + 9 + + + + + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 16 + + + 7 + + + 7 + + + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 37 + + + 8 + + + 7 + + + + + + + 226 + + + 21 + + + 21 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + 27 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 15 + + + 15 + + + + + 79 + + + 7 + + + + + + + 15 + + + 26 + + + + + 81 + + + 7 + + + + + + + 164 + + + 7 + + + + + 15 + + + 15 + + + + + 20 + + + 15 + + + 8 + + + 13 + + + + + 36 + + + 20 + + + 13 + + + 54 + + + 20 + + + 13 + + + 32 + + + + + + + 10 + + + 2 + + + 7 + + + + + 10 + + + 72 + + + 7 + + + + + 0 + + + 0 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + 15 + + + 72 + + + 7 + + + + + 10 + + + 2 + + + 10 + + + 2 + + + 10 + + + 2 + + + 10 + + + 2 + + + 134 + + + 7 + + + + + 61 + + + 7 + + + + + + + 15 + + + 7 + + + + + 10 + + + 7 + + + + + + + 89 + + + 7 + + + + + + + 15 + + + 9 + + + 15 + + + 9 + + + 15 + + + 9 + + + 39 + + + + + 2 + + + 7 + + + + + + + 14 + + + + + 10 + + + 19 + + + 7 + + + + + + + 40 + + + 31 + + + 7 + + + + + + + 4 + + + 7 + + + + + + + 18 + + + 106 + + + 31 + + + + + 53 + + + 7 + + + + + + + 20 + + + 27 + + + 15 + + + 27 + + + + + 32 + + + 39 + + + 9 + + + 16 + + + + + 46 + + + 76 + + + 76 + + + 76 + + + 9 + + + + + + + 14 + + + 8 + + + 213 + + + 9 + + + 7 + + + + + 15 + + + 9 + + + 15 + + + + + 14 + + + 8 + + + 15 + + + 9 + + + 8 + + + + + + + 70 + + + 7 + + + + + + + 48 + + + 26 + + + 7 + + + 7 + + + + + + + 978 + + + 43 + + + 7 + + + + + + + 24 + + + 42 + + + 42 + + + 42 + + + 111 + + + 16 + + + 24 + + + 20 + + + 16 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 22 + + + 139 + + + 139 + + + 42 + + + 423 + + + 397 + + + 302 + + + 302 + + + 7 + + + + + 599 + + + 16 + + + 7 + + + + + + + 701 + + + 7 + + + + + + + 2 + + + 2 + + + 21 + + + 7 + + + + + + + 17 + + + 11 + + + 43 + + + 7 + + + + + + + 133 + + + 46 + + + 7 + + + 96 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 8 + + + 20 + + + 7 + + + + + + + 8 + + + 7 + + + + + 2 + + + 7 + + + + + 26 + + + 7 + + + + + + + 14 + + + 8 + + + 115 + + + 7 + + + + + + + 18 + + + 19 + + + 7 + + + 7 + + + + + + + 11 + + + 11 + + + 2 + + + 7 + + + + + 32 + + + 15 + + + + + + + 14 + + + + + 11 + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 9 + + + 7 + + + + + + + 164 + + + 37 + + + 37 + + + 7 + + + 13 + + + + + 29 + + + 29 + + + 16 + + + 19 + + + 26 + + + 9 + + + + + + + 20 + + + 2 + + + 7 + + + + + + + 12 + + + + + 41 + + + 7 + + + + + + + 19 + + + + + 73 + + + 7 + + + + + + + 18 + + + 33 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 264 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 2 + + + 69 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 80 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 2 + + + 2 + + + 7 + + + + + 42 + + + 42 + + + 42 + + + 42 + + + 7 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + 80 + + + 1169 + + + 7 + + + 7 + + + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + + + 9 + + + 27 + + + 7 + + + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 12 + + + 130 + + + 45 + + + 59 + + + 58 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 24 + + + 24 + + + 134 + + + 39 + + + 35 + + + + + + + 7 + + + + + 2 + + + 8 + + + 12 + + + 7 + + + + + + + 31 + + + 2 + + + 7 + + + + + + + 25 + + + 25 + + + 2 + + + 26 + + + 14 + + + + + + + 2 + + + 8 + + + + + 15 + + + + + + + 35 + + + 7 + + + + + + + 14 + + + 20 + + + 7 + + + + + + + 34 + + + 7 + + + + + 10 + + + 7 + + + + + + + 25 + + + + + 75 + + + 75 + + + 80 + + + 80 + + + 75 + + + 75 + + + 80 + + + 80 + + + 415 + + + 7 + + + + + + + 25 + + + 13 + + + 7 + + + + + 10 + + + 144 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 10 + + + 10 + + + 93 + + + 7 + + + + + + + 18 + + + 65 + + + 7 + + + + + 19 + + + + + + + 2 + + + 10 + + + 8 + + + 8 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 7 + + + + + 37 + + + 7 + + + + + + + 8 + + + + + 13 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 40 + + + 40 + + + 20 + + + 19 + + + + + 129 + + + 11 + + + 10 + + + 7 + + + + + + + 42 + + + 42 + + + 7 + + + + + 25 + + + 56 + + + 7 + + + + + + + 15 + + + 10 + + + 10 + + + 7 + + + + + + + 15 + + + 9 + + + + + 81 + + + 7 + + + + + + + 51 + + + 7 + + + + + + + 0 + + + 16 + + + 7 + + + + + 10 + + + 16 + + + 7 + + + + + 33 + + + 27 + + + 152 + + + 7 + + + + + + + 54 + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + + + 7 + + + 8 + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 47 + + + 7 + + + + + + + 15 + + + 21 + + + 29 + + + 9 + + + + + 83 + + + 86 + + + 7 + + + + + + + 10 + + + 7 + + + + + 21 + + + 21 + + + 10 + + + 70 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 13 + + + 7 + + + + + + + 11 + + + 7 + + + + + + + 62 + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 103 + + + 7 + + + + + + + 15 + + + 15 + + + 65 + + + 26 + + + + + + + 2 + + + 2 + + + 7 + + + 2 + + + 2 + + + 10 + + + 7 + + + + + + + 19 + + + 7 + + + + + 19 + + + 7 + + + + + 69 + + + 7 + + + + + + + 40 + + + 40 + + + 2 + + + 36 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 14 + + + 7 + + + + + + + 24 + + + 7 + + + 7 + + + + + + + 14 + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + + + 7 + + + + + 15 + + + 9 + + + 14 + + + 15 + + + + + 15 + + + 2 + + + 2 + + + 17 + + + + + 7 + + + + + 18 + + + 25 + + + + + 78 + + + 7 + + + + + + + 15 + + + 15 + + + + + 147 + + + 345 + + + 7 + + + + + + + 49 + + + 7 + + + + + + + 378 + + + 2 + + + 7 + + + + + 15 + + + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 7 + + + + + 67 + + + 7 + + + + + + + 14 + + + 7 + + + + + 10 + + + 7 + + + + + + + 15 + + + 13 + + + 12 + + + 12 + + + 12 + + + 12 + + + 268 + + + 7 + + + + + + + 9 + + + 9 + + + 7 + + + + + 220 + + + 7 + + + + + + + 8 + + + 7 + + + + + 7 + + + + + 515 + + + + + 7 + + + + + + + 8 + + + 7 + + + + + 231 + + + + + + + 8 + + + 7 + + + + + 7 + + + + + 23 + + + + + 7 + + + + + + + 8 + + + 7 + + + + + 12 + + + 7 + + + + + 34 + + + + + 2 + + + 7 + + + + + + + 8 + + + 7 + + + + + 7 + + + + + 515 + + + + + 7 + + + + + + + 8 + + + 7 + + + + + 231 + + + + + + + 8 + + + 7 + + + + + 7 + + + + + 23 + + + + + 7 + + + + + + + 8 + + + 7 + + + + + 12 + + + 7 + + + + + 34 + + + + + 2 + + + 7 + + + + + + + 35 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 9 + + + 7 + + + + + 9 + + + 7 + + + + + 51 + + + 7 + + + + + + + 14 + + + 10 + + + 7 + + + + + 31 + + + 7 + + + + + + + 14 + + + 8 + + + 10 + + + 2 + + + 2 + + + 2 + + + 213 + + + 39 + + + 11 + + + + + 7 + + + + + + + 48 + + + + + 30 + + + 38 + + + + + 85 + + + 37 + + + 65 + + + 34 + + + 88 + + + 82 + + + 53 + + + 7 + + + 7 + + + + + + + 2 + + + 167 + + + 7 + + + + + + + 75 + + + 29 + + + 29 + + + 11 + + + + + + + 10 + + + 10 + + + 7 + + + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + 10 + + + 2 + + + 8 + + + + + 72 + + + 21 + + + 40 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 20 + + + 20 + + + 41 + + + 29 + + + + + 2 + + + 2 + + + 7 + + + + + 5 + + + 9 + + + 18 + + + 13 + + + 2 + + + 7 + + + + + + + 352 + + + 7 + + + 148 + + + + + + + 60 + + + 7 + + + + + + + 13 + + + 8 + + + + + + + 2 + + + 31 + + + + + + + 15 + + + 15 + + + + + 52 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 12 + + + 7 + + + + + 10 + + + + + 7 + + + 11 + + + + + 23 + + + 7 + + + + + + + 8 + + + + + 10 + + + 8 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 68 + + + 14 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + 13 + + + + + + + 2 + + + 7 + + + 7 + + + + + + + 92 + + + 8 + + + 22 + + + + + + + 20 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 149 + + + 7 + + + + + + + 9 + + + 7 + + + + + + + 15 + + + 9 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 2 + + + 5 + + + 71 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 20 + + + 8 + + + 8 + + + + + + + 17 + + + 7 + + + + + + + 2 + + + 14 + + + 7 + + + 11 + + + + + 7 + + + + + 7 + + + 11 + + + + + + + 98 + + + 7 + + + 17 + + + + + + + 9 + + + + + 8 + + + 74 + + + 8 + + + 8 + + + 8 + + + 38 + + + 47 + + + 319 + + + 7 + + + + + + + 9 + + + 7 + + + + + 7 + + + + + 42 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 2 + + + 12 + + + 10 + + + 12 + + + 7 + + + + + 12 + + + 12 + + + 25 + + + 7 + + + + + + + 2 + + + 12 + + + 22 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 14 + + + 51 + + + 7 + + + + + 29 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 101 + + + 7 + + + + + 7 + + + + + 7 + + + + + 0 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + + + 7 + + + + + 14 + + + 7 + + + + + 7 + + + + + 20 + + + 13 + + + 7 + + + + + + + 8 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 7 + + + + + 40 + + + 40 + + + 40 + + + 40 + + + 7 + + + 1 + + + + + 7 + + + 7 + + + + + 63 + + + 7 + + + 19 + + + + + + + 18 + + + 23 + + + 310 + + + 7 + + + 19 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 243 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 8 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 28 + + + 26 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 57 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 43 + + + + + 311 + + + 7 + + + + + + + 16 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 22 + + + 16 + + + 7 + + + + + + + 8 + + + 11 + + + + + 15 + + + 9 + + + 18 + + + + + 2 + + + 7 + + + + + + + 52 + + + 41 + + + 55 + + + 75 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 7 + + + + + 15 + + + 7 + + + + + 15 + + + 7 + + + + + 34 + + + 7 + + + + + + + 2 + + + 2 + + + 19 + + + + + + + 28 + + + 7 + + + + + + + 28 + + + 7 + + + + + + + 26 + + + 7 + + + + + + + 22 + + + 10 + + + 10 + + + 10 + + + 48 + + + 7 + + + + + + + 10 + + + 108 + + + 96 + + + 20 + + + 7 + + + + + + + 126 + + + 72 + + + 7 + + + + + + + 2 + + + 11 + + + + + 9 + + + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 11 + + + 7 + + + + + 11 + + + 7 + + + + + 54 + + + 57 + + + 7 + + + + + + + 54 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 90 + + + 7 + + + + + + + 11 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 13 + + + 10 + + + 7 + + + + + + + 33 + + + 27 + + + 10 + + + 15 + + + 9 + + + 7 + + + + + 33 + + + 27 + + + 10 + + + 15 + + + 9 + + + 7 + + + + + 320 + + + 7 + + + + + + + 30 + + + 7 + + + + + + + 16 + + + 7 + + + + + + + 109 + + + 7 + + + 16 + + + + + + + 13 + + + 8 + + + 38 + + + + + + + 43 + + + 34 + + + 7 + + + 8 + + + + + + + 57 + + + 7 + + + + + + + 15 + + + 16 + + + 15 + + + + + + + 16 + + + 15 + + + 23 + + + 9 + + + + + + + 10 + + + 7 + + + + + 26 + + + 7 + + + + + 26 + + + 7 + + + + + 26 + + + 7 + + + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 26 + + + 7 + + + + + 26 + + + 7 + + + + + 26 + + + 7 + + + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 9 + + + 11 + + + 2 + + + 15 + + + 2 + + + 22 + + + + + 7 + + + + + 7 + + + + + 204 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 2 + + + 2 + + + 5 + + + 2 + + + 2 + + + 7 + + + + + + + 93 + + + 24 + + + + + 9 + + + + + + + 15 + + + 25 + + + 8 + + + + + 25 + + + 8 + + + + + 25 + + + + + 15 + + + 15 + + + 15 + + + 114 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 15 + + + 25 + + + 8 + + + + + 25 + + + 8 + + + + + 15 + + + 32 + + + + + 15 + + + 15 + + + 31 + + + 129 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 15 + + + 25 + + + 8 + + + + + 25 + + + 8 + + + + + 15 + + + 32 + + + + + 56 + + + 72 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 30 + + + 7 + + + + + + + 8 + + + + + 8 + + + + + 15 + + + 15 + + + + + 151 + + + 159 + + + 7 + + + + + 10 + + + 2 + + + 10 + + + 2 + + + 10 + + + 2 + + + 10 + + + 2 + + + 10 + + + 2 + + + 7 + + + + + + + 119 + + + 7 + + + + + 15 + + + 9 + + + 10 + + + 14 + + + 15 + + + + + 2 + + + 9 + + + 16 + + + 14 + + + 2 + + + 9 + + + + + + + 2 + + + 23 + + + 394 + + + 7 + + + + + + + 9 + + + 9 + + + 126 + + + 7 + + + + + + + 258 + + + 7 + + + + + + + 107 + + + 106 + + + 256 + + + 277 + + + 111 + + + 115 + + + 7 + + + 52 + + + + + + + 207 + + + 7 + + + + + + + 26 + + + 7 + + + + + + + 106 + + + 7 + + + + + + + 29 + + + 71 + + + 7 + + + + + + + 18 + + + 7 + + + + + 14 + + + 7 + + + + + + + 228 + + + 19 + + + 18 + + + 7 + + + + + + + 13 + + + 7 + + + + + + + 59 + + + 7 + + + + + + + 40 + + + + + + + 189 + + + 310 + + + 7 + + + + + + + 36 + + + 7 + + + + + + + 2 + + + 25 + + + + + 16 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + + + 14 + + + 34 + + + 8 + + + + + + + 21 + + + 7 + + + + + 12 + + + 7 + + + + + + + 42 + + + 42 + + + 47 + + + 14 + + + 7 + + + + + + + 172 + + + 13 + + + + + 15 + + + + + 7 + + + + + + + 8 + + + 7 + + + + + + + 22 + + + 16 + + + 15 + + + 9 + + + 7 + + + + + 10 + + + 2 + + + 24 + + + 7 + + + + + 26 + + + 26 + + + 32 + + + 32 + + + 18 + + + 18 + + + 29 + + + 90 + + + 265 + + + 214 + + + 7 + + + + + + + 8 + + + 7 + + + + + + + 13 + + + 7 + + + + + 7 + + + + + 19 + + + 7 + + + 7 + + + + + 44 + + + 7 + + + + + + + 2 + + + 10 + + + 7 + + + 17 + + + + + + + 2 + + + 13 + + + 11 + + + 7 + + + + + + + 49 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 7 + + + + + 19 + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 19 + + + 7 + + + + + + + 45 + + + 70 + + + 74 + + + 70 + + + 100 + + + 332 + + + 7 + + + + + + + 7 + + + + + 19 + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 19 + + + 7 + + + + + + + 7 + + + + + 19 + + + 7 + + + + + + + 7 + + + + + 17 + + + 7 + + + 11 + + + + + + + 7 + + + + + 17 + + + 7 + + + 11 + + + + + + + 10 + + + 8 + + + 7 + + + + + + + 10 + + + 8 + + + 7 + + + + + + + 7 + + + + + 72 + + + 7 + + + + + + + 35 + + + 7 + + + + + + + 16 + + + 19 + + + + + 46 + + + 7 + + + + + + + 94 + + + 50 + + + 154 + + + 7 + + + + + + + 18 + + + 10 + + + 27 + + + 7 + + + + + + + 26 + + + 7 + + + 8 + + + + + + + 73 + + + 7 + + + + + + + 2 + + + 32 + + + + + + + 2 + + + 7 + + + + + + + 15 + + + 15 + + + 17 + + + + + 112 + + + 7 + + + 45 + + + + + + + 9 + + + 2 + + + 7 + + + + + + + 8 + + + + + 7 + + + 7 + + + + + 2 + + + 7 + + + + + + + 28 + + + 7 + + + 17 + + + + + + + 2 + + + 20 + + + 26 + + + 8 + + + 7 + + + + + + + 882 + + + 7 + + + 97 + + + + + + + 10 + + + 15 + + + 71 + + + 15 + + + + + + + 23 + + + 7 + + + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 34 + + + 7 + + + + + + + 8 + + + + + 260 + + + 7 + + + + + + + 25 + + + + + 28 + + + 7 + + + + + + + 16 + + + + + 17 + + + 7 + + + + + + + 12 + + + 12 + + + 60 + + + 7 + + + + + + + 8 + + + 8 + + + 8 + + + 8 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 41 + + + 7 + + + + + + + 21 + + + 7 + + + + + 18 + + + 8 + + + + + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 15 + + + 1364 + + + 7 + + + + + + + 2 + + + 7 + + + 18 + + + + + + + 15 + + + 15 + + + 2 + + + + + 63 + + + 7 + + + + + + + 2 + + + 9 + + + 41 + + + 14 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 103 + + + 7 + + + + + + + 103 + + + 7 + + + + + + + 14 + + + 7 + + + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 42 + + + 7 + + + + + + + 0 + + + + + 13 + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 8 + + + 58 + + + 86 + + + 7 + + + + + 24 + + + 24 + + + 7 + + + + + + + 32 + + + 32 + + + 511 + + + 7 + + + 13 + + + + + + + 24 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + + + 52 + + + 7 + + + + + + + 15 + + + 9 + + + 97 + + + 14 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 10 + + + 25 + + + 7 + + + + + 10 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + + + 8 + + + + + 19 + + + + + 2 + + + 7 + + + + + + + 14 + + + 58 + + + 58 + + + 73 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 39 + + + 7 + + + + + 39 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 40 + + + 40 + + + 18 + + + 41 + + + 7 + + + 24 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 8 + + + + + 7 + + + + + + + 10 + + + 10 + + + 2 + + + 7 + + + + + + + 70 + + + 2 + + + 7 + + + + + + + 2 + + + 8 + + + + + 290 + + + 21 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 50 + + + 5 + + + + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 26 + + + 7 + + + + + 10 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 41 + + + 7 + + + + + + + 132 + + + 7 + + + + + + + 33 + + + 73 + + + 7 + + + + + + + 7 + + + + + 9 + + + + + 10 + + + 169 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 3469 + + + 92 + + + 137 + + + 53 + + + 34 + + + 35 + + + 59 + + + 90 + + + 78 + + + 25 + + + 56 + + + 34 + + + 106 + + + 24 + + + 73 + + + 94 + + + 34 + + + 98 + + + 72 + + + 37 + + + 91 + + + 9 + + + 1390 + + + 7 + + + + + + + 2 + + + 7 + + + 39 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 20 + + + + + 22 + + + + + 25 + + + + + 75 + + + 7 + + + + + + + 10 + + + 7 + + + + + 19 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 63 + + + 12 + + + 15 + + + 9 + + + 8 + + + 55 + + + + + + + 0 + + + 0 + + + + + 99 + + + + + + + 123 + + + 45 + + + 46 + + + 51 + + + 36 + + + 154 + + + 7 + + + + + + + 45 + + + 7 + + + + + + + 8 + + + + + 136 + + + 7 + + + + + + + 2 + + + 54 + + + 9 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 11 + + + 2 + + + 7 + + + + + 11 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + + + 34 + + + 7 + + + + + + + 10 + + + 46 + + + 7 + + + 7 + + + + + + + 20 + + + 37 + + + 7 + + + + + + + 0 + + + 0 + + + 7 + + + + + 10 + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + 8 + + + + + 101 + + + 7 + + + + + + + 15 + + + 16 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 7 + + + + + 2 + + + 7 + + + + + + + 15 + + + 9 + + + 14 + + + 26 + + + + + 15 + + + 9 + + + 181 + + + 27 + + + + + 21 + + + 7 + + + + + + + 37 + + + 29 + + + 7 + + + + + + + 22 + + + 7 + + + 7 + + + + + + + 22 + + + 7 + + + 7 + + + + + + + 322 + + + 7 + + + + + + + 37 + + + 56 + + + 7 + + + + + + + 41 + + + 7 + + + + + + + 41 + + + 7 + + + + + + + 19 + + + 7 + + + + + + + 23 + + + 7 + + + + + + + 25 + + + 21 + + + 7 + + + + + + + 36 + + + 20 + + + 14 + + + + + 14 + + + 548 + + + 7 + + + 36 + + + + + + + 15 + + + 15 + + + + + 29 + + + 7 + + + + + + + 2 + + + 15 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 7 + + + + + + + 17 + + + 35 + + + 35 + + + 12 + + + 2 + + + 2 + + + 7 + + + + + + + 114 + + + 7 + + + + + + + 37 + + + 37 + + + 61 + + + 42 + + + 7 + + + + + + + 2 + + + 9 + + + 9 + + + 9 + + + 9 + + + 7 + + + + + + + 56 + + + 62 + + + 11 + + + 19 + + + + + + + 2 + + + 7 + + + 25 + + + + + + + 9 + + + 7 + + + + + + + 9 + + + 7 + + + + + 288 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 2 + + + 47 + + + + + + + 11 + + + 14 + + + 62 + + + 7 + + + + + + + 77 + + + 20 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 40 + + + 40 + + + 32 + + + 19 + + + + + + + 14 + + + 7 + + + + + 7 + + + + + 7 + + + + + 22 + + + 7 + + + + + 7 + + + + + 19 + + + 7 + + + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 14 + + + 21 + + + 7 + + + + + + + 84 + + + 7 + + + + + + + 19 + + + 10 + + + 7 + + + + + + + 11 + + + 7 + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 2 + + + 109 + + + 7 + + + + + + + 34 + + + 2 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 21 + + + 15 + + + 15 + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + 7 + + + + + 10 + + + 41 + + + 10 + + + 41 + + + 10 + + + 41 + + + 259 + + + 7 + + + + + + + 34 + + + 7 + + + + + + + 2 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 38 + + + 7 + + + + + 15 + + + 16 + + + 9 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 10 + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 12 + + + 7 + + + + + 12 + + + 7 + + + + + 12 + + + 7 + + + + + 20 + + + 7 + + + + + + + 12 + + + 7 + + + + + + + 2 + + + + + + + 2 + + + 15 + + + 7 + + + + + + + 2 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + + + 169 + + + 7 + + + + + + + 361 + + + 7 + + + + + + + 2 + + + 2 + + + 48 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 22 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 42 + + + 42 + + + 2 + + + 7 + + + + + + + 15 + + + 9 + + + 0 + + + 0 + + + 15 + + + 9 + + + 7 + + + + + 15 + + + 9 + + + 15 + + + 9 + + + 7 + + + + + 15 + + + 9 + + + 15 + + + 9 + + + 7 + + + + + 279 + + + 7 + + + + + + + 82 + + + 7 + + + + + 15 + + + 16 + + + 9 + + + + + 15 + + + 16 + + + 9 + + + + + + + 2 + + + 0 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 58 + + + 7 + + + + + + + 74 + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + + + 20 + + + 8 + + + 13 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 166 + + + 7 + + + + + 42 + + + 42 + + + 10 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 25 + + + 25 + + + 42 + + + 9 + + + 7 + + + + + 60 + + + 35 + + + 35 + + + 35 + + + 74 + + + 18 + + + + + + + 7 + + + + + 38 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 18 + + + 10 + + + + + 18 + + + 17 + + + 2 + + + 7 + + + + + + + 26 + + + 7 + + + 11 + + + + + + + 25 + + + 7 + + + + + + + 28 + + + 7 + + + + + + + 25 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 20 + + + 35 + + + 35 + + + 8 + + + + + 19 + + + 19 + + + 8 + + + + + 70 + + + 10 + + + 7 + + + + + + + 49 + + + 7 + + + + + + + 37 + + + 7 + + + + + + + 44 + + + 59 + + + 19 + + + 90 + + + 179 + + + 84 + + + 184 + + + 141 + + + 346 + + + 7 + + + + + + + 12 + + + 41 + + + 174 + + + 7 + + + + + 10 + + + 41 + + + 72 + + + 7 + + + + + 30 + + + 7 + + + + + + + 2 + + + + + + + 27 + + + 7 + + + + + 7 + + + + + + + 10 + + + 2 + + + 28 + + + 10 + + + 26 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 53 + + + 7 + + + + + + + 112 + + + 7 + + + + + 15 + + + 29 + + + 9 + + + + + + + 32 + + + 7 + + + + + + + 2 + + + 7 + + + + + 15 + + + 14 + + + + + 13 + + + + + 8 + + + 7 + + + + + + + 2 + + + 7 + + + + + 15 + + + 2 + + + 14 + + + + + 13 + + + + + 8 + + + 7 + + + + + + + 294 + + + 136 + + + 75 + + + 7 + + + + + + + 36 + + + 14 + + + 15 + + + 9 + + + 15 + + + 9 + + + 363 + + + 18 + + + + + + + 20 + + + 7 + + + + + 2 + + + 7 + + + + + + + 69 + + + 46 + + + 36 + + + 7 + + + 2 + + + 7 + + + + + + + 8 + + + 2 + + + 7 + + + + + + + 112 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 26 + + + 24 + + + 7 + + + + + + + 18 + + + 7 + + + + + + + 7 + + + + + 10 + + + 37 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + + + 15 + + + 2 + + + 36 + + + + + + + 28 + + + 28 + + + 15 + + + + + 93 + + + 7 + + + + + + + 45 + + + 7 + + + + + + + 2 + + + 8 + + + + + 22 + + + 7 + + + + + + + 124 + + + 7 + + + + + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 118 + + + 16 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + + + 65 + + + 7 + + + 8 + + + + + + + 102 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + + + 194 + + + 7 + + + + + 10 + + + 10 + + + 2 + + + 10 + + + 2 + + + 7 + + + + + + + 143 + + + 7 + + + + + + + 61 + + + 7 + + + + + + + 54 + + + 7 + + + + + + + 12 + + + 4 + + + 10 + + + 2 + + + 4 + + + 4 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + + + 5294 + + + 7 + + + + + 7 + + + 7 + + + + + 872 + + + 2 + + + 7 + + + + + + + 16 + + + 80 + + + 7 + + + + + + + 74 + + + 142 + + + 88 + + + 7 + + + + + + + 17 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 10 + + + 42 + + + 42 + + + 104 + + + 7 + + + + + + + 16 + + + 16 + + + 41 + + + 7 + + + + + + + 14 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + + + 8 + + + 8 + + + 35 + + + 7 + + + + + + + 130 + + + 7 + + + + + + + 2 + + + + + 8 + + + + + 9 + + + 10 + + + 24 + + + 7 + + + + + + + 0 + + + 7 + + + + + 17 + + + 14 + + + 7 + + + + + + + 10 + + + 4 + + + 7 + + + + + + + 10 + + + 7 + + + + + 2 + + + 14 + + + + + + + 2 + + + 44 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 9 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 10 + + + + + + + 98 + + + 7 + + + + + + + 8 + + + + + 30 + + + 98 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 11 + + + 11 + + + 7 + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 11 + + + 11 + + + 7 + + + + + 10 + + + 10 + + + 11 + + + 11 + + + 7 + + + + + 10 + + + 11 + + + 11 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 16 + + + 7 + + + + + 387 + + + 7 + + + + + + + 20 + + + 80 + + + 89 + + + 14 + + + 14 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 22 + + + 22 + + + 20 + + + 68 + + + 12 + + + 168 + + + 7 + + + + + + + 22 + + + 14 + + + 64 + + + 63 + + + 74 + + + 36 + + + 31 + + + 7 + + + + + + + 14 + + + 8 + + + 8 + + + 20 + + + + + 7 + + + + + 124 + + + 7 + + + + + + + 111 + + + 7 + + + + + 29 + + + 7 + + + + + + + 21 + + + 35 + + + 68 + + + 7 + + + + + + + 7 + + + + + 8 + + + + + 17 + + + 7 + + + + + + + 128 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 15 + + + 73 + + + 8 + + + + + + + 48 + + + 7 + + + + + + + 137 + + + 11 + + + 27 + + + 29 + + + 36 + + + 7 + + + + + + + 10 + + + 60 + + + 32 + + + 32 + + + 21 + + + 98 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 31 + + + 7 + + + + + + + 15 + + + 15 + + + 145 + + + 7 + + + + + + + 29 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 14 + + + 8 + + + + + + + 610 + + + 7 + + + + + 15 + + + 15 + + + 16 + + + 14 + + + 9 + + + + + + + 8 + + + 29 + + + 24 + + + 132 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 21 + + + 2 + + + 7 + + + + + + + 14 + + + 35 + + + 7 + + + + + + + 43 + + + 33 + + + 40 + + + 54 + + + 7 + + + + + + + 16 + + + 48 + + + 7 + + + + + + + 15 + + + 9 + + + 76 + + + 7 + + + + + + + 27 + + + 7 + + + + + + + 2 + + + 7 + + + + + 12 + + + 15 + + + 7 + + + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + 7 + + + + + + + 38 + + + 2 + + + 9 + + + 7 + + + + + + + 7 + + + + + 19 + + + 42 + + + 60 + + + 55 + + + 84 + + + 62 + + + 82 + + + 63 + + + 87 + + + 108 + + + 7 + + + 53 + + + + + + + 15 + + + 16 + + + 9 + + + + + 31 + + + 7 + + + + + + + 2 + + + 16 + + + 10 + + + 7 + + + + + + + 1 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 19 + + + 7 + + + + + + + 160 + + + 72 + + + 7 + + + + + + + 22 + + + 10 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 4 + + + 7 + + + + + + + 15 + + + 7 + + + + + + + 27 + + + 10 + + + 7 + + + + + + + 11 + + + 11 + + + 2 + + + 7 + + + + + + + 2 + + + 103 + + + 7 + + + + + + + 64 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + + + 8 + + + + + 10 + + + 22 + + + 10 + + + 7 + + + + + + + 42 + + + 42 + + + 13 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 40 + + + 2 + + + 2 + + + 7 + + + + + + + 34 + + + 172 + + + + + + + 15 + + + + + 197 + + + 7 + + + + + + + 95 + + + 7 + + + + + + + 2 + + + 18 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 20 + + + + + + + 8 + + + 78 + + + 78 + + + 78 + + + 78 + + + 191 + + + 7 + + + + + + + 40 + + + 7 + + + + + + + 78 + + + 70 + + + 7 + + + + + + + 33 + + + 7 + + + + + + + 53 + + + 150 + + + 7 + + + + + + + 18 + + + 16 + + + 9 + + + + + 18 + + + 16 + + + 9 + + + + + 64 + + + 7 + + + + + + + 15 + + + 15 + + + 64 + + + 7 + + + + + + + 43 + + + 4 + + + + + + + 0 + + + 10 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 133 + + + 7 + + + 23 + + + + + + + 11 + + + 14 + + + 169 + + + 7 + + + + + + + 40 + + + 7 + + + + + + + 10 + + + 7 + + + + + + + 766 + + + 36 + + + 7 + + + 53 + + + + + + + 10 + + + 2 + + + + + 13 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 13 + + + 7 + + + + + + + 15 + + + 2 + + + 26 + + + + + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 478 + + + 39 + + + 30 + + + 31 + + + 39 + + + 32 + + + 32 + + + 32 + + + 31 + + + 28 + + + 34 + + + 34 + + + 28 + + + 31 + + + 25 + + + 26 + + + 15 + + + + + + + 10 + + + 10 + + + 7 + + + + + 17 + + + 17 + + + 7 + + + + + 98 + + + 7 + + + + + + + 8 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 2 + + + 7 + + + + + + + 10 + + + 9 + + + 16 + + + + + + + 0 + + + 0 + + + 20 + + + 26 + + + 8 + + + + + 42 + + + 42 + + + 26 + + + 22 + + + 50 + + + + + + + 52 + + + 10 + + + 7 + + + 9 + + + + + + + 18 + + + 7 + + + 7 + + + + + 14 + + + 10 + + + 10 + + + 2 + + + 12 + + + + + 88 + + + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 8 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 33 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 71 + + + 36 + + + 71 + + + 7 + + + + + + + 38 + + + 7 + + + + + 23 + + + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 2 + + + 15 + + + 15 + + + + + + + 23 + + + 7 + + + + + + + 12 + + + 7 + + + + + 14 + + + 7 + + + + + 43 + + + 8 + + + 7 + + + 11 + + + + + + + 2 + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + + + 8 + + + + + 16 + + + + + 7 + + + + + 7 + + + 8 + + + + + 12 + + + 7 + + + + + 230 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 2 + + + 7 + + + + + 14 + + + + + 83 + + + 7 + + + + + + + 2 + + + 7 + + + + + 9 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 9 + + + 7 + + + + + + + 19 + + + 7 + + + + + 0 + + + 0 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 24 + + + 7 + + + + + + + 68 + + + 7 + + + + + 2 + + + 7 + + + + + + + 9 + + + 19 + + + 61 + + + 9 + + + + + + + 10 + + + 7 + + + + + 34 + + + + + + + 43 + + + 118 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 216 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 7 + + + + + + + 126 + + + 7 + + + + + 33 + + + 65 + + + 7 + + + + + + + 38 + + + 7 + + + + + + + 146 + + + 7 + + + + + + + 0 + + + 7 + + + + + 10 + + + 7 + + + + + 35 + + + 7 + + + + + + + 2 + + + 10 + + + 30 + + + 36 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 42 + + + 7 + + + + + + + 10 + + + 10 + + + 35 + + + 7 + + + + + + + 103 + + + 7 + + + + + + + 23 + + + 72 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 42 + + + 42 + + + 19 + + + 7 + + + + + 42 + + + 42 + + + 22 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 19 + + + 2 + + + 7 + + + + + + + 15 + + + 9 + + + 9 + + + + + 85 + + + 7 + + + + + + + 2 + + + 19 + + + + + + + 20 + + + 2 + + + 105 + + + 7 + + + + + + + 198 + + + 7 + + + + + + + 361 + + + 7 + + + + + 31 + + + 29 + + + + + + + 19 + + + 2 + + + 7 + + + + + + + 28 + + + + + 7 + + + + + 54 + + + 7 + + + + + + + 12 + + + 31 + + + 7 + + + + + + + 8 + + + 7 + + + + + 2 + + + 7 + + + + + 0 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 2 + + + 0 + + + 7 + + + + + + + 29 + + + 7 + + + + + + + 9 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 2 + + + 7 + + + + + 14 + + + 7 + + + + + 7 + + + + + + + 15 + + + 7 + + + + + + + 16 + + + 7 + + + 7 + + + + + 7 + + + + + 7 + + + + + 47 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 14 + + + 2 + + + 11 + + + 2 + + + 14 + + + 2 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + 8 + + + + + 14 + + + 10 + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 13 + + + 7 + + + + + + + 35 + + + 28 + + + 7 + + + + + + + 2 + + + 7 + + + + + 14 + + + 7 + + + + + + + 13 + + + 7 + + + + + + + 60 + + + 165 + + + 7 + + + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 14 + + + 8 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 38 + + + 32 + + + 36 + + + 49 + + + 7 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 7 + + + 11 + + + + + 10 + + + 10 + + + 13 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 12 + + + + + + + 14 + + + 15 + + + 2 + + + 7 + + + + + 18 + + + 15 + + + + + + + 10 + + + 2 + + + 7 + + + + + 14 + + + 11 + + + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 2 + + + 2 + + + 132 + + + 7 + + + + + + + 258 + + + 7 + + + + + + + 14 + + + 7 + + + + + 42 + + + 42 + + + 7 + + + + + 42 + + + 42 + + + 7 + + + + + 12 + + + 7 + + + + + + + 14 + + + 8 + + + + + 14 + + + 8 + + + + + 14 + + + 8 + + + + + 78 + + + 7 + + + + + + + 15 + + + 7 + + + + + 18 + + + 8 + + + + + + + 11 + + + 8 + + + 7 + + + + + 0 + + + 7 + + + + + 11 + + + 7 + + + + + 86 + + + 7 + + + + + + + 10 + + + 2 + + + 10 + + + 2 + + + 2 + + + 7 + + + + + + + 35 + + + 25 + + + 35 + + + 25 + + + 7 + + + + + 19 + + + 178 + + + 2 + + + 7 + + + + + + + 14 + + + 2 + + + 7 + + + + + 14 + + + 2 + + + 7 + + + + + 16 + + + 2 + + + 7 + + + + + 44 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + + + 7 + + + 7 + + + + + 20 + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 15 + + + 7 + + + + + 35 + + + 7 + + + + + + + 33 + + + 27 + + + + + + + 32 + + + 31 + + + 44 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 20 + + + 21 + + + 20 + + + 21 + + + 7 + + + + + 20 + + + 20 + + + 7 + + + + + 26 + + + 26 + + + 26 + + + 26 + + + 7 + + + + + 64 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 7 + + + + + 14 + + + 42 + + + 14 + + + 2 + + + 7 + + + + + + + 19 + + + 7 + + + + + + + 2 + + + 10 + + + 10 + + + 116 + + + 7 + + + + + + + 7 + + + 9 + + + 15 + + + + + 15 + + + 7 + + + + + 16 + + + 10 + + + 64 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 7 + + + + + 10 + + + 10 + + + 2 + + + 2 + + + 7 + + + + + 0 + + + 10 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 26 + + + 10 + + + 7 + + + + + 26 + + + + + 22 + + + + + 22 + + + + + 7 + + + 7 + + + + + 438 + + + 7 + + + + + + + 2 + + + 10 + + + 10 + + + 7 + + + + + 2 + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + + + 44 + + + 7 + + + + + 14 + + + 7 + + + + + 7 + + + 7 + + + + + + + 77 + + + 7 + + + 7 + + + + + + + 48 + + + 7 + + + + + + + 2 + + + + + 21 + + + 29 + + + 10 + + + 39 + + + + + + + 20 + + + 81 + + + 7 + + + 7 + + + + + + + 36 + + + 20 + + + 2 + + + 7 + + + + + + + 60 + + + 7 + + + + + + + 12 + + + 66 + + + 2 + + + 7 + + + + + + + 120 + + + 25 + + + + + + + 20 + + + 12 + + + 7 + + + + + 8 + + + + + 32 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 6 + + + 7 + + + + + 12 + + + 7 + + + + + 37 + + + 7 + + + + + + + 21 + + + 7 + + + + + 7 + + + + + 8 + + + + + + + 173 + + + 7 + + + + + + + 12 + + + 7 + + + + + 47 + + + 7 + + + + + + + 6 + + + 7 + + + + + + + 11 + + + 10 + + + 199 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 40 + + + 7 + + + + + + + 10 + + + 7 + + + + + 14 + + + 7 + + + + + 11 + + + 10 + + + 8 + + + 7 + + + + + + + 49 + + + 7 + + + + + 10 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 15 + + + 17 + + + + + 7 + + + + + 7 + + + + + 104 + + + 7 + + + + + + + 7 + + + + + 69 + + + 7 + + + + + + + 70 + + + 7 + + + + + + + 65 + + + 7 + + + + + + + 45 + + + 89 + + + 7 + + + + + + + 12 + + + 2 + + + 7 + + + + + + + 69 + + + 68 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 14 + + + 14 + + + 223 + + + 7 + + + + + + + 10 + + + 8 + + + 7 + + + + + 38 + + + + + + + 7 + + + + + 71 + + + 23 + + + 7 + + + + + + + 18 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 27 + + + 8 + + + 8 + + + + + 8 + + + 9 + + + + + + + 2 + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + 7 + + + + + 10 + + + 7 + + + + + + + 18 + + + 14 + + + + + 25 + + + 7 + + + + + + + 30 + + + 7 + + + + + + + 35 + + + 7 + + + + + + + 2 + + + 7 + + + 7 + + + + + 21 + + + 7 + + + + + + + 2 + + + 2 + + + + + + + 20 + + + 7 + + + + + 20 + + + 7 + + + + + 20 + + + 7 + + + + + 120 + + + 7 + + + + + + + 9 + + + 7 + + + + + + + 7 + + + + + 16 + + + 7 + + + + + + + 70 + + + 26 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + + + 19 + + + 15 + + + + + 42 + + + 42 + + + 15 + + + 15 + + + + + 10 + + + 7 + + + + + + + 158 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + + + 54 + + + 22 + + + 15 + + + 20 + + + + + 15 + + + 13 + + + + + 7 + + + + + + + 93 + + + 7 + + + + + 15 + + + 9 + + + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 19 + + + 15 + + + + + 109 + + + 9 + + + + + + + 7 + + + + + 7 + + + + + 8 + + + 7 + + + + + + + 28 + + + 7 + + + + + + + 7 + + + + + 10 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 16 + + + 7 + + + + + + + 10 + + + 10 + + + 14 + + + 18 + + + + + 50 + + + 7 + + + + + + + 18 + + + 16 + + + + + 134 + + + 7 + + + + + + + 14 + + + 9 + + + 12 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 10 + + + 10 + + + 2 + + + 33 + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + 10 + + + 54 + + + 7 + + + + + 11 + + + + + 10 + + + + + + + 20 + + + 7 + + + + + + + 42 + + + 7 + + + + + + + 33 + + + 7 + + + + + + + 31 + + + 20 + + + 31 + + + 20 + + + 54 + + + 7 + + + + + + + 81 + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 6 + + + 7 + + + + + + + 20 + + + 71 + + + 7 + + + + + + + 15 + + + 117 + + + 9 + + + + + + + 138 + + + 7 + + + + + + + 10 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 288 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 10 + + + 7 + + + + + + + 16 + + + 7 + + + + + 23 + + + 7 + + + + + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + 128 + + + 7 + + + + + + + 43 + + + 23 + + + + + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 10 + + + 7 + + + + + + + 24 + + + 7 + + + + + 10 + + + 7 + + + + + + + 126 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 29 + + + 7 + + + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 175 + + + 7 + + + + + 114 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 60 + + + 7 + + + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 60 + + + 7 + + + + + 35 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 227 + + + 13 + + + 7 + + + + + 7 + + + + + 77 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 135 + + + 7 + + + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 143 + + + 13 + + + 7 + + + + + 19 + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 43 + + + 7 + + + + + 14 + + + 7 + + + + + + + 77 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 50 + + + 7 + + + + + + + 101 + + + 79 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 87 + + + 7 + + + + + + + 2 + + + 27 + + + 7 + + + 35 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 65 + + + 15 + + + 7 + + + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 72 + + + 15 + + + 7 + + + + + 63 + + + 7 + + + + + 51 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 29 + + + 15 + + + 9 + + + 7 + + + + + + + 63 + + + 59 + + + 23 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 76 + + + 15 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 49 + + + 20 + + + 30 + + + 9 + + + + + 82 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 113 + + + 15 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 50 + + + 29 + + + 7 + + + + + 33 + + + 7 + + + + + + + 2 + + + 15 + + + 36 + + + 26 + + + + + 37 + + + 62 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 181 + + + 57 + + + 6 + + + 7 + + + 23 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 13 + + + 91 + + + 7 + + + + + 7 + + + + + 42 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 38 + + + 51 + + + 23 + + + 12 + + + 82 + + + 12 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 113 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 72 + + + 15 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 132 + + + 2 + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 51 + + + 110 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 52 + + + 125 + + + 15 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 48 + + + 7 + + + + + 22 + + + 7 + + + + + 25 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 47 + + + 7 + + + + + 19 + + + 7 + + + + + 19 + + + 7 + + + + + + + 21 + + + 2 + + + 15 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 2 + + + 37 + + + 2 + + + 10 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 43 + + + 7 + + + + + 17 + + + 7 + + + + + 58 + + + 7 + + + + + 66 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 8 + + + + + 2 + + + 2 + + + 47 + + + + + + + 2 + + + 76 + + + 10 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 18 + + + 18 + + + 20 + + + 101 + + + 10 + + + 24 + + + 14 + + + 14 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 32 + + + 7 + + + 114 + + + 7 + + + + + 120 + + + 120 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 283 + + + 96 + + + 20 + + + 7 + + + + + + + 21 + + + 2 + + + 6 + + + 7 + + + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 18 + + + 2 + + + 61 + + + 15 + + + 7 + + + + + 18 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 10 + + + 10 + + + 10 + + + 95 + + + 10 + + + 7 + + + + + + + 9 + + + 15 + + + 7 + + + + + 2 + + + 7 + + + + + 2 + + + 9 + + + 19 + + + 247 + + + 7 + + + 7 + + + 17 + + + 17 + + + 62 + + + 54 + + + 41 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 49 + + + 36 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + + + 46 + + + 34 + + + 46 + + + 34 + + + 34 + + + 34 + + + 34 + + + 54 + + + 46 + + + 34 + + + 28 + + + 34 + + + 34 + + + 42 + + + 645 + + + 7 + + + + + 66 + + + 7 + + + + + 24 + + + 7 + + + + + 64 + + + 7 + + + + + 38 + + + 7 + + + + + 69 + + + 7 + + + + + 41 + + + 7 + + + + + 62 + + + 7 + + + + + 15 + + + 7 + + + + + 44 + + + 7 + + + + + 67 + + + 7 + + + + + 39 + + + 7 + + + + + 58 + + + 7 + + + + + 35 + + + 7 + + + + + 45 + + + 7 + + + + + + + 8 + + + + + 28 + + + 16 + + + 7 + + + + + 20 + + + 7 + + + + + + + 21 + + + 21 + + + 2 + + + 20 + + + 20 + + + 7 + + + + + + + 16 + + + 0 + + + 7 + + + + + 7 + + + + + 71 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + 18 + + + 7 + + + + + + + 0 + + + 7 + + + + + 15 + + + 2 + + + 8 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 25 + + + 40 + + + 15 + + + 18 + + + 16 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 20 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 43 + + + 23 + + + 14 + + + 23 + + + 15 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 49 + + + 2 + + + 7 + + + + + 63 + + + 7 + + + + + 51 + + + 7 + + + + + + + 26 + + + 2 + + + + + 37 + + + 2 + + + 7 + + + + + + + 10 + + + 32 + + + 8 + + + 7 + + + + + 19 + + + 7 + + + + + + + 41 + + + 146 + + + + + 68 + + + 24 + + + 7 + + + + + 35 + + + 7 + + + + + + + 15 + + + 9 + + + 18 + + + + + 100 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 34 + + + 7 + + + + + + + 40 + + + 17 + + + 7 + + + + + 40 + + + 9 + + + 7 + + + + + 23 + + + 17 + + + 7 + + + + + 121 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 51 + + + 9 + + + 18 + + + 7 + + + + + 23 + + + 7 + + + + + + + 7 + + + + + 64 + + + 24 + + + 7 + + + + + 18 + + + 7 + + + + + + + 48 + + + 10 + + + 7 + + + + + 50 + + + 7 + + + + + 210 + + + 7 + + + + + 7 + + + + + + + 40 + + + 34 + + + 34 + + + 59 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 25 + + + 7 + + + + + 86 + + + 7 + + + + + 24 + + + 7 + + + + + + + 40 + + + 40 + + + 2 + + + 32 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 15 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 153 + + + 14 + + + 7 + + + + + 7 + + + + + 7 + + + + + 79 + + + 7 + + + + + + + 45 + + + 7 + + + 2 + + + 15 + + + 15 + + + + + + + 20 + + + 21 + + + 12 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 94 + + + 21 + + + 18 + + + 7 + + + + + + + 2 + + + 7 + + + + + 19 + + + 2 + + + 2 + + + 7 + + + + + + + 20 + + + 21 + + + 32 + + + 7 + + + + + 14 + + + 7 + + + + + + + 42 + + + 9 + + + 7 + + + + + 45 + + + 25 + + + 7 + + + + + + + 34 + + + + + 67 + + + 24 + + + 7 + + + + + 40 + + + 7 + + + + + 52 + + + 7 + + + + + 35 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 8 + + + + + 7 + + + + + 2 + + + 8 + + + + + 39 + + + 21 + + + + + 30 + + + 7 + + + + + + + 2 + + + 79 + + + 7 + + + + + 7 + + + + + 26 + + + 21 + + + 7 + + + + + + + 44 + + + 21 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 8 + + + + + + + 20 + + + 7 + + + + + 8 + + + 20 + + + 45 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 20 + + + 2 + + + 101 + + + 7 + + + + + 35 + + + 7 + + + + + + + 7 + + + + + 40 + + + 18 + + + + + 2 + + + 7 + + + + + 56 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 37 + + + 17 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 14 + + + 52 + + + 52 + + + 7 + + + + + 64 + + + 7 + + + + + 60 + + + 7 + + + + + 46 + + + 7 + + + + + + + 39 + + + 19 + + + 15 + + + + + 43 + + + 9 + + + + + 48 + + + 7 + + + + + + + 18 + + + 7 + + + + + 2 + + + 36 + + + 25 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 23 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 38 + + + 8 + + + 7 + + + + + 14 + + + 7 + + + + + + + 54 + + + 75 + + + 54 + + + 7 + + + + + 19 + + + 7 + + + + + 19 + + + 7 + + + + + + + 86 + + + 2 + + + 9 + + + 12 + + + 7 + + + + + 41 + + + 7 + + + 7 + + + + + 7 + + + + + 36 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 43 + + + 23 + + + 28 + + + 15 + + + + + + + 86 + + + 2 + + + 9 + + + 12 + + + 7 + + + + + 49 + + + 7 + + + 7 + + + + + 7 + + + + + 36 + + + 7 + + + + + + + 33 + + + 34 + + + 7 + + + + + 47 + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 41 + + + 25 + + + 7 + + + + + 75 + + + 7 + + + + + 7 + + + + + 52 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + 41 + + + 35 + + + 60 + + + 9 + + + 7 + + + 7 + + + + + 28 + + + 7 + + + + + 32 + + + 7 + + + + + 40 + + + 7 + + + + + 20 + + + 20 + + + 7 + + + + + + + 86 + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + 20 + + + 7 + + + + + 7 + + + + + 19 + + + 12 + + + 7 + + + + + + + 28 + + + 22 + + + 77 + + + 7 + + + + + 14 + + + 7 + + + + + + + 21 + + + 22 + + + 39 + + + 7 + + + + + 14 + + + 7 + + + + + + + 2 + + + 2 + + + 36 + + + 84 + + + 7 + + + + + + + 113 + + + 57 + + + 42 + + + 38 + + + 7 + + + + + 10 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 521 + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 42 + + + 42 + + + 13 + + + 7 + + + + + 74 + + + 18 + + + 7 + + + 7 + + + + + + + 10 + + + 42 + + + 42 + + + 20 + + + 33 + + + 33 + + + 40 + + + 40 + + + 7 + + + + + 14 + + + 7 + + + + + 14 + + + 7 + + + + + 25 + + + 7 + + + + + 25 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 87 + + + 7 + + + + + 18 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 248 + + + 13 + + + 7 + + + + + 7 + + + + + 94 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 34 + + + 36 + + + 7 + + + + + 53 + + + 7 + + + + + 53 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 81 + + + 45 + + + 7 + + + 7 + + + + + 49 + + + 7 + + + + + 82 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 34 + + + 36 + + + 7 + + + + + 53 + + + 7 + + + + + 53 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 81 + + + 35 + + + 7 + + + + + 39 + + + 7 + + + + + 25 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 30 + + + 36 + + + 7 + + + + + 29 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 56 + + + 36 + + + 7 + + + + + 17 + + + 7 + + + + + + + 44 + + + 8 + + + 12 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 151 + + + 60 + + + 7 + + + + + 39 + + + 7 + + + + + 51 + + + 7 + + + + + + + 42 + + + 42 + + + 7 + + + + + 59 + + + 7 + + + + + 34 + + + 7 + + + + + + + 28 + + + 19 + + + 217 + + + 8 + + + 8 + + + 108 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 7 + + + + + 40 + + + 40 + + + 39 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 16 + + + 7 + + + + + + + 36 + + + 2 + + + 26 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 38 + + + 8 + + + 7 + + + + + 26 + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 8 + + + 171 + + + 7 + + + + + 13 + + + 7 + + + + + 13 + + + 7 + + + + + + + 97 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 38 + + + 7 + + + 7 + + + + + 20 + + + 7 + + + + + 24 + + + 7 + + + + + + + 108 + + + 16 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 34 + + + 7 + + + + + + + 37 + + + 2 + + + 8 + + + 8 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 12 + + + 12 + + + 7 + + + 35 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 68 + + + 15 + + + 7 + + + + + 72 + + + 7 + + + + + 35 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 66 + + + 15 + + + 7 + + + + + 38 + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 66 + + + 15 + + + 7 + + + + + 38 + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 66 + + + 15 + + + 7 + + + + + 63 + + + 7 + + + + + 36 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 52 + + + 14 + + + 45 + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 55 + + + 15 + + + 7 + + + + + 72 + + + 7 + + + + + 35 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 69 + + + 15 + + + 7 + + + + + 59 + + + 41 + + + 22 + + + 7 + + + + + 27 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + + + 14 + + + 8 + + + 7 + + + 46 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 51 + + + 7 + + + + + 15 + + + 7 + + + + + 20 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 142 + + + 7 + + + + + 15 + + + 7 + + + + + 7 + + + + + 7 + + + + + 51 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 190 + + + 7 + + + + + 15 + + + 7 + + + + + 7 + + + + + 7 + + + + + 79 + + + 7 + + + + + + + 68 + + + 15 + + + 7 + + + + + 14 + + + 14 + + + 207 + + + 83 + + + 6 + + + 7 + + + + + + + 37 + + + 7 + + + + + 252 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 135 + + + 15 + + + 6 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 12 + + + 12 + + + 7 + + + 35 + + + + + + + 29 + + + 40 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 14 + + + 14 + + + 242 + + + 15 + + + 6 + + + 7 + + + + + 28 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 40 + + + 34 + + + + + 16 + + + 7 + + + + + 13 + + + 7 + + + + + 13 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 46 + + + 20 + + + 30 + + + 9 + + + + + 23 + + + 7 + + + + + 26 + + + 7 + + + + + + + 8 + + + 12 + + + 20 + + + 8 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 14 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 51 + + + 12 + + + 7 + + + + + + + 293 + + + 53 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 90 + + + 7 + + + + + + + 390 + + + 54 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 7 + + + + + 163 + + + 7 + + + + + + + 574 + + + 54 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 225 + + + 7 + + + + + + + 632 + + + 54 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 348 + + + 7 + + + + + 125 + + + 7 + + + + + + + 374 + + + 67 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 173 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 15 + + + + + 57 + + + + + 2 + + + 7 + + + + + 13 + + + 7 + + + + + + + 29 + + + 40 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 14 + + + 14 + + + 281 + + + 15 + + + 6 + + + 7 + + + + + 7 + + + + + 57 + + + 7 + + + + + + + 42 + + + 42 + + + 42 + + + 42 + + + 10 + + + 106 + + + 2 + + + 2 + + + 7 + + + + + 31 + + + 7 + + + + + + + 14 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 17 + + + 33 + + + + + 13 + + + 7 + + + + + + + 42 + + + 42 + + + 34 + + + 2 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 13 + + + 7 + + + + + + + 2 + + + 8 + + + 33 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 70 + + + 2 + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 16 + + + 21 + + + 28 + + + 7 + + + + + 2 + + + 7 + + + + + + + 11 + + + 7 + + + + + 2 + + + 36 + + + 99 + + + 17 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 15 + + + 7 + + + + + 49 + + + 36 + + + 7 + + + + + + + 10 + + + 42 + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 55 + + + 7 + + + + + + + 2 + + + 13 + + + 2 + + + 20 + + + 46 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 32 + + + 37 + + + 16 + + + 32 + + + 7 + + + + + + + 9 + + + 36 + + + 42 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 2 + + + 2 + + + 152 + + + 10 + + + 7 + + + + + 7 + + + + + 67 + + + 22 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 9 + + + 15 + + + 25 + + + 83 + + + 38 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 36 + + + 11 + + + 2 + + + 7 + + + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 8 + + + 2 + + + 63 + + + 19 + + + 7 + + + 8 + + + + + + + 42 + + + 42 + + + 31 + + + 2 + + + 2 + + + 2 + + + 8 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 190 + + + 7 + + + + + 38 + + + 21 + + + 15 + + + 9 + + + 2 + + + 16 + + + 18 + + + + + + + 33 + + + 35 + + + 15 + + + 8 + + + 53 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 45 + + + 7 + + + + + 19 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 88 + + + 32 + + + 58 + + + 32 + + + 28 + + + 8 + + + 28 + + + 2 + + + 32 + + + 29 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 26 + + + 14 + + + 7 + + + + + 10 + + + 7 + + + + + 54 + + + 10 + + + 7 + + + + + 13 + + + 7 + + + + + 15 + + + 9 + + + 7 + + + + + + + 42 + + + 42 + + + 14 + + + 2 + + + 2 + + + 42 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 27 + + + 12 + + + 43 + + + 43 + + + + + + + 37 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 9 + + + 7 + + + + + + + 2 + + + 16 + + + 51 + + + + + 10 + + + 8 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 25 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 26 + + + 52 + + + + + 2 + + + 19 + + + + + 24 + + + 7 + + + + + + + 20 + + + 102 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 9 + + + 7 + + + + + 70 + + + 9 + + + 4 + + + 7 + + + + + 21 + + + 7 + + + + + + + 20 + + + 10 + + + 2 + + + 2 + + + 74 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 113 + + + 32 + + + 7 + + + + + 19 + + + 53 + + + 7 + + + + + + + 20 + + + 28 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 69 + + + 7 + + + + + 7 + + + + + 33 + + + 7 + + + + + + + 28 + + + + + 20 + + + 2 + + + 67 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 116 + + + 7 + + + + + 24 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 34 + + + 29 + + + 7 + + + + + 76 + + + 7 + + + + + + + 56 + + + 56 + + + 15 + + + 51 + + + 13 + + + 7 + + + + + 24 + + + 7 + + + + + 24 + + + 7 + + + + + + + 75 + + + 7 + + + + + 20 + + + 7 + + + + + 21 + + + 7 + + + 7 + + + 7 + + + + + 21 + + + 8 + + + 9 + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 7 + + + + + 42 + + + 42 + + + 20 + + + 7 + + + + + 54 + + + 36 + + + 8 + + + 7 + + + + + 24 + + + 14 + + + 7 + + + + + + + 7 + + + + + 11 + + + 145 + + + 20 + + + 110 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 31 + + + 31 + + + 26 + + + 7 + + + + + + + 81 + + + 14 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + 7 + + + + + 24 + + + 70 + + + 7 + + + + + + + 40 + + + 8 + + + 7 + + + + + 22 + + + 7 + + + + + + + 38 + + + 20 + + + 63 + + + 7 + + + + + 7 + + + + + 72 + + + 7 + + + + + 25 + + + 7 + + + + + + + 131 + + + 27 + + + 48 + + + 62 + + + 7 + + + 23 + + + + + 212 + + + 13 + + + + + + + 41 + + + 41 + + + 31 + + + 41 + + + 31 + + + 316 + + + 29 + + + 27 + + + 19 + + + + + 162 + + + + + 167 + + + + + 169 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 14 + + + + + 10 + + + 10 + + + 33 + + + 33 + + + 33 + + + 88 + + + 7 + + + + + 233 + + + + + 161 + + + + + 153 + + + + + 2 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 41 + + + 141 + + + 31 + + + + + 187 + + + 13 + + + + + 39 + + + + + + + 14 + + + 7 + + + 49 + + + 15 + + + + + 49 + + + 13 + + + + + + + 482 + + + 41 + + + 7 + + + + + 35 + + + 35 + + + 49 + + + 49 + + + 7 + + + + + 217 + + + + + 217 + + + + + 242 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 34 + + + 34 + + + + + 242 + + + 13 + + + + + 52 + + + 7 + + + + + 52 + + + 7 + + + + + 44 + + + 13 + + + + + + + 358 + + + 41 + + + 7 + + + + + 49 + + + 41 + + + 35 + + + 7 + + + + + 229 + + + 13 + + + + + 34 + + + 46 + + + + + 182 + + + 13 + + + + + 182 + + + 13 + + + + + 52 + + + 7 + + + + + 43 + + + 13 + + + + + + + 146 + + + 48 + + + 10 + + + 10 + + + 33 + + + 33 + + + 33 + + + 33 + + + 9 + + + 7 + + + + + 196 + + + 9 + + + + + 197 + + + 9 + + + + + 157 + + + + + 38 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 10 + + + 10 + + + 57 + + + 33 + + + 7 + + + + + 38 + + + 13 + + + + + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 44 + + + 458 + + + 7 + + + + + 318 + + + 21 + + + 13 + + + + + 246 + + + 13 + + + + + 288 + + + 9 + + + + + 199 + + + 9 + + + + + 309 + + + 17 + + + 9 + + + + + 200 + + + 9 + + + + + 435 + + + 9 + + + 9 + + + 9 + + + + + 14 + + + 7 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 49 + + + 17 + + + 7 + + + + + 29 + + + 16 + + + 90 + + + 33 + + + 10 + + + 41 + + + 33 + + + 26 + + + 33 + + + 61 + + + 33 + + + 370 + + + 7 + + + + + 257 + + + 9 + + + + + 316 + + + 9 + + + + + 291 + + + 9 + + + + + 457 + + + 9 + + + + + 312 + + + 9 + + + + + 336 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 48 + + + 7 + + + + + + + 33 + + + 53 + + + 76 + + + 7 + + + + + 424 + + + 17 + + + 10 + + + 9 + + + 13 + + + + + + + 9 + + + 24 + + + 40 + + + 9 + + + + + 42 + + + 42 + + + 10 + + + 17 + + + 20 + + + 24 + + + 15 + + + 18 + + + 10 + + + 10 + + + 26 + + + 29 + + + 53 + + + 14 + + + 2 + + + 16 + + + 15 + + + 5 + + + 12 + + + 13 + + + 8 + + + 17 + + + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 41 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 41 + + + 41 + + + 33 + + + 33 + + + 41 + + + 33 + + + 41 + + + 33 + + + 33 + + + 33 + + + 41 + + + 33 + + + 33 + + + 33 + + + 41 + + + 33 + + + 41 + + + 41 + + + 41 + + + 41 + + + 41 + + + 41 + + + 41 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 41 + + + 41 + + + 41 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 247 + + + 187 + + + 45 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 335 + + + 9 + + + 9 + + + + + 740 + + + 9 + + + 9 + + + 9 + + + 17 + + + + + 1090 + + + 9 + + + 9 + + + 19 + + + 9 + + + 19 + + + + + 421 + + + 9 + + + 13 + + + + + 428 + + + 9 + + + + + 257 + + + 10 + + + + + 385 + + + 9 + + + + + 670 + + + 9 + + + 10 + + + + + 1209 + + + 9 + + + 9 + + + 10 + + + 9 + + + 10 + + + 9 + + + 25 + + + + + 223 + + + 9 + + + + + 273 + + + 17 + + + + + 364 + + + 9 + + + 9 + + + + + 435 + + + 17 + + + 10 + + + 10 + + + + + 507 + + + + + 1082 + + + 14 + + + 17 + + + 17 + + + 14 + + + 17 + + + 14 + + + + + 809 + + + 14 + + + 17 + + + 20 + + + 17 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 33 + + + + + 298 + + + 13 + + + + + 430 + + + 13 + + + 17 + + + 10 + + + 9 + + + + + 267 + + + 13 + + + 17 + + + + + 237 + + + 13 + + + 10 + + + + + 234 + + + 13 + + + 9 + + + + + 250 + + + 13 + + + + + 246 + + + 13 + + + 15 + + + + + 233 + + + 13 + + + + + 358 + + + 13 + + + 9 + + + 13 + + + + + 364 + + + 13 + + + 17 + + + 9 + + + + + 197 + + + 13 + + + 9 + + + + + 329 + + + 13 + + + 9 + + + 9 + + + + + 347 + + + 13 + + + 9 + + + 9 + + + + + 243 + + + 13 + + + 9 + + + + + 271 + + + 13 + + + 11 + + + 9 + + + + + 260 + + + 13 + + + + + 535 + + + 13 + + + 9 + + + 9 + + + + + 225 + + + 13 + + + 9 + + + + + 335 + + + 13 + + + 9 + + + 9 + + + + + 402 + + + 13 + + + 9 + + + + + 442 + + + 13 + + + 10 + + + + + 548 + + + 13 + + + 10 + + + + + 544 + + + 13 + + + 10 + + + 9 + + + 10 + + + + + 295 + + + 13 + + + + + 233 + + + 13 + + + 13 + + + + + 233 + + + 13 + + + 14 + + + + + 391 + + + 13 + + + 13 + + + 13 + + + + + 299 + + + 13 + + + 13 + + + + + 390 + + + 13 + + + 13 + + + 13 + + + + + 260 + + + 13 + + + 10 + + + + + 348 + + + 13 + + + 10 + + + 13 + + + + + 1026 + + + 13 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + 739 + + + 13 + + + 13 + + + 13 + + + 10 + + + 10 + + + + + 240 + + + 13 + + + 9 + + + + + 355 + + + 13 + + + 9 + + + 9 + + + + + 246 + + + 13 + + + 9 + + + + + 427 + + + 13 + + + 9 + + + 9 + + + + + 264 + + + 13 + + + 25 + + + + + 266 + + + 13 + + + 9 + + + + + 222 + + + 13 + + + 9 + + + + + 295 + + + 13 + + + 9 + + + + + 645 + + + 13 + + + 10 + + + 9 + + + 9 + + + + + 455 + + + 13 + + + 13 + + + 13 + + + 9 + + + + + 233 + + + 13 + + + 9 + + + + + 354 + + + 13 + + + + + 369 + + + 13 + + + 9 + + + + + 348 + + + 13 + + + 9 + + + 9 + + + + + 9 + + + + + 25 + + + 7 + + + + + 24 + + + 24 + + + 24 + + + 7 + + + + + 25 + + + 7 + + + + + 23 + + + 9 + + + 7 + + + + + 25 + + + 7 + + + + + 25 + + + 7 + + + + + 25 + + + 7 + + + + + 25 + + + 7 + + + + + 14 + + + 7 + + + + + + + 33 + + + 214 + + + 33 + + + 7 + + + + + 213 + + + 9 + + + + + 223 + + + 9 + + + + + 13 + + + + + 13 + + + + + + + 14 + + + 8 + + + 9 + + + 9 + + + + + 33 + + + 82 + + + 7 + + + + + 294 + + + 10 + + + 13 + + + + + + + 14 + + + 7 + + + + + 33 + + + 33 + + + 33 + + + 247 + + + 187 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 335 + + + 13 + + + 13 + + + + + 766 + + + 13 + + + 13 + + + 13 + + + 13 + + + 13 + + + + + 320 + + + 13 + + + 36 + + + + + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 33 + + + 223 + + + 187 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 198 + + + 7 + + + + + 190 + + + 7 + + + + + 197 + + + 33 + + + + + 229 + + + 9 + + + + + 278 + + + 7 + + + + + 232 + + + 7 + + + + + 194 + + + 7 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 33 + + + 33 + + + 33 + + + 203 + + + 7 + + + + + 268 + + + + + 321 + + + + + 268 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + 14 + + + 7 + + + + + 7 + + + + + 26 + + + 7 + + + + + 14 + + + 7 + + + + + + + 35 + + + 96 + + + 29 + + + 7 + + + 12 + + + + + 218 + + + 13 + + + + + 29 + + + 7 + + + + + + + 7 + + + + + 33 + + + 33 + + + 33 + + + 33 + + + 183 + + + 187 + + + 20 + + + 15 + + + 15 + + + 12 + + + 7 + + + + + 492 + + + 13 + + + 9 + + + + + 1229 + + + 13 + + + 9 + + + + + 344 + + + 13 + + + 13 + + + + + 596 + + + 13 + + + 13 + + + + + + + 14 + + + 7 + + + + + 8 + + + 10 + + + 10 + + + 33 + + + 58 + + + 7 + + + + + 604 + + + 13 + + + + + + + 33 + + + 33 + + + 10 + + + 7 + + + + + 7 + + + + + 8 + + + + + 10 + + + + + 8 + + + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 38 + + + + + 37 + + + + + 35 + + + + + 285 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 22 + + + 22 + + + 36 + + + 24 + + + + + 33 + + + 170 + + + 7 + + + + + 197 + + + 13 + + + 21 + + + + + 15 + + + + + + + 46 + + + 9 + + + + + 80 + + + 7 + + + + + 275 + + + 10 + + + 13 + + + + + + + 66 + + + 2 + + + 9 + + + 7 + + + + + 15 + + + 7 + + + + + + + 27 + + + 41 + + + 95 + + + 47 + + + 9 + + + 7 + + + + + 169 + + + 13 + + + + + + + 33 + + + 31 + + + 7 + + + + + 196 + + + 10 + + + 13 + + + + + + + 33 + + + 12 + + + 7 + + + + + 282 + + + 10 + + + 13 + + + + + + + 33 + + + 20 + + + 7 + + + + + 331 + + + 13 + + + + + + + 37 + + + 23 + + + 214 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 138 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 137 + + + 15 + + + 6 + + + 7 + + + + + 41 + + + 7 + + + + + 183 + + + 13 + + + + + 41 + + + 7 + + + + + 183 + + + 13 + + + + + + + 41 + + + 49 + + + 68 + + + 7 + + + + + 354 + + + 13 + + + + + 469 + + + 13 + + + + + 7 + + + + + 14 + + + 26 + + + 7 + + + + + 20 + + + 7 + + + + + + + 33 + + + 33 + + + 33 + + + 274 + + + 7 + + + + + 160 + + + 13 + + + + + 159 + + + 13 + + + + + 160 + + + 13 + + + + + 14 + + + 14 + + + 32 + + + 7 + + + + + + + 15 + + + 14 + + + 8 + + + 7 + + + + + 7 + + + 7 + + + 49 + + + 49 + + + 15 + + + 8 + + + 14 + + + 7 + + + + + 76 + + + 7 + + + + + 177 + + + 13 + + + + + 191 + + + 13 + + + + + + + 41 + + + 41 + + + 66 + + + 7 + + + + + 186 + + + 13 + + + + + 59 + + + 13 + + + + + + + 33 + + + 178 + + + 33 + + + 24 + + + 7 + + + + + 165 + + + 13 + + + + + 162 + + + 13 + + + + + + + 15 + + + 41 + + + 44 + + + 7 + + + + + 176 + + + 13 + + + + + + + 20 + + + 20 + + + 18 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + + + 11 + + + 10 + + + 10 + + + 11 + + + 2 + + + 7 + + + + + 11 + + + 7 + + + + + 11 + + + 7 + + + + + 10 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + 10 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 2 + + + 2 + + + 8 + + + 8 + + + + + 18 + + + 7 + + + + + + + 10 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 10 + + + 7 + + + + + 7 + + + + + 15 + + + 15 + + + 2 + + + 10 + + + 2 + + + 2 + + + 8 + + + 8 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + 7 + + + + + 7 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 8 + + + 8 + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 0 + + + 7 + + + + + 0 + + + 7 + + + + + 0 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 14 + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 8 + + + 8 + + + + + 8 + + + + + 8 + + + + + 8 + + + + + 2 + + + 7 + + + + + + + 8 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 8 + + + + + 15 + + + + + 24 + + + + + 16 + + + + + 9 + + + 8 + + + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + 7 + + + 8 + + + + + 9 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 23 + + + + + 24 + + + + + 2 + + + 7 + + + + + + + 6 + + + 12 + + + 19 + + + 7 + + + + + + + 2 + + + 17 + + + 19 + + + 26 + + + 12 + + + 22 + + + 7 + + + + + + + 7 + + + 10 + + + 12 + + + 7 + + + + + + + 1 + + + 1 + + + 2 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + 42 + + + 42 + + + + + + + 8 + + + 10 + + + 2 + + + 13 + + + 7 + + + 7 + + + + + + + 2 + + + + + 2 + + + 27 + + + 50 + + + 18 + + + 7 + + + 31 + + + 58 + + + 53 + + + 31 + + + 30 + + + 62 + + + 58 + + + 208 + + + 60 + + + 10 + + + 24 + + + 10 + + + 19 + + + + + 24 + + + + + 33 + + + 15 + + + 31 + + + 56 + + + 61 + + + 38 + + + 78 + + + + + + + 2 + + + 7 + + + + + + + 2 + + + 23 + + + 23 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 72 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 26 + + + 1 + + + 6 + + + 7 + + + + + + + 2 + + + 32 + + + 32 + + + 32 + + + 28 + + + 6 + + + 7 + + + 7 + + + 7 + + + + + 14 + + + 7 + + + + + + + 29 + + + 8 + + + 7 + + + + + + + 2 + + + 34 + + + 28 + + + 7 + + + + + + + 2 + + + 76 + + + 51 + + + 7 + + + + + + + 42 + + + 42 + + + 2 + + + 17 + + + 169 + + + 91 + + + 130 + + + 485 + + + 10 + + + 7 + + + + + 0 + + + 0 + + + + + + + 2 + + + 27 + + + 48 + + + 33 + + + 48 + + + 33 + + + 2 + + + 9 + + + 7 + + + + + 156 + + + + + 163 + + + + + 1229 + + + 9 + + + + + 13 + + + + + 13 + + + + + 13 + + + + + + + 2 + + + + + 2 + + + 7 + + + + + + + 23 + + + 2 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 26 + + + 13 + + + 150 + + + 57 + + + 6 + + + 7 + + + + + + + 10 + + + 7 + + + + + 30 + + + 7 + + + 2 + + + 14 + + + 7 + + + + + 14 + + + 19 + + + 14 + + + 40 + + + 82 + + + 15 + + + 6 + + + 7 + + + + + + + 14 + + + 14 + + + 13 + + + 44 + + + 10 + + + 10 + + + 10 + + + 2 + + + 13 + + + 7 + + + + + + + 14 + + + 23 + + + 2 + + + 7 + + + + + + + 2 + + + 7 + + + + + + + 92 + + + 7 + + + + + + + 92 + + + 7 + + + + + + + 92 + + + 7 + + + + + + + 92 + + + 7 + + + + + + + 22 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 7 + + + + + 28 + + + 7 + + + + + + + 82 + + + 7 + + + + + + + 16 + + + 7 + + + + + + + 15 + + + 23 + + + 199 + + + 7 + + + + + 14 + + + 14 + + + 149 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 149 + + + 15 + + + 6 + + + 7 + + + + + + + 15 + + + 103 + + + 7 + + + + + 14 + + + 14 + + + 196 + + + 15 + + + 6 + + + 7 + + + + + + + 37 + + + 37 + + + 275 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 159 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 246 + + + 15 + + + 6 + + + 7 + + + + + + + 51 + + + 104 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 130 + + + 15 + + + 6 + + + 7 + + + + + + + 23 + + + 119 + + + 7 + + + + + 20 + + + 27 + + + 15 + + + 27 + + + + + 32 + + + 39 + + + 9 + + + 16 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 191 + + + 15 + + + 6 + + + 7 + + + + + + + 49 + + + 37 + + + + + 37 + + + 37 + + + 449 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 198 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 159 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 154 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 159 + + + 15 + + + 6 + + + 7 + + + + + + + 37 + + + 7 + + + + + 464 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 264 + + + 107 + + + 6 + + + 7 + + + 13 + + + 13 + + + 13 + + + + + + + 9 + + + 15 + + + + + 51 + + + 210 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 377 + + + 93 + + + 6 + + + 7 + + + 23 + + + + + + + 22 + + + 154 + + + + + 282 + + + 7 + + + + + 14 + + + 14 + + + 693 + + + 103 + + + 6 + + + 7 + + + + + + + 15 + + + 2 + + + 37 + + + 2 + + + 211 + + + 7 + + + + + 14 + + + 14 + + + 149 + + + 15 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 168 + + + 15 + + + 6 + + + 7 + + + + + + + 42 + + + 42 + + + 22 + + + 12 + + + 40 + + + 7 + + + + + 14 + + + 14 + + + 131 + + + 15 + + + 6 + + + 7 + + + + + + + 30 + + + 2 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 190 + + + 57 + + + 6 + + + 7 + + + 20 + + + + + + + 2 + + + 23 + + + 7 + + + 11 + + + + + 10 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 27 + + + 1 + + + 6 + + + 7 + + + + + + + 42 + + + 23 + + + 69 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 98 + + + 15 + + + 6 + + + 7 + + + + + + + 22 + + + 12 + + + 180 + + + 7 + + + + + 14 + + + 14 + + + 142 + + + 15 + + + 6 + + + 7 + + + + + + + 23 + + + 78 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 38 + + + 1 + + + 6 + + + 7 + + + + + + + 23 + + + 62 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 168 + + + 15 + + + 6 + + + 7 + + + + + + + 37 + + + 7 + + + + + 127 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 214 + + + 15 + + + 6 + + + 7 + + + + + + + 68 + + + 15 + + + 7 + + + + + 14 + + + 14 + + + 84 + + + 15 + + + 6 + + + 7 + + + + + + + 22 + + + 70 + + + + + 8 + + + 7 + + + + + 14 + + + 14 + + + 93 + + + 15 + + + 6 + + + 7 + + + + + + + 37 + + + 138 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 14 + + + 14 + + + 14 + + + 40 + + + 242 + + + 15 + + + 6 + + + 7 + + + + + 28 + + + 7 + + + + + + + 68 + + + 15 + + + 7 + + + + + 14 + + + 14 + + + 207 + + + 83 + + + 6 + + + 7 + + + + + + + 23 + + + 28 + + + 141 + + + 7 + + + 12 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 117 + + + 15 + + + 6 + + + 7 + + + + + 29 + + + 7 + + + + + + + 2 + + + 8 + + + + + 8 + + + 23 + + + 68 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 75 + + + 1 + + + 6 + + + 7 + + + + + 44 + + + 7 + + + + + + + 51 + + + 10 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 52 + + + 101 + + + 15 + + + 6 + + + 7 + + + + + + + 9 + + + 14 + + + 8 + + + + + 12 + + + 13 + + + + + 8 + + + + + 2 + + + 61 + + + 7 + + + + + + + 30 + + + 36 + + + 7 + + + + + 16 + + + + + 10 + + + 34 + + + 38 + + + 334 + + + 7 + + + + + + + 11 + + + 31 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 41 + + + 23 + + + 9 + + + 311 + + + 7 + + + + + + + 10 + + + 10 + + + 7 + + + + + 10 + + + 10 + + + 7 + + + + + 131 + + + 7 + + + + + + + 38 + + + 10 + + + 10 + + + 10 + + + 7 + + + + + + + 97 + + + 34 + + + 7 + + + + + + + 7 + + + 7 + + + + + 7 + + + 8 + + + + + 14 + + + 14 + + + 7 + + + + + 47 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 21 + + + 16 + + + 19 + + + + + 10 + + + 10 + + + 7 + + + + + 60 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 14 + + + 7 + + + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 7 + + + + + 80 + + + 7 + + + + + + + 15 + + + 7 + + + + + 67 + + + 7 + + + + + + + 15 + + + 7 + + + + + 15 + + + + + 22 + + + 7 + + + + + + + 7 + + + 15 + + + + + 15 + + + + + 96 + + + 7 + + + + + + + 14 + + + + + 93 + + + 74 + + + 7 + + + + + + + 23 + + + 7 + + + + + 112 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 76 + + + 15 + + + 6 + + + 7 + + + + + + + 10 + + + 10 + + + 2 + + + 7 + + + + + + + 7 + + + + + 7 + + + + + 4 + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + 23 + + + 23 + + + 23 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 37 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 37 + + + 1 + + + 6 + + + 7 + + + + + 14 + + + 14 + + + 14 + + + 26 + + + 37 + + + 1 + + + 6 + + + 7 + + + + + + + 23 + + + 11 + + + + + 10 + + + 10 + + + 2 + + + 7 + + + + + + + 58 + + + 2 + + + 7 + + + + + + + 2 + + + 18 + + + + + + + 8 + + + + + 10 + + + + + + + 7 + + + 7 + + + + + 7 + + + 7 + + + + + 56 + + + 7 + + + + + + + 43 + + + 7 + + + 7 + + + + + 13 + + + 42 + + + 42 + + + 7 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 2 + + + 2 + + + 7 + + + + + + + 10 + + + 7 + + + + + + + 16 + + + 16 + + + 15 + + + 70 + + + 7 + + + + + + + 2 + + + 2 + + + 7 + + + + + + + 15 + + + 16 + + + 7 + + + + + + + 2 + + + 7 + + + + + 2 + + + 7 + + + + + 116 + + + 7 + + + + + + + 10 + + + 7 + + + + + + + 7 + + + + + 2 + + + 7 + + + + + + + 2 + + + + + 2 + + + + + + + 70 + + + 7 + + + + + + + 10 + + + 15 + + + + + 164 + + + 7 + + + + + 10 + + + 15 + + + + + + + 201 + + + 7 + + + + + + + 13 + + + 15 + + + + + 72 + + + 7 + + + + + + + 68 + + + 7 + + + + + + + 2 + + + 51 + + + 7 + + + + + 7 + + + + + + + 2 + + + 11 + + + + + + + 20 + + + 7 + + + + + + + 2 + + + 8 + + + 7 + + + \ No newline at end of file diff --git a/mcs/tools/compiler-tester/compiler-tester.cs b/mcs/tools/compiler-tester/compiler-tester.cs index 2402b6019a0..d0a7b06f0d5 100644 --- a/mcs/tools/compiler-tester/compiler-tester.cs +++ b/mcs/tools/compiler-tester/compiler-tester.cs @@ -935,6 +935,7 @@ namespace TestRunner { writer.WriteStartElement ("entry"); writer.WriteAttributeString ("il", IntToHex (entry.Offset)); writer.WriteAttributeString ("row", entry.Row.ToString ()); + writer.WriteAttributeString ("col", entry.Column.ToString ()); writer.WriteAttributeString ("file_ref", entry.File.ToString ()); writer.WriteAttributeString ("hidden", BoolToString (entry.IsHidden)); writer.WriteEndElement (); @@ -1418,18 +1419,13 @@ namespace TestRunner { try { Console.WriteLine ("Loading " + compiler + " ..."); tester = new ReflectionTester (Assembly.LoadFile (compiler)); - } - catch (Exception) { -#if NET_2_1 - throw; -#else + } catch (Exception) { Console.Error.WriteLine ("Switching to command line mode (compiler entry point was not found)"); if (!File.Exists (compiler)) { Console.Error.WriteLine ("ERROR: Tested compiler was not found"); return 1; } tester = new ProcessTester (compiler); -#endif } string mode; diff --git a/mcs/tools/csharp/csharp.csproj b/mcs/tools/csharp/csharp.csproj index a1193b60b8c..c046e20c0f0 100755 --- a/mcs/tools/csharp/csharp.csproj +++ b/mcs/tools/csharp/csharp.csproj @@ -92,9 +92,6 @@ true - - - - - Azorene - - - Lisboa - - - - Eastern European Standard Time - Eastern European Daylight Time - - - EET - EEST - - Bucuresti - - - Moskva - - - - - - , -   - - - - - #,##0 % - - - - - - Andorranske pesetas - - - UAE dirham - - - Afghani (1927-2002) - - - Afghani - Af - - - Albanske lek - lek - - - Armenske dram - dram - - - Nederlandske antillegylden - NA f. - - - Angolanske kwanza - - - Angolanske kwanza (1977-1990) - - - Angolanske ny kwanza (1990-2000) - - - Angolan Kwanza Reajustado (1995-1999) - - - Argentinske australer - - - Argentinske pesos (1983-1985) - - - Argentinske pesos - Arg$ - - - Østerrikske shilling - - - Australske dollar - $A - - - Arubiske gylden - - - Aserbajdsjanske Manat - - - Bosnia-Hercegovina dinarer - - - Bosnia-Hercegovina mark (konvertible) - KM - - - Barbadisk dollar - BDS$ - - - Bangladeshiske taka - Tk - - - Belgiske franc (konvertible) - - - Belgiske franc - BF - - - Belgiske franc (økonomiske) - - - Bulgarske lev (hard) - lev - - - Bulgarske lev - - - Bahrainske dinarer - BD - - - Burundiske franc - Fbu - - - Bermudiske dollar - Ber$ - - - Bruneiske dollar - - - Boliviano - Bs - - - Boliviansk pesos - - - Boliviansk mvdol - - - Brasiliansk cruzeiro novo (1967-1986) - - - Brasilianske cruzado - - - Brasilianske cruzeiro (1990-1993) - - - Brasilianske realer - R$ - - - Brasilianske cruzado novo - - - Brasilianske cruzeiro - - - Bahamske dollar - - - Bhutanske ngultrum - Nu - - - Burmesiske kyat - - - Botswanske pula - - - Hviterussiske nye rubler (1994-1999) - - - Hviterussiske rubler - Rbl - - - Beliziske dollar - BZ$ - - - Kanadiske dollar - Can$ - - - Kongolesiske franc (congolais) - - - Sveitsiske franc - SwF - - - Chilenske Unidades de Fomento - - - Chilenske pesos - Ch$ - - - Kinesiske Yuan Renminbi - Y - - - Colombianske pesos - Col$ - - - Costaricanske colon - C - - - Tsjekkoslovakiske koruna (hard) - - - Kubanske pesos - - - Kappverdiske escudo - CVEsc - - - Kypriotiske pund - £C - - - Tsjekkiske koruna - - - Østtyske ostmark - - - Tyske mark - - - Djiboutiske franc - DF - - - Danske kroner - DKr - - - Dominikanske pesos - RD$ - - - Algeriske dinarer - DA - - - Ecuadorianske sucre - - - Ecuadorianske Unidad de Valor Constante (UVC) - - - Estiske kroon - - - Egyptiske pund - - - Eritreiske nakfa - - - Spanske peseta - - - Etiopiske birr - Br - - - Euro - - - Finske mark - - - Fijianske dollar - F$ - - - Falklandsøyene-pund - - - Franske franc - - - Britiske pund sterling - - - Georgiske kupon larit - - - Georgiske lari - lari - - - Ghanesiske cedi - - - Gibraltarske pund - - - Gambiske dalasi - - - Guineanske franc - GF - - - Guineanske syli - - - Ekvatorialguineanske ekwele guineana - - - Greske drakmer - - - Guatemalanske quetzal - Q - - - Portugisiske guinea escudo - - - Guinea-Bissau-pesos - - - Guyanske dollar - G$ - - - Hongkong-dollar - HK$ - - - Hoduras Lempira - L - - - Kroatiske dinarer - - - Kroatiske kuna - - - Haitiske gourde - - - Ungarske forinter - Ft - - - Indonesiske rupier - Rp - - - Irske pund - IR£ - - - Israelske pund - - - Israelske nye shekler - - - Indiske rupier - - - Irakske dinarer - ID - - - Iranske rialer - RI - - - Islandske kronar - - - Italienske lire - - - Jamaikanske dollar - J$ - - - Jordanske dinarer - JD - - - Japanske yen - - - Kenyanske shilling - K Sh - - - Kirgisiske som - som - - - Kambodsjanske riel - CR - - - Komoriske franc - CF - - - Nordkoreanske won - - - Sørkoreanske won - - - Kuwaitiske dinarer - KD - - - Caymanske dollar - - - Kasakhstanske tenge - T - - - Laotiske kip - - - Libanesiske pund - LL - - - Srilankiske rupier - SL Re - - - Liberiske dollar - - - Lesothiske loti - M - - - Litauiske lita - - - Litauiske talonas - - - Luxemburgske franc - - - Latviske lats - - - Latviske rubler - - - Libyske dinarer - LD - - - Marokkanske dirham - - - Marokkanske franc - - - Moldovske leu - - - Madagassiske ariary - - - Madagassiske franc - - - Makedonske denarer - MDen - - - Maliske franc - - - Myanmarske kyat - - - Mongolske tugrik - Tug - - - Makaoske pataca - - - Mauritanske ouguiya - UM - - - Maltesiske lira - Lm - - - Maltesiske pund - - - Mauritiske rupier - - - Maldiviske rufiyaa - - - Malawisle kwacha - MK - - - Meksikanske pesos - MEX$ - - - Meksikanske sølvpesos (1861-1992) - - - Meksikanske Unidad de Inversion (UDI) - - - Malaysiske ringgit - RM - - - Mosambikiske escudo - - - Mosambikiske metical - Mt - - - Namibiske dollar - N$ - - - Nigerianske naira - - - Nicaraguanske cordoba - - - Nicaraguanske cordoba oro - - - Nederlandske gylden - - - Norske kroner - kr - - - Nepalesiske rupier - Nrs - - - Nyzealandske dollar - $NZ - - - Omanske rialer - RO - - - Panamanske balboa - - - Peruvianske inti - - - Peruvianske sol nuevo - - - Peruvianske sol - - - Papuanske kina - - - Filippinske pesos - - - Pakistanske rupier - Pra - - - Polske zloty - Zl - - - Polske zloty (1950-1995) - - - Portugisiske escudo - - - Paraguayanske guarani - - - Qatarske riyaler - QR - - - Rumenske leu - leu - - - Russiske rubler - - - Russiske rubler (1991-1998) - - - Rwandiske franc - - - Saudiarabiske riyaler - SRl - - - Salomonske dollar - SI$ - - - Seychelliske rupier - SR - - - Sudanesiske dinarer - - - Sudanesiske pund - - - Svenske kroner - SKr - - - Singaporske dollar - S$ - - - Sankthelenske pund - - - Slovenske tolar - - - Slovakiske koruna - Sk - - - Sierraleonske leone - - - Somaliske shilling - So. Sh. - - - Surinamske gylden - Sf - - - Sao Tome og Principe-dobra - Db - - - Sovjetiske rubler - - - Salvadoranske colon - - - Syriske pund - LS - - - Swazilandske lilangeni - E - - - Thailandske baht - - - Tadsjikiske rubler - - - Tadsjikiske somoni - - - Turkmenske manat - - - Tunisiske dinarer - - - Tonganske paʻanga - T$ - - - Timoresiske escudo - - - Tyrkiske lira - TL - - - Ny tyrkisk lire - - - Trinidadiske dollar - TT$ - - - Taiwanske nye dollar - NT$ - - - Tanzanianske shilling - T Sh - - - Ukrainsle hryvnia - - - Ukrainske karbovanetz - - - Ugandiske shilling (1966-1987) - - - Ugandiske shilling - U Sh - - - Amerikanske dollar - US$ - - - Amerikanske dollar (neste dag) - - - Amerikanske dollar (samme dag) - - - Uruguayanske pesos (1975-1993) - - - Uruguayanske peso uruguayo - Ur$ - - - Usbekiske sum - - - Venezuelanske bolivar - Be - - - Vietnamesiske dong - - - Vanuatisk vatu - VT - - - Vestsamoisk tala - - - CFA Franc BEAC - - - Gull - - - European Composite Unit - - - European Monetary Unit - - - European Unit of Account (XBC) - - - European Unit of Account (XBD) - - - Østkaribiske dollar - EC$ - - - Special Drawing Rights - - - European Currency Unit - - - French Gold Franc - - - French UIC-Franc - - - CFA Franc BCEAO - - - CFP Franc - CFPF - - - Jemenittiske dinarer - - - Jemenittiske rialer - YRl - - - Jugoslaviske dinarer (hard) - - - Jugoslaviske noviy-dinarer - - - Jugoslaviske konvertible dinarer - - - Sørafrikanske rand (økonomisk) - - - Sørafrikanske rand - R - - - Zambiske kwacha - - - Zairiske nye zaire - - - Zairiske zaire - - - Zimbabwiske dollar - Z$ - - - - - Vinje, Finn-Erik, Skriveregler (1994) - - - - diff --git a/tools/locale-builder/langs/nn.xml b/tools/locale-builder/langs/nn.xml deleted file mode 100644 index 658af6e9bf7..00000000000 --- a/tools/locale-builder/langs/nn.xml +++ /dev/null @@ -1,560 +0,0 @@ - - - - - - - - - - - Arabisk - Tysk - Engelsk - Spansk - Fransk - Italiensk - Japansk - norsk bokmål - norsk nynorsk - norsk - Portugisisk - Russisk - Kinesisk - - - - - - Verden - Afrika - Sør-Amerika - Oseania - Vest-Afrika - Sentral-Amerika - Aust-Afrika - Nord-Afrika - Sentral-Afrika - Sørlege Afrika - Amerika - Nord-Amerika - Karibiske hav - Aust-Asia - Søraust-Asia - Sør-Europa - Australia og New Zealand - Melanesia - Mikronesia - Polynesia - Sørlege Sentral-Asia - Asia - Vest-Asia - Europa - Aust-Europa - Nord-Europa - Vest-Europa - Kanaløyene - Man - Andorra - De forente arabiske emiratene - Afghanistan - Antigua og Barbuda - Anguilla - Albania - Armenia - De nederlandske antiller - Angola - Antarktis - Argentina - Amerikansk Samoa - Østerrike - Australia - Aruba - Åland - Aserbajdsjan - Bosnia og Hercegovina - Barbados - Bangladesh - Belgia - Burkina Faso - Bulgaria - Bahrain - Burundi - Benin - Bermuda - Brunei Darussalam - Bolivia - Brasil - Bahamas - Bhutan - Bouvetøya - Botswana - Hviterussland - Belize - Canada - Kokosøyene (Keelingøyene) - Kongo, Den demokratiske republikken - Den sentralafrikanske republikk - Kongo - Sveits - Elfenbenskysten - Cookøyene - Chile - Kamerun - Kina - Colombia - Costa Rica - Serbia Montenegro - Cuba - Kapp Verde - Christmasøya - Kypros - Tsjekkia - Tyskland - Djibouti - Danmark - Dominica - Den dominikanske republikk - Algerie - Ecuador - Estland - Egypt - Vest-Sahara - Eritrea - Spania - Etiopia - Finland - Fiji - Falklandsøyene (Malvinas) - Mikronesiaføderasjonen - Færøyene - Frankrike - Gabon - Storbritannia - Grenada - Georgia - Fransk Guyana - Ghana - Gibraltar - Grønland - Gambia - Guinea - Guadeloupe - Ekvatorial-Guinea - Hellas - Sør-Georgia og Sør-Sandwich-øyene - Guatemala - Guam - Guinea-Bissau - Guyana - Hong Kong S.A.R. (Kina) - Heard- og McDonaldsøyene - Honduras - Kroatia - Haiti - Ungarn - Indonesia - Irland - Israel - India - Britiske områder i det indiske hav - Irak - Iran - Island - Italia - Jamaica - Jordan - Japan - Kenya - Kirgisistan - Kambodsja - Kiribati - Komorene - St. Christopher og Nevis - Nord-Korea - Sør-Korea - Kuwait - Caymanøyene - Kasakhstan - Laos, Den folkedemokratiske republikken - Libanon - St. Lucia - Liechtenstein - Sri Lanka - Liberia - Lesotho - Litauen - Luxembourg - Latvia - Libya - Marokko - Monaco - Moldova - Madagaskar - Marshalløyene - Makedonia, Republikken - Mali - Myanmar - Mongolia - Macao S.A.R. (Kina) - Nord-Marianene - Martinique - Mauritania - Montserrat - Malta - Mauritius - Maldivene - Malawi - Mexico - Malaysia - Mosambik - Namibia - Ny-Caledonia - Niger - Norfolkøyene - Nigeria - Nicaragua - Nederland - Noreg - Nepal - Nauru - Niue - New Zealand - Oman - Panama - Peru - Fransk Polynesia - Papua Ny-Guinea - Filippinene - Pakistan - Polen - St. Pierre og Miquelon - Pitcairn - Puerto Rico - Palestinsk territorium - Portugal - Palau - Paraguay - Qatar - Ytre Oseania - Reunion - Romania - Den russiske føderasjon - Rwanda - Saudi Arabia - Salomonøyene - Seychellene - Sudan - Sverige - Singapore - Saint Helena - Slovenia - Svalbard og Jan Mayen - Slovakia - Sierra Leone - San Marino - Senegal - Somalia - Surinam - Sao Tome og Principe - El Salvador - Syria - Swaziland - Turks- og Caicosøyene - Tchad - Franske sørområder - Togo - Thailand - Tadsjikistan - Tokelau - Øst-Timor - Turkmenistan - Tunisia - Tonga - Tyrkia - Trinidad og Tobago - Tuvalu - Taiwan - Tanzania - Ukraina - Uganda - USAs mindre øyer - USA - Uruguay - Usbekistan - Vatikanstaten - St. Vincent og Grenadinene - Venezuela - Jomfruøyene (britisk) - Jomfruøyene (USA) - Vietnam - Vanuatu - Wallis og Futuna - Samoa - Yemen - Mayotte - Sør-Afrika - Zambia - Zimbabwe - - - - [a-zæåøéóôàüǎ] - - - - - - - - jan - jan. - feb - feb. - mar - mars - apr - april - mai - jun - juni - jul - juli - aug - aug. - sep - sep. - okt - okt. - nov - nov. - des - des. - - - januar - februar - mars - april - mai - juni - juli - august - september - oktober - november - desember - - - - - - - su - su. - må - må. - ty - ty. - on - on. - to - to. - fr - fr. - la - la. - - - sundag - måndag - tysdag - onsdag - torsdag - fredag - laurdag - - - - - S - M - T - O - T - F - L - - - - - - - - a.m. - p.m. - - - f.Kr. - e.Kr. - - - - - - EEEE d. MMMM yyyy - - - - - d. MMMM yyyy - - - - - d. MMM. yyyy - - - - - dd.MM.yy - - - - - - - 'kl. 'HH.mm.ss z - - - - - HH.mm.ss z - - - - - HH.mm.ss - - - - - HH.mm - - - - - - - +HH.mm;-HH.mm - - - Sørpolen - - - - Påskeøya - - - - Kanariøyene - - - - Godthåb - - - - Ulan Bator - - - - Mexico by - - - - Azorene - - - Lisboa - - - - Moskva - - - - Tasjkent - - - - - - , -   - - - - Brasilianske real - - - Kinesiske yuan renminbi - - - Britiske pund - - - Indiske rupi - - - kr - - - Norske kroner - - - Russiske rubler - - - Amerikanske dollar - - - - - Vinje, Finn-Erik, Skriveregler (1994) - - - - diff --git a/tools/locale-builder/lcids.xml b/tools/locale-builder/lcids.xml old mode 100755 new mode 100644 index eddbe6ffb48..6f22bab8681 --- a/tools/locale-builder/lcids.xml +++ b/tools/locale-builder/lcids.xml @@ -1,176 +1,355 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/locale-builder/locale-builder.csproj b/tools/locale-builder/locale-builder.csproj new file mode 100644 index 00000000000..6700ba970b6 --- /dev/null +++ b/tools/locale-builder/locale-builder.csproj @@ -0,0 +1,65 @@ + + + + Debug + x86 + {A57C517C-9795-471D-B510-DD9659096CAB} + Exe + false + ConsoleApplication + v4.0 + + + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x86 + + + Mono.Tools.LocaleBuilder + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/locale-builder/locales/.gitattributes b/tools/locale-builder/locales/.gitattributes deleted file mode 100644 index 46581dfd06f..00000000000 --- a/tools/locale-builder/locales/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/nb_NO.xml -crlf -/nn_NO.xml -crlf diff --git a/tools/locale-builder/locales/.gitignore b/tools/locale-builder/locales/.gitignore deleted file mode 100644 index b878e882aca..00000000000 --- a/tools/locale-builder/locales/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/*.xml diff --git a/tools/locale-builder/locales/ka_GE.xml b/tools/locale-builder/locales/ka_GE.xml deleted file mode 100644 index e2009e99209..00000000000 --- a/tools/locale-builder/locales/ka_GE.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/locale-builder/locales/nb_NO.xml b/tools/locale-builder/locales/nb_NO.xml deleted file mode 100644 index 8e330abb615..00000000000 --- a/tools/locale-builder/locales/nb_NO.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - ’ - ’ - « - » - - - - - - #,##0.00 ¤ - - - - - - diff --git a/tools/locale-builder/locales/nn_NO.xml b/tools/locale-builder/locales/nn_NO.xml deleted file mode 100644 index 598d59997b2..00000000000 --- a/tools/locale-builder/locales/nn_NO.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - ’ - ’ - « - » - - - - - - #,##0.00 ¤ - - - - - - diff --git a/tools/locale-builder/supp/ChangeLog b/tools/locale-builder/supp/ChangeLog deleted file mode 100644 index 28a3ef12a77..00000000000 --- a/tools/locale-builder/supp/ChangeLog +++ /dev/null @@ -1,114 +0,0 @@ -2010-03-23 Geoff Norton - - * da_DK.xml: The short format is day. month, not - day month. Fixes #588165 - -2008-09-18 Atsushi Enomoto - - * sv_SE.xml : fix bug #426942 (sv-SE time format was old). - -2007-10-30 Atsushi Enomoto - - * es_ES.xml : couple of format string fixes for bug #335298. - -2007-05-31 Rolf Bjarne Kvinge - - * en-US.xml: Add a few date/time patterns. - -2006-06-08 Atsushi Enomoto - - * en.xml, en-US.xml : move US-only date patterns from en.xml to - en-US.xml. Fixed bug #78569. - -2005-08-17 Atsushi Enomoto - - * fr.xml : fixed long date pattern and dateTimeFormats. - * ja.xml : fixed long time pattern and dateTimeFormats. - -2005-05-25 Atsushi Enomoto - - * fr.xml : more date pattern. - -2005-05-25 Atsushi Enomoto - - * fr.xml : new file. - -2005-04-23 Atsushi Enomoto - - * ko_KR.xml : fixed time format. - Fixed bug #74701. Patch by Hye-Shik Chang. - -2005-02-17 Atsushi Enomoto - - * en.xml : fixed currency format. - -2004-10-06 Jackson Harper - - * pt.xml: We need a space after R$. Is there a better way to do - this? I should know... - * pt_BR.xml: Fix currency format. - -2004-06-08 Atsushi Enomoto - - * ja.xml : added extra datetime patterns. - * renamed ca.xml to added ca_ES.xml. - * ca_ES.xml, ko_KR.xml, pt_BR.xml : fixed percent patterns. - -2004-06-08 Atsushi Enomoto - - * en.xml : added "all datetime" pattern strings. - * ca.xml, da.xml, el.xml, fi.xml, fr_FR.xml, he.xml, hu.xml, - nl_NL.xml : fixed percent patterns. - -2004-06-05 Atsushi Enomoto - - * en_US.xml : fixed percent pattern. - * en_ZA.xml : fixed NumberDecimalDigits. - * id_ID.xml : fixed CurrencyDecimalDigits. - * ja_JP.xml : added currencySymbol (MS assigns 0x5c). - -2004-06-05 Atsushi Enomoto - - * fr_CH.xml : missing updates. - * Renamed cs.xml as cs_CZ.xml and added number format. - Also renamed lt.xml as lt_LT.xml. They are files' precedence matter. - * es_NI.xml : added. - * en.xml, en_CA.xml, en_IE.xml, en_PH.xml, en_US.xml, en_ZW.xml : - Change with related to the change of NumberDecimalDigits handling. - * es_PR.xml, ja.xml, ko_KR.xml : - Added number format. - -2004-05-27 Atsushi Enomoto - - * en_PH.xml, en_ZW.xml, fr_CA.xml, fr_CH.xml, fr_FR.xml, fr_LU.xml : - fixed incorrect markup. - -2004-05-26 Atsushi Enomoto - - * Added ChangeLog also here (and moved the last msg from ..). - - * af_ZA.xml, ar_SA.xml, be_BY.xml, de_AT.xml, en_AU.xml, en_GB.xml, - en_NZ.xml, es_AR.xml, es_BO.xml, es_CL.xml, es_CO.xml, es_CR.xml, - es_DO.xml, es_EC.xml, es_ES.xml, es_GT.xml, es_HN.xml, es_MX.xml, - es_PA.xml, es_PE.xml, es_PR.xml, es_PY.xml, es_SV.xml, es_UY.xml, - es_VE.xml, eu_ES.xml, - fo_FO.xml, fr_BE.xml, fr_CA.xml, fr_FR.xml, fr_CH.xml, fr_FR.xml, - fr_LU.xml, hi_IN.xml, id_ID.xml, it_CH.xml, it_IT.xml, ko_KR.xml, - nl_BE.xml, nl_NL.xml, pt_BR.xml, pt_PT.xml, sv_FI.xml, sv_SE.xml, - sw_KE.xml, bg.xml, ca.xml, cs.xml, da.xml, de.xml, el.xml, es.xml, - et.xml, fa.xml, fi.xml, he.xml, hr.xml, hu.xml, hy.xml, is.xml, - lt.xml, lv.xml, mk.xml, ro.xml, ru.xml, sk.xml, sl.xml, sq.xml, - tr.xml, uk.xml, vi.xml : - Added shortdate/longtime/am/pm etc. for DateTime.ToString(). - * ar_AE.xml, ar_BH.xml, ar_DZ.xml, ar_EG.xml, ar_JO.xml, ar_KW.xml, - ar_LB.xml, ar_LY.xml, ar_MA.xml, ar_OM.xml, ar_QA.xml, ar_SY.xml, - ar_TN.xml, ar_YE.xml, en_CA.xml, en_IE.xml, en_PH.xml, en_ZA.xml, - en_ZW.xml : - Added shortdate/longtime. - * th.xml : ditto. - * ja.xml : I incorrectly modified long time format. Reverting. - -2004-05-26 Atsushi Enomoto - - * pl.xml, - ja.xml : Added overriding formats. pl.xml fixes bug #58186. diff --git a/tools/locale-builder/supp/af_ZA.xml b/tools/locale-builder/supp/af_ZA.xml deleted file mode 100755 index 1d1b18aacb4..00000000000 --- a/tools/locale-builder/supp/af_ZA.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - yyyy/MM/dd - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/ar.xml b/tools/locale-builder/supp/ar.xml deleted file mode 100644 index 3f0e3f0b8e7..00000000000 --- a/tools/locale-builder/supp/ar.xml +++ /dev/null @@ -1,19 +0,0 @@ - - -%icu; -] -> - - - - - - - - - - - - diff --git a/tools/locale-builder/supp/ar_AE.xml b/tools/locale-builder/supp/ar_AE.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_AE.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_BH.xml b/tools/locale-builder/supp/ar_BH.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_BH.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_DZ.xml b/tools/locale-builder/supp/ar_DZ.xml deleted file mode 100644 index bbb9e19bda9..00000000000 --- a/tools/locale-builder/supp/ar_DZ.xml +++ /dev/null @@ -1,36 +0,0 @@ - - -%icu; -] -> - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - H:mm:ss - - - - - - - - - - diff --git a/tools/locale-builder/supp/ar_EG.xml b/tools/locale-builder/supp/ar_EG.xml deleted file mode 100644 index 2a0f8bbe9c6..00000000000 --- a/tools/locale-builder/supp/ar_EG.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_IQ.xml b/tools/locale-builder/supp/ar_IQ.xml deleted file mode 100644 index e348fc6c7a9..00000000000 --- a/tools/locale-builder/supp/ar_IQ.xml +++ /dev/null @@ -1,20 +0,0 @@ - - -%icu; -] -> - - - - - - - - - - - - - diff --git a/tools/locale-builder/supp/ar_JO.xml b/tools/locale-builder/supp/ar_JO.xml deleted file mode 100644 index 952f8414928..00000000000 --- a/tools/locale-builder/supp/ar_JO.xml +++ /dev/null @@ -1,32 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - - diff --git a/tools/locale-builder/supp/ar_KW.xml b/tools/locale-builder/supp/ar_KW.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_KW.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_LB.xml b/tools/locale-builder/supp/ar_LB.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_LB.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_LY.xml b/tools/locale-builder/supp/ar_LY.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_LY.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_MA.xml b/tools/locale-builder/supp/ar_MA.xml deleted file mode 100644 index 04045449852..00000000000 --- a/tools/locale-builder/supp/ar_MA.xml +++ /dev/null @@ -1,34 +0,0 @@ - - -%icu; -] -> - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - H:mm:ss - - - - - - - - diff --git a/tools/locale-builder/supp/ar_OM.xml b/tools/locale-builder/supp/ar_OM.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_OM.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_QA.xml b/tools/locale-builder/supp/ar_QA.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_QA.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_SA.xml b/tools/locale-builder/supp/ar_SA.xml deleted file mode 100755 index 76a8d61c512..00000000000 --- a/tools/locale-builder/supp/ar_SA.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -%icu; -] -> - - - - - - - - diff --git a/tools/locale-builder/supp/ar_SY.xml b/tools/locale-builder/supp/ar_SY.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_SY.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/ar_TN.xml b/tools/locale-builder/supp/ar_TN.xml deleted file mode 100644 index bbb9e19bda9..00000000000 --- a/tools/locale-builder/supp/ar_TN.xml +++ /dev/null @@ -1,36 +0,0 @@ - - -%icu; -] -> - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - H:mm:ss - - - - - - - - - - diff --git a/tools/locale-builder/supp/ar_YE.xml b/tools/locale-builder/supp/ar_YE.xml deleted file mode 100644 index 8c6d6846ca8..00000000000 --- a/tools/locale-builder/supp/ar_YE.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - - diff --git a/tools/locale-builder/supp/be_BY.xml b/tools/locale-builder/supp/be_BY.xml deleted file mode 100755 index c90790437e4..00000000000 --- a/tools/locale-builder/supp/be_BY.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/bg.xml b/tools/locale-builder/supp/bg.xml deleted file mode 100755 index 86ae563d808..00000000000 --- a/tools/locale-builder/supp/bg.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - . - - - - - - - - dd.M.yyyy 'г.' - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/ca_ES.xml b/tools/locale-builder/supp/ca_ES.xml deleted file mode 100755 index ba2db28c017..00000000000 --- a/tools/locale-builder/supp/ca_ES.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - #,##0 % - - - - - - - - - - - dd/MM/yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/cs_CZ.xml b/tools/locale-builder/supp/cs_CZ.xml deleted file mode 100755 index 275da59bf75..00000000000 --- a/tools/locale-builder/supp/cs_CZ.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - #,##0.###;-#,##0.### - - - - - - - . - - - - - - - d.M.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/da.xml b/tools/locale-builder/supp/da.xml deleted file mode 100755 index f79e32808f5..00000000000 --- a/tools/locale-builder/supp/da.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - #,##0 % - - - - - - - - - - - - - - - dd-MM-yyyy - - - - - dd. MMMM - - - - - - - HH:mm:ss - - - - - - - diff --git a/tools/locale-builder/supp/de.xml b/tools/locale-builder/supp/de.xml deleted file mode 100755 index 4a7f33827a1..00000000000 --- a/tools/locale-builder/supp/de.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/de_AT.xml b/tools/locale-builder/supp/de_AT.xml deleted file mode 100755 index 4a7f33827a1..00000000000 --- a/tools/locale-builder/supp/de_AT.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/el.xml b/tools/locale-builder/supp/el.xml deleted file mode 100755 index 83247170921..00000000000 --- a/tools/locale-builder/supp/el.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - #,##0 % - - - - - - - - - - - d/M/yyyy - - - - - - - h:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en.xml b/tools/locale-builder/supp/en.xml deleted file mode 100644 index a29945ad6bc..00000000000 --- a/tools/locale-builder/supp/en.xml +++ /dev/null @@ -1,89 +0,0 @@ - - -%icu; -] -> - - - - - - #,##0.###;-#,##0.### - - - - - - - #E0 - - - - - - - #,###.##0% - - - - - - - ¤#,##0.00;-¤#,##0.00 - - - - - - - - - - - - dddd, MMMM dd, yyyy - - - dddd, MMMM dd, yyyy - MMMM dd, yyyy - dddd, dd MMMM, yyyy - dd, MMMM, yyyy - - - - - - - - h:mm:ss tt - - - h:mm:ss tt - hh:mm:ss tt - H:mm:ss - HH:mm:ss - - - - - h:mm:ss a - - - - - h:mm tt - - - h:mm tt - hh:mm tt - H:mm - HH:mm - - - - - - - diff --git a/tools/locale-builder/supp/en_AU.xml b/tools/locale-builder/supp/en_AU.xml deleted file mode 100755 index e4fa640494f..00000000000 --- a/tools/locale-builder/supp/en_AU.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - d/MM/yyyy - - - - - - - h:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_CA.xml b/tools/locale-builder/supp/en_CA.xml deleted file mode 100644 index ee3149ae466..00000000000 --- a/tools/locale-builder/supp/en_CA.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - #,##0.###;-#,##0.### - - - - - - - - - - - dd/MM/yyyy - - - - - - - h:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_GB.xml b/tools/locale-builder/supp/en_GB.xml deleted file mode 100755 index 3f097c8e61b..00000000000 --- a/tools/locale-builder/supp/en_GB.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_IE.xml b/tools/locale-builder/supp/en_IE.xml deleted file mode 100644 index 2b6f3751bc4..00000000000 --- a/tools/locale-builder/supp/en_IE.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - HH:mm:ss - - - - - - - - - - - #,##0.###;-#,##0.### - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_NZ.xml b/tools/locale-builder/supp/en_NZ.xml deleted file mode 100755 index b36c1b43d4d..00000000000 --- a/tools/locale-builder/supp/en_NZ.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - a.m. - p.m. - - - - d/MM/yyyy - - - - - - - h:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_PH.xml b/tools/locale-builder/supp/en_PH.xml deleted file mode 100644 index 99096d93701..00000000000 --- a/tools/locale-builder/supp/en_PH.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - AM - PM - - - - - MM d, yyyy - - - - - M/d/yyyy - - - - - - - h:mm:ss tt - - - - - - - - - - - #,##0.###;-#,##0.### - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_TT.xml b/tools/locale-builder/supp/en_TT.xml deleted file mode 100644 index e7711ee81ba..00000000000 --- a/tools/locale-builder/supp/en_TT.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - AM - PM - - - - dd/MM/yyyy - - - yyyy-MM-dd - - - - - dddd, dd MMMM yyyy - - - - - - - hh:mm:ss tt - - - HH:mm:ss - - - - - - - - - - - #,##0.###;-#,##0.### - - - - - diff --git a/tools/locale-builder/supp/en_US.xml b/tools/locale-builder/supp/en_US.xml deleted file mode 100644 index b6169a3f52c..00000000000 --- a/tools/locale-builder/supp/en_US.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - #,##0.###;-#,##0.### - - - - - - - #,##0 % - - - - - - - - - - - M/d/yyyy - - - M/d/yyyy - M/d/yy - M/d/yy - MM/dd/yy - MM/dd/yyyy - yy/MM/dd - yyyy-MM-dd - dd-MMM-yy - - - - - dddd, MMMM dd, yyyy - - - - - MMMM, yyyy - - - - - - - h:mm:ss tt - - - - - - - {1} {0} - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_ZA.xml b/tools/locale-builder/supp/en_ZA.xml deleted file mode 100644 index 8d3234e11fc..00000000000 --- a/tools/locale-builder/supp/en_ZA.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - yyyy/MM/dd - - - - - - - hh:mm:ss tt - - - - - - - - - - - #,##0.###;-#,##0.### - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/en_ZW.xml b/tools/locale-builder/supp/en_ZW.xml deleted file mode 100644 index 496808e0313..00000000000 --- a/tools/locale-builder/supp/en_ZW.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - AM - PM - - - - M/d/yyyy - - - - - - - h:mm:ss tt - - - - - - - - - - - #,##0.###;-#,##0.### - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es.xml b/tools/locale-builder/supp/es.xml deleted file mode 100755 index 973908fbe72..00000000000 --- a/tools/locale-builder/supp/es.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - a.m. - p.m. - - - - MM/dd/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_AR.xml b/tools/locale-builder/supp/es_AR.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_AR.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_BO.xml b/tools/locale-builder/supp/es_BO.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_BO.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_CL.xml b/tools/locale-builder/supp/es_CL.xml deleted file mode 100755 index 555b1ba7b12..00000000000 --- a/tools/locale-builder/supp/es_CL.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_CO.xml b/tools/locale-builder/supp/es_CO.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_CO.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_CR.xml b/tools/locale-builder/supp/es_CR.xml deleted file mode 100755 index eccff247ae1..00000000000 --- a/tools/locale-builder/supp/es_CR.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_DO.xml b/tools/locale-builder/supp/es_DO.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_DO.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_EC.xml b/tools/locale-builder/supp/es_EC.xml deleted file mode 100755 index 8b62186686e..00000000000 --- a/tools/locale-builder/supp/es_EC.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_ES.xml b/tools/locale-builder/supp/es_ES.xml deleted file mode 100755 index 6ca89a7e437..00000000000 --- a/tools/locale-builder/supp/es_ES.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - dddd, dd' de 'MMMM' de 'yyyy - - - - - dddd, dd' de 'MMMM' de 'yyyy - - - - - MMMM' de 'yyyy - - - - - dd MMMM - - - - - - - H:mm:ss - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_GT.xml b/tools/locale-builder/supp/es_GT.xml deleted file mode 100755 index eccff247ae1..00000000000 --- a/tools/locale-builder/supp/es_GT.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_HN.xml b/tools/locale-builder/supp/es_HN.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_HN.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_MX.xml b/tools/locale-builder/supp/es_MX.xml deleted file mode 100755 index eccff247ae1..00000000000 --- a/tools/locale-builder/supp/es_MX.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_NI.xml b/tools/locale-builder/supp/es_NI.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_NI.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_PA.xml b/tools/locale-builder/supp/es_PA.xml deleted file mode 100755 index 5308262c274..00000000000 --- a/tools/locale-builder/supp/es_PA.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - MM/dd/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_PE.xml b/tools/locale-builder/supp/es_PE.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_PE.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_PR.xml b/tools/locale-builder/supp/es_PR.xml deleted file mode 100755 index a7fb435604c..00000000000 --- a/tools/locale-builder/supp/es_PR.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - #,##0.###;-#,##0.### - - - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_PY.xml b/tools/locale-builder/supp/es_PY.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_PY.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_SV.xml b/tools/locale-builder/supp/es_SV.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_SV.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_UY.xml b/tools/locale-builder/supp/es_UY.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_UY.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/es_VE.xml b/tools/locale-builder/supp/es_VE.xml deleted file mode 100755 index 49a89c2f9bb..00000000000 --- a/tools/locale-builder/supp/es_VE.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/et.xml b/tools/locale-builder/supp/et.xml deleted file mode 100755 index 1d8ef50bcdb..00000000000 --- a/tools/locale-builder/supp/et.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - d.MM.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/eu_ES.xml b/tools/locale-builder/supp/eu_ES.xml deleted file mode 100755 index 5a3dada9618..00000000000 --- a/tools/locale-builder/supp/eu_ES.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - yyyy/MM/dd - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fa.xml b/tools/locale-builder/supp/fa.xml deleted file mode 100755 index 8a232e66aa6..00000000000 --- a/tools/locale-builder/supp/fa.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - M/d/yyyy - - - - - - - hh:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fi.xml b/tools/locale-builder/supp/fi.xml deleted file mode 100755 index 6d4f681410d..00000000000 --- a/tools/locale-builder/supp/fi.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - #,##0 % - - - - - - - . - - - - - - - d.M.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fo_FO.xml b/tools/locale-builder/supp/fo_FO.xml deleted file mode 100755 index 88fddca25bf..00000000000 --- a/tools/locale-builder/supp/fo_FO.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - HH.mm.ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fr.xml b/tools/locale-builder/supp/fr.xml deleted file mode 100644 index 6dc13a604bb..00000000000 --- a/tools/locale-builder/supp/fr.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - dddd d MMMM yyyy - - - - - d/MM/yyyy - d/MM/yy - - - - - - - HH:mm:ss - - - - - - - {1} {0} - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fr_BE.xml b/tools/locale-builder/supp/fr_BE.xml deleted file mode 100755 index 91cc07b9010..00000000000 --- a/tools/locale-builder/supp/fr_BE.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - d/MM/yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fr_CA.xml b/tools/locale-builder/supp/fr_CA.xml deleted file mode 100755 index f8a3cc8f037..00000000000 --- a/tools/locale-builder/supp/fr_CA.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - yyyy-MM-dd - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fr_CH.xml b/tools/locale-builder/supp/fr_CH.xml deleted file mode 100755 index f2de8b0ba25..00000000000 --- a/tools/locale-builder/supp/fr_CH.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fr_FR.xml b/tools/locale-builder/supp/fr_FR.xml deleted file mode 100755 index ff3cd20b2a5..00000000000 --- a/tools/locale-builder/supp/fr_FR.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - #,##0 % - - - - - - - - - - - dd/MM/yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/fr_LU.xml b/tools/locale-builder/supp/fr_LU.xml deleted file mode 100755 index 88a4f57f0ce..00000000000 --- a/tools/locale-builder/supp/fr_LU.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/he.xml b/tools/locale-builder/supp/he.xml deleted file mode 100755 index c95fbfd9646..00000000000 --- a/tools/locale-builder/supp/he.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - %#,##0 - - - - - - - - - - - dd/MM/yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/hi_IN.xml b/tools/locale-builder/supp/hi_IN.xml deleted file mode 100755 index e13d46033ed..00000000000 --- a/tools/locale-builder/supp/hi_IN.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/hr.xml b/tools/locale-builder/supp/hr.xml deleted file mode 100755 index 66e399619ea..00000000000 --- a/tools/locale-builder/supp/hr.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - d.M.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/hu.xml b/tools/locale-builder/supp/hu.xml deleted file mode 100755 index ba3b66a7b5d..00000000000 --- a/tools/locale-builder/supp/hu.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - #,##0 % - - - - - - - . - - - - - - - yyyy. MM. dd. - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/hy.xml b/tools/locale-builder/supp/hy.xml deleted file mode 100755 index c90790437e4..00000000000 --- a/tools/locale-builder/supp/hy.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/id_ID.xml b/tools/locale-builder/supp/id_ID.xml deleted file mode 100755 index 03a91e091c9..00000000000 --- a/tools/locale-builder/supp/id_ID.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - #,##0;-#,##0 - - - - - - - - - - - - dd MMM yyyy - - - - - dd/MM/yyyy - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/is.xml b/tools/locale-builder/supp/is.xml deleted file mode 100755 index 23f637e3bac..00000000000 --- a/tools/locale-builder/supp/is.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - d.M.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/it_CH.xml b/tools/locale-builder/supp/it_CH.xml deleted file mode 100755 index 4a7f33827a1..00000000000 --- a/tools/locale-builder/supp/it_CH.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/it_IT.xml b/tools/locale-builder/supp/it_IT.xml deleted file mode 100755 index 4dc3b55bfd2..00000000000 --- a/tools/locale-builder/supp/it_IT.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - H.mm.ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/ja.xml b/tools/locale-builder/supp/ja.xml deleted file mode 100755 index 893830b485f..00000000000 --- a/tools/locale-builder/supp/ja.xml +++ /dev/null @@ -1,81 +0,0 @@ - - -%icu; -] -> - - - - - \ - - - - - - #,##0;-#,##0 - - - - - - - - - - - yyyy/MM/dd - - - yyyy/MM/dd - yy/MM/dd - yy/M/d - yyyy/M/d - yy/MM/dd' ('ddd')' - yy/M/d' ('ddd')' - yyyy/M/d' ('ddd')' - - - - - - yyyy'年'M'月'd'日' - yyyy'年'MM'月'dd'日' - yyyy'年'M'月'd'日' dddd - yyyy'年'MM'月'dd'日' dddd - - - - - - - H:mm:ss - - - HH:mm:ss - tt h:mm:ss - tt hh:mm:ss - - - - - H:mm - HH:mm - tt h:mm - tt hh:mm - - - - - - - {1} {0} - - - - - - - diff --git a/tools/locale-builder/supp/ka_GE.xml b/tools/locale-builder/supp/ka_GE.xml deleted file mode 100644 index 185bafd4f79..00000000000 --- a/tools/locale-builder/supp/ka_GE.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - yyyy 'წლის' dd MM, dddd - - - - - - - H:mm - - - - - H:mm:ss - - - - - - - diff --git a/tools/locale-builder/supp/ko_KR.xml b/tools/locale-builder/supp/ko_KR.xml deleted file mode 100755 index 6c511c2932c..00000000000 --- a/tools/locale-builder/supp/ko_KR.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - #,##0;-#,##0 - - - - - - - #,##0 % - - - - - - - - - - - yyyy/MM/dd - - - yyyy/MM/dd - yy/MM/dd - yy/M/d - yyyy/M/d - yyyy. MM. dd - yy. MM. dd - - - - - - yyyy'년' M'월' d'일' - - - yyyy'년' M'월' d'일' - yyyy'년' MM'월' dd'일' - yy'년' M'월' d'일' - yy'년' MM'월' dd'일' - - - - - - - tt h'시' mm'분' ss'초' - - - tt h'시' mm'분' ss'초' - H'시' m'분' ss'초' - HH'시' mm'분' ss'초' - H:mm:ss - HH:mm:ss - tt h'시' m'분' ss'초' - tt hh'시' mm'분' ss'초' - tt h:mm:ss - tt hh:mm:ss - - - - - tt h:mm - - - H:mm - HH:mm - H'시' m'분' - H'시' mm'분' - HH'시' mm'분' - tt h:mm - tt hh:mm - tt h'시' m'분' - tt h'시' mm'분' - tt hh'시' mm'분' - - - - - - - diff --git a/tools/locale-builder/supp/lt_LT.xml b/tools/locale-builder/supp/lt_LT.xml deleted file mode 100755 index fe44ebfa1d6..00000000000 --- a/tools/locale-builder/supp/lt_LT.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - #,##0.###;-#,##0.### - - - - - - - . - - - - - - - yyyy.MM.dd - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/lv.xml b/tools/locale-builder/supp/lv.xml deleted file mode 100755 index 48fd017943b..00000000000 --- a/tools/locale-builder/supp/lv.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - yyyy.MM.dd. - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/mk.xml b/tools/locale-builder/supp/mk.xml deleted file mode 100755 index 4a7f33827a1..00000000000 --- a/tools/locale-builder/supp/mk.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/nl_BE.xml b/tools/locale-builder/supp/nl_BE.xml deleted file mode 100755 index aba4a9924cc..00000000000 --- a/tools/locale-builder/supp/nl_BE.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - d/MM/yyyy - - - - - - - H:mm:ss - - - - - - - - - - - ¤ #,##0.00;¤ -#,##0.00 - - - - - diff --git a/tools/locale-builder/supp/nl_NL.xml b/tools/locale-builder/supp/nl_NL.xml deleted file mode 100755 index 66bb6613041..00000000000 --- a/tools/locale-builder/supp/nl_NL.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - #,##0 % - - - - - - - - - - - - - - - d-M-yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/pl.xml b/tools/locale-builder/supp/pl.xml deleted file mode 100755 index 65e79641ee3..00000000000 --- a/tools/locale-builder/supp/pl.xml +++ /dev/null @@ -1,37 +0,0 @@ - - -%icu; -] -> - - - - - - - - - - - - - - - - - yyyy-MM-dd - - - - - - - HH:mm:ss - - - - - - - diff --git a/tools/locale-builder/supp/pt.xml b/tools/locale-builder/supp/pt.xml deleted file mode 100755 index c424d37d4fa..00000000000 --- a/tools/locale-builder/supp/pt.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Real Brasileiro - R$ - - - - - diff --git a/tools/locale-builder/supp/pt_BR.xml b/tools/locale-builder/supp/pt_BR.xml deleted file mode 100755 index f06421234f3..00000000000 --- a/tools/locale-builder/supp/pt_BR.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - #,##0.00;(#,##0.00) - - - - - - - - - - - d/M/yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/pt_PT.xml b/tools/locale-builder/supp/pt_PT.xml deleted file mode 100755 index 7f111e743cc..00000000000 --- a/tools/locale-builder/supp/pt_PT.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - dd-MM-yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/ro.xml b/tools/locale-builder/supp/ro.xml deleted file mode 100755 index 4a7f33827a1..00000000000 --- a/tools/locale-builder/supp/ro.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/root.xml b/tools/locale-builder/supp/root.xml deleted file mode 100644 index 664e75f3af2..00000000000 --- a/tools/locale-builder/supp/root.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - / - : - - - - - NaN - Infinity - - - - diff --git a/tools/locale-builder/supp/ru.xml b/tools/locale-builder/supp/ru.xml deleted file mode 100755 index c90790437e4..00000000000 --- a/tools/locale-builder/supp/ru.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/sk.xml b/tools/locale-builder/supp/sk.xml deleted file mode 100755 index 6709138d6a2..00000000000 --- a/tools/locale-builder/supp/sk.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - d. M. yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/sl.xml b/tools/locale-builder/supp/sl.xml deleted file mode 100755 index 66e399619ea..00000000000 --- a/tools/locale-builder/supp/sl.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - d.M.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/sq.xml b/tools/locale-builder/supp/sq.xml deleted file mode 100755 index f1cdca828bb..00000000000 --- a/tools/locale-builder/supp/sq.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - yyyy-MM-dd - - - - - - - h:mm:ss.tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/sv_FI.xml b/tools/locale-builder/supp/sv_FI.xml deleted file mode 100755 index 23f637e3bac..00000000000 --- a/tools/locale-builder/supp/sv_FI.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - d.M.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/sv_SE.xml b/tools/locale-builder/supp/sv_SE.xml deleted file mode 100755 index 9db987ec35f..00000000000 --- a/tools/locale-builder/supp/sv_SE.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - yyyy-MM-dd - - - - - - - HH:mm:ss - - - - - HH:mm:ss - - - - - HH:mm - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/sw_KE.xml b/tools/locale-builder/supp/sw_KE.xml deleted file mode 100755 index f1937e16c75..00000000000 --- a/tools/locale-builder/supp/sw_KE.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - M/d/yyyy - - - - - - - h.mm.ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/th.xml b/tools/locale-builder/supp/th.xml deleted file mode 100644 index c8a5cf99099..00000000000 --- a/tools/locale-builder/supp/th.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -%icu; -] -> - - - - - - - - - d/M/yyyy - - - - - - - H:mm:ss - - - - - - - - diff --git a/tools/locale-builder/supp/tr.xml b/tools/locale-builder/supp/tr.xml deleted file mode 100755 index 4a7f33827a1..00000000000 --- a/tools/locale-builder/supp/tr.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - HH:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/uk.xml b/tools/locale-builder/supp/uk.xml deleted file mode 100755 index c90790437e4..00000000000 --- a/tools/locale-builder/supp/uk.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - . - - - - - - - dd.MM.yyyy - - - - - - - H:mm:ss - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supp/vi.xml b/tools/locale-builder/supp/vi.xml deleted file mode 100755 index 5f96b53b009..00000000000 --- a/tools/locale-builder/supp/vi.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - dd/MM/yyyy - - - - - - - h:mm:ss tt - - - - - - - \ No newline at end of file diff --git a/tools/locale-builder/supplementalData.xml b/tools/locale-builder/supplementalData.xml deleted file mode 100644 index ca4620776b8..00000000000 --- a/tools/locale-builder/supplementalData.xml +++ /dev/null @@ -1,968 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/locale-builder/tests/test-culture.cs b/tools/locale-builder/tests/test-culture.cs new file mode 100644 index 00000000000..79790956ca9 --- /dev/null +++ b/tools/locale-builder/tests/test-culture.cs @@ -0,0 +1,139 @@ +using System; +using System.IO; +using System.Linq; +using System.Globalization; +using System.Text; +using System.Collections.Generic; + +class TestCulture +{ + public static void Main () + { + var all = CultureInfo.GetCultures (CultureTypes.SpecificCultures | CultureTypes.NeutralCultures).OrderBy (l => l.LCID); + + Console.OutputEncoding = Encoding.UTF8; + var writer = Console.Out; + + foreach (var c in all) { + if (c.LCID == CultureInfo.InvariantCulture.LCID) + continue; + + writer.WriteLine ("Name: {0}, LCID 0x{1}", c.Name , c.LCID.ToString ("X4")); + + writer.WriteLine ("{0}: {1}", "DisplayName", c.DisplayName); + writer.WriteLine ("{0}: {1}", "EnglishName", c.EnglishName); + writer.WriteLine ("{0}: {1}", "NativeName", c.NativeName); + // writer.WriteLine ("{0}: {1}", "OptionalCalendars", c.OptionalCalendars); + writer.WriteLine ("{0}: {1}", "ThreeLetterISOLanguageName", c.ThreeLetterISOLanguageName); + writer.WriteLine ("{0}: {1}", "ThreeLetterWindowsLanguageName", c.ThreeLetterWindowsLanguageName); + writer.WriteLine ("{0}: {1}", "TwoLetterISOLanguageName", c.TwoLetterISOLanguageName); + writer.WriteLine ("{0}: {1}", "Calendar", c.Calendar.GetType ()); + + var df = c.DateTimeFormat; + writer.WriteLine ("-- DateTimeFormat --"); + Dump (writer, df.AbbreviatedDayNames, "AbbreviatedDayNames"); + Dump (writer, df.AbbreviatedMonthGenitiveNames, "AbbreviatedMonthGenitiveNames"); + Dump (writer, df.AbbreviatedMonthNames, "AbbreviatedMonthNames"); + writer.WriteLine ("{0}: {1}", "AMDesignator", df.AMDesignator); + writer.WriteLine ("{0}: {1}", "CalendarWeekRule", df.CalendarWeekRule); + writer.WriteLine ("{0}: {1}", "DateSeparator", df.DateSeparator); + Dump (writer, df.DayNames, "DayNames"); + writer.WriteLine ("{0}: {1}", "FirstDayOfWeek", df.FirstDayOfWeek); + Dump (writer, df.GetAllDateTimePatterns (), "GetAllDateTimePatterns"); + // df.GetAbbreviatedEraName + // df.GetEra + // df.GetEraName + writer.WriteLine ("{0}: {1}", "LongDatePattern", df.LongDatePattern); + writer.WriteLine ("{0}: {1}", "LongTimePattern", df.LongTimePattern); + writer.WriteLine ("{0}: {1}", "MonthDayPattern", df.MonthDayPattern); + Dump (writer, df.MonthGenitiveNames, "MonthGenitiveNames"); + Dump (writer, df.MonthNames, "MonthNames"); + writer.WriteLine ("{0}: {1}", "NativeCalendarName", df.NativeCalendarName); + writer.WriteLine ("{0}: {1}", "PMDesignator", df.PMDesignator); + writer.WriteLine ("{0}: {1}", "ShortDatePattern", df.ShortDatePattern); + Dump (writer, df.ShortestDayNames, "ShortestDayNames"); + writer.WriteLine ("{0}: {1}", "ShortTimePattern", df.ShortTimePattern); + writer.WriteLine ("{0}: {1}", "TimeSeparator", df.TimeSeparator); + writer.WriteLine ("{0}: {1}", "YearMonthPattern", df.YearMonthPattern); + + var ti = c.TextInfo; + writer.WriteLine ("-- TextInfo --"); + writer.WriteLine ("{0}: {1}", "ANSICodePage", ti.ANSICodePage); + writer.WriteLine ("{0}: {1}", "EBCDICCodePage", ti.EBCDICCodePage); + writer.WriteLine ("{0}: {1}", "IsRightToLeft", ti.IsRightToLeft); + writer.WriteLine ("{0}: {1}", "ListSeparator", ti.ListSeparator); + writer.WriteLine ("{0}: {1}", "MacCodePage", ti.MacCodePage); + writer.WriteLine ("{0}: {1}", "OEMCodePage", ti.OEMCodePage); + + var nf = c.NumberFormat; + writer.WriteLine ("-- NumberFormat --"); + writer.WriteLine ("{0}: {1}", "CurrencyDecimalDigits", nf.CurrencyDecimalDigits); + writer.WriteLine ("{0}: {1}", "CurrencyDecimalSeparator", nf.CurrencyDecimalSeparator); + writer.WriteLine ("{0}: {1}", "CurrencyGroupSeparator", nf.CurrencyGroupSeparator); + Dump (writer, nf.CurrencyGroupSizes, "CurrencyGroupSizes"); + writer.WriteLine ("{0}: {1}", "CurrencyNegativePattern", nf.CurrencyNegativePattern); + writer.WriteLine ("{0}: {1}", "CurrencyPositivePattern", nf.CurrencyPositivePattern); + writer.WriteLine ("{0}: {1}", "CurrencySymbol", nf.CurrencySymbol); + writer.WriteLine ("{0}: {1}", "DigitSubstitution", nf.DigitSubstitution); + writer.WriteLine ("{0}: {1}", "NaNSymbol", nf.NaNSymbol); + Dump (writer, nf.NativeDigits, "NativeDigits"); + writer.WriteLine ("{0}: {1}", "NegativeInfinitySymbol", nf.NegativeInfinitySymbol); + writer.WriteLine ("{0}: {1}", "NegativeSign", nf.NegativeSign); + writer.WriteLine ("{0}: {1}", "NumberDecimalDigits", nf.NumberDecimalDigits); + writer.WriteLine ("{0}: {1}", "NumberDecimalSeparator", nf.NumberDecimalSeparator); + writer.WriteLine ("{0}: {1}", "NumberGroupSeparator", nf.NumberGroupSeparator); + Dump (writer, nf.NumberGroupSizes, "NumberGroupSizes"); + writer.WriteLine ("{0}: {1}", "NumberNegativePattern", nf.NumberNegativePattern); + writer.WriteLine ("{0}: {1}", "PercentDecimalDigits", nf.PercentDecimalDigits); + writer.WriteLine ("{0}: {1}", "PercentDecimalSeparator", nf.PercentDecimalSeparator); + writer.WriteLine ("{0}: {1}", "PercentGroupSeparator", nf.PercentGroupSeparator); + Dump (writer, nf.PercentGroupSizes, "PercentGroupSizes"); + writer.WriteLine ("{0}: {1}", "PercentNegativePattern", nf.PercentNegativePattern); + writer.WriteLine ("{0}: {1}", "PercentPositivePattern", nf.PercentPositivePattern); + writer.WriteLine ("{0}: {1}", "PercentSymbol", nf.PercentSymbol); + writer.WriteLine ("{0}: {1}", "PerMilleSymbol", nf.PerMilleSymbol); + writer.WriteLine ("{0}: {1}", "PositiveInfinitySymbol", nf.PositiveInfinitySymbol); + writer.WriteLine ("{0}: {1}", "PositiveSign", nf.PositiveSign); + + if (!c.IsNeutralCulture) { + var ri = new RegionInfo (c.LCID); + writer.WriteLine ("-- RegionInfo --"); + writer.WriteLine ("{0}: {1}", "CurrencyEnglishName", ri.CurrencyEnglishName); + writer.WriteLine ("{0}: {1}", "CurrencyNativeName", ri.CurrencyNativeName); + writer.WriteLine ("{0}: {1}", "CurrencySymbol", ri.CurrencySymbol); + writer.WriteLine ("{0}: {1}", "DisplayName", ri.DisplayName); + writer.WriteLine ("{0}: {1}", "EnglishName", ri.EnglishName); + writer.WriteLine ("{0}: {1}", "GeoId", ri.GeoId); + writer.WriteLine ("{0}: {1}", "IsMetric", ri.IsMetric); + writer.WriteLine ("{0}: {1}", "ISOCurrencySymbol", ri.ISOCurrencySymbol); + writer.WriteLine ("{0}: {1}", "Name", ri.Name); + writer.WriteLine ("{0}: {1}", "NativeName", ri.NativeName); + writer.WriteLine ("{0}: {1}", "ThreeLetterISORegionName", ri.ThreeLetterISORegionName); + writer.WriteLine ("{0}: {1}", "ThreeLetterWindowsRegionName", ri.ThreeLetterWindowsRegionName); + writer.WriteLine ("{0}: {1}", "TwoLetterISORegionName", ri.TwoLetterISORegionName); + } + + CompareInfo ci = CompareInfo.GetCompareInfo (c.LCID); + writer.WriteLine ("-- CompareInfo --"); + writer.WriteLine ("{0}: {1}", "Name", ci.Name); + //writer.WriteLine ("{0}: {1}", "Version", ci.Version); + + writer.WriteLine (); + } + } + + static void Dump (TextWriter tw, T[] values, string name) + { + tw.Write (name); + tw.Write (": "); + + for (int i = 0; i < values.Length; ++i) { + if (i > 0) + tw.Write (", "); + + tw.Write (values[i]); + } + + tw.WriteLine (); + } +} diff --git a/tools/locale-builder/textinfo.xml b/tools/locale-builder/textinfo.xml deleted file mode 100644 index e4333bb0773..00000000000 --- a/tools/locale-builder/textinfo.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file